[turbofan] Cleanup use of virtual, OVERRIDE, FINAL.

Following the Google/Chromium coding style wrt. virtual, OVERRIDE and
FINAL specifications.

TEST=unittests
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/816453005

Cr-Commit-Position: refs/heads/master@{#25924}
This commit is contained in:
Benedikt Meurer 2014-12-22 14:47:54 +01:00
parent eff42215f0
commit 1ec1f5957f
19 changed files with 108 additions and 127 deletions

View File

@ -114,7 +114,7 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
// Builder for stack-check guards. // Builder for stack-check guards.
Node* BuildStackCheck(); Node* BuildStackCheck();
#define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE; #define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE;
// Visiting functions for AST nodes make this an AstVisitor. // Visiting functions for AST nodes make this an AstVisitor.
AST_NODE_LIST(DECLARE_VISIT) AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT #undef DECLARE_VISIT
@ -347,9 +347,9 @@ class AstGraphBuilder::AstEffectContext FINAL : public AstContext {
public: public:
explicit AstEffectContext(AstGraphBuilder* owner) explicit AstEffectContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kEffect) {} : AstContext(owner, Expression::kEffect) {}
virtual ~AstEffectContext(); ~AstEffectContext() FINAL;
void ProduceValue(Node* value) OVERRIDE; void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() OVERRIDE; Node* ConsumeValue() FINAL;
}; };
@ -358,9 +358,9 @@ class AstGraphBuilder::AstValueContext FINAL : public AstContext {
public: public:
explicit AstValueContext(AstGraphBuilder* owner) explicit AstValueContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kValue) {} : AstContext(owner, Expression::kValue) {}
virtual ~AstValueContext(); ~AstValueContext() FINAL;
void ProduceValue(Node* value) OVERRIDE; void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() OVERRIDE; Node* ConsumeValue() FINAL;
}; };
@ -369,9 +369,9 @@ class AstGraphBuilder::AstTestContext FINAL : public AstContext {
public: public:
explicit AstTestContext(AstGraphBuilder* owner) explicit AstTestContext(AstGraphBuilder* owner)
: AstContext(owner, Expression::kTest) {} : AstContext(owner, Expression::kTest) {}
virtual ~AstTestContext(); ~AstTestContext() FINAL;
void ProduceValue(Node* value) OVERRIDE; void ProduceValue(Node* value) FINAL;
Node* ConsumeValue() OVERRIDE; Node* ConsumeValue() FINAL;
}; };

View File

@ -21,9 +21,9 @@ class ChangeLowering FINAL : public Reducer {
public: public:
ChangeLowering(JSGraph* jsgraph, Linkage* linkage) ChangeLowering(JSGraph* jsgraph, Linkage* linkage)
: jsgraph_(jsgraph), linkage_(linkage) {} : jsgraph_(jsgraph), linkage_(linkage) {}
virtual ~ChangeLowering(); ~ChangeLowering() FINAL;
Reduction Reduce(Node* node) OVERRIDE; Reduction Reduce(Node* node) FINAL;
private: private:
Node* HeapNumberValueIndexConstant(); Node* HeapNumberValueIndexConstant();

View File

@ -86,10 +86,10 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
// =========================================================================== // ===========================================================================
// Interface used by the gap resolver to emit moves and swaps. // Interface used by the gap resolver to emit moves and swaps.
virtual void AssembleMove(InstructionOperand* source, void AssembleMove(InstructionOperand* source,
InstructionOperand* destination) OVERRIDE; InstructionOperand* destination) FINAL;
virtual void AssembleSwap(InstructionOperand* source, void AssembleSwap(InstructionOperand* source,
InstructionOperand* destination) OVERRIDE; InstructionOperand* destination) FINAL;
// =========================================================================== // ===========================================================================
// Deoptimization table construction // Deoptimization table construction

View File

@ -40,7 +40,7 @@ class ControlBuilder {
// Tracks control flow for a conditional statement. // Tracks control flow for a conditional statement.
class IfBuilder : public ControlBuilder { class IfBuilder FINAL : public ControlBuilder {
public: public:
explicit IfBuilder(StructuredGraphBuilder* builder) explicit IfBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder), : ControlBuilder(builder),
@ -60,7 +60,7 @@ class IfBuilder : public ControlBuilder {
// Tracks control flow for an iteration statement. // Tracks control flow for an iteration statement.
class LoopBuilder : public ControlBuilder { class LoopBuilder FINAL : public ControlBuilder {
public: public:
explicit LoopBuilder(StructuredGraphBuilder* builder) explicit LoopBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder), : ControlBuilder(builder),
@ -74,8 +74,8 @@ class LoopBuilder : public ControlBuilder {
void EndLoop(); void EndLoop();
// Primitive support for break and continue. // Primitive support for break and continue.
virtual void Continue(); void Continue() FINAL;
virtual void Break(); void Break() FINAL;
// Compound control command for conditional break. // Compound control command for conditional break.
void BreakUnless(Node* condition); void BreakUnless(Node* condition);
@ -88,7 +88,7 @@ class LoopBuilder : public ControlBuilder {
// Tracks control flow for a switch statement. // Tracks control flow for a switch statement.
class SwitchBuilder : public ControlBuilder { class SwitchBuilder FINAL : public ControlBuilder {
public: public:
explicit SwitchBuilder(StructuredGraphBuilder* builder, int case_count) explicit SwitchBuilder(StructuredGraphBuilder* builder, int case_count)
: ControlBuilder(builder), : ControlBuilder(builder),
@ -107,7 +107,7 @@ class SwitchBuilder : public ControlBuilder {
void EndSwitch(); void EndSwitch();
// Primitive support for break. // Primitive support for break.
virtual void Break(); void Break() FINAL;
// The number of cases within a switch is statically known. // The number of cases within a switch is statically known.
size_t case_count() const { return body_environments_.size(); } size_t case_count() const { return body_environments_.size(); }
@ -121,7 +121,7 @@ class SwitchBuilder : public ControlBuilder {
// Tracks control flow for a block statement. // Tracks control flow for a block statement.
class BlockBuilder : public ControlBuilder { class BlockBuilder FINAL : public ControlBuilder {
public: public:
explicit BlockBuilder(StructuredGraphBuilder* builder) explicit BlockBuilder(StructuredGraphBuilder* builder)
: ControlBuilder(builder), break_environment_(NULL) {} : ControlBuilder(builder), break_environment_(NULL) {}
@ -131,13 +131,14 @@ class BlockBuilder : public ControlBuilder {
void EndBlock(); void EndBlock();
// Primitive support for break. // Primitive support for break.
virtual void Break(); void Break() FINAL;
private: private:
Environment* break_environment_; // Environment after the block exits. Environment* break_environment_; // Environment after the block exits.
}; };
}
} } // namespace compiler
} // namespace v8::internal::compiler } // namespace internal
} // namespace v8
#endif // V8_COMPILER_CONTROL_BUILDERS_H_ #endif // V8_COMPILER_CONTROL_BUILDERS_H_

View File

@ -39,8 +39,9 @@ class GapResolver FINAL {
// Assembler used to emit moves and save registers. // Assembler used to emit moves and save registers.
Assembler* const assembler_; Assembler* const assembler_;
}; };
}
} } // namespace compiler
} // namespace v8::internal::compiler } // namespace internal
} // namespace v8
#endif // V8_COMPILER_GAP_RESOLVER_H_ #endif // V8_COMPILER_GAP_RESOLVER_H_

View File

@ -86,7 +86,7 @@ class StructuredGraphBuilder : public GraphBuilder {
public: public:
StructuredGraphBuilder(Zone* zone, Graph* graph, StructuredGraphBuilder(Zone* zone, Graph* graph,
CommonOperatorBuilder* common); CommonOperatorBuilder* common);
virtual ~StructuredGraphBuilder() {} ~StructuredGraphBuilder() OVERRIDE {}
// Creates a new Phi node having {count} input values. // Creates a new Phi node having {count} input values.
Node* NewPhi(int count, Node* input, Node* control); Node* NewPhi(int count, Node* input, Node* control);
@ -114,8 +114,8 @@ class StructuredGraphBuilder : public GraphBuilder {
// The following method creates a new node having the specified operator and // The following method creates a new node having the specified operator and
// ensures effect and control dependencies are wired up. The dependencies // ensures effect and control dependencies are wired up. The dependencies
// tracked by the environment might be mutated. // tracked by the environment might be mutated.
virtual Node* MakeNode(const Operator* op, int value_input_count, Node* MakeNode(const Operator* op, int value_input_count, Node** value_inputs,
Node** value_inputs, bool incomplete) FINAL; bool incomplete) FINAL;
Environment* environment() const { return environment_; } Environment* environment() const { return environment_; }
void set_environment(Environment* env) { environment_ = env; } void set_environment(Environment* env) { environment_ = env; }

View File

@ -22,13 +22,14 @@ class CommonOperatorBuilder;
class MachineOperatorBuilder; class MachineOperatorBuilder;
class Linkage; class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case. // Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering : public Reducer { class JSGenericLowering FINAL : public Reducer {
public: public:
JSGenericLowering(CompilationInfo* info, JSGraph* graph); JSGenericLowering(CompilationInfo* info, JSGraph* graph);
virtual ~JSGenericLowering() {} ~JSGenericLowering() FINAL {}
virtual Reduction Reduce(Node* node); Reduction Reduce(Node* node) FINAL;
protected: protected:
#define DECLARE_LOWER(x) void Lower##x(Node* node); #define DECLARE_LOWER(x) void Lower##x(Node* node);

View File

@ -48,7 +48,7 @@ class RawMachineAssembler : public GraphBuilder {
MachineType word = kMachPtr, MachineType word = kMachPtr,
MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::Flags flags =
MachineOperatorBuilder::Flag::kNoFlags); MachineOperatorBuilder::Flag::kNoFlags);
virtual ~RawMachineAssembler() {} ~RawMachineAssembler() OVERRIDE {}
Isolate* isolate() const { return zone()->isolate(); } Isolate* isolate() const { return zone()->isolate(); }
Zone* zone() const { return graph()->zone(); } Zone* zone() const { return graph()->zone(); }
@ -430,8 +430,8 @@ class RawMachineAssembler : public GraphBuilder {
Schedule* Export(); Schedule* Export();
protected: protected:
virtual Node* MakeNode(const Operator* op, int input_count, Node** inputs, Node* MakeNode(const Operator* op, int input_count, Node** inputs,
bool incomplete) FINAL; bool incomplete) FINAL;
bool ScheduleValid() { return schedule_ != NULL; } bool ScheduleValid() { return schedule_ != NULL; }

View File

@ -23,9 +23,9 @@ class MachineOperatorBuilder;
class SimplifiedOperatorReducer FINAL : public Reducer { class SimplifiedOperatorReducer FINAL : public Reducer {
public: public:
explicit SimplifiedOperatorReducer(JSGraph* jsgraph); explicit SimplifiedOperatorReducer(JSGraph* jsgraph);
virtual ~SimplifiedOperatorReducer(); ~SimplifiedOperatorReducer() FINAL;
Reduction Reduce(Node* node) OVERRIDE; Reduction Reduce(Node* node) FINAL;
private: private:
Reduction Change(Node* node, const Operator* op, Node* a); Reduction Change(Node* node, const Operator* op, Node* a);

View File

@ -10,12 +10,12 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
class SourcePositionTable::Decorator : public GraphDecorator { class SourcePositionTable::Decorator FINAL : public GraphDecorator {
public: public:
explicit Decorator(SourcePositionTable* source_positions) explicit Decorator(SourcePositionTable* source_positions)
: source_positions_(source_positions) {} : source_positions_(source_positions) {}
virtual void Decorate(Node* node) { void Decorate(Node* node) FINAL {
DCHECK(!source_positions_->current_position_.IsInvalid()); DCHECK(!source_positions_->current_position_.IsInvalid());
source_positions_->table_.Set(node, source_positions_->current_position_); source_positions_->table_.Set(node, source_positions_->current_position_);
} }

View File

@ -138,10 +138,10 @@ class LazyTypeCache FINAL : public ZoneObject {
}; };
class Typer::Decorator : public GraphDecorator { class Typer::Decorator FINAL : public GraphDecorator {
public: public:
explicit Decorator(Typer* typer) : typer_(typer) {} explicit Decorator(Typer* typer) : typer_(typer) {}
virtual void Decorate(Node* node); void Decorate(Node* node) FINAL;
private: private:
Typer* typer_; Typer* typer_;

View File

@ -24,7 +24,7 @@ namespace compiler {
class ChangeLoweringTest : public GraphTest { class ChangeLoweringTest : public GraphTest {
public: public:
ChangeLoweringTest() : simplified_(zone()) {} ChangeLoweringTest() : simplified_(zone()) {}
virtual ~ChangeLoweringTest() {} ~ChangeLoweringTest() OVERRIDE {}
virtual MachineType WordRepresentation() const = 0; virtual MachineType WordRepresentation() const = 0;
@ -111,9 +111,9 @@ class ChangeLoweringCommonTest
: public ChangeLoweringTest, : public ChangeLoweringTest,
public ::testing::WithParamInterface<MachineType> { public ::testing::WithParamInterface<MachineType> {
public: public:
virtual ~ChangeLoweringCommonTest() {} ~ChangeLoweringCommonTest() OVERRIDE {}
virtual MachineType WordRepresentation() const FINAL { return GetParam(); } MachineType WordRepresentation() const FINAL { return GetParam(); }
}; };
@ -176,8 +176,8 @@ INSTANTIATE_TEST_CASE_P(ChangeLoweringTest, ChangeLoweringCommonTest,
class ChangeLowering32Test : public ChangeLoweringTest { class ChangeLowering32Test : public ChangeLoweringTest {
public: public:
virtual ~ChangeLowering32Test() {} ~ChangeLowering32Test() OVERRIDE {}
virtual MachineType WordRepresentation() const FINAL { return kRepWord32; } MachineType WordRepresentation() const FINAL { return kRepWord32; }
}; };
@ -334,8 +334,8 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeUint32ToTagged) {
class ChangeLowering64Test : public ChangeLoweringTest { class ChangeLowering64Test : public ChangeLoweringTest {
public: public:
virtual ~ChangeLowering64Test() {} ~ChangeLowering64Test() OVERRIDE {}
virtual MachineType WordRepresentation() const FINAL { return kRepWord64; } MachineType WordRepresentation() const FINAL { return kRepWord64; }
}; };

View File

@ -117,7 +117,7 @@ namespace {
class CommonOperatorTest : public TestWithZone { class CommonOperatorTest : public TestWithZone {
public: public:
CommonOperatorTest() : common_(zone()) {} CommonOperatorTest() : common_(zone()) {}
virtual ~CommonOperatorTest() {} ~CommonOperatorTest() OVERRIDE {}
CommonOperatorBuilder* common() { return &common_; } CommonOperatorBuilder* common() { return &common_; }

View File

@ -30,7 +30,7 @@ using ::testing::Matcher;
class GraphTest : public TestWithContext, public TestWithZone { class GraphTest : public TestWithContext, public TestWithZone {
public: public:
explicit GraphTest(int parameters = 1); explicit GraphTest(int parameters = 1);
virtual ~GraphTest(); ~GraphTest() OVERRIDE;
protected: protected:
Node* Parameter(int32_t index); Node* Parameter(int32_t index);

View File

@ -21,7 +21,7 @@ namespace compiler {
class InstructionSelectorTest : public TestWithContext, public TestWithZone { class InstructionSelectorTest : public TestWithContext, public TestWithZone {
public: public:
InstructionSelectorTest(); InstructionSelectorTest();
virtual ~InstructionSelectorTest(); ~InstructionSelectorTest() OVERRIDE;
base::RandomNumberGenerator* rng() { return &rng_; } base::RandomNumberGenerator* rng() { return &rng_; }

View File

@ -40,7 +40,7 @@ const StrictMode kStrictModes[] = {SLOPPY, STRICT};
class JSTypedLoweringTest : public TypedGraphTest { class JSTypedLoweringTest : public TypedGraphTest {
public: public:
JSTypedLoweringTest() : TypedGraphTest(3), javascript_(zone()) {} JSTypedLoweringTest() : TypedGraphTest(3), javascript_(zone()) {}
virtual ~JSTypedLoweringTest() {} ~JSTypedLoweringTest() OVERRIDE {}
protected: protected:
Reduction Reduce(Node* node) { Reduction Reduce(Node* node) {

View File

@ -66,7 +66,7 @@ class MachineOperatorReducerTestWithParam
public: public:
explicit MachineOperatorReducerTestWithParam(int num_parameters = 2) explicit MachineOperatorReducerTestWithParam(int num_parameters = 2)
: MachineOperatorReducerTest(num_parameters) {} : MachineOperatorReducerTest(num_parameters) {}
virtual ~MachineOperatorReducerTestWithParam() {} ~MachineOperatorReducerTestWithParam() OVERRIDE {}
}; };

View File

@ -19,7 +19,7 @@ namespace compiler {
class NodeMatcherTest : public GraphTest { class NodeMatcherTest : public GraphTest {
public: public:
NodeMatcherTest() : machine_(zone()) {} NodeMatcherTest() : machine_(zone()) {}
virtual ~NodeMatcherTest() {} ~NodeMatcherTest() OVERRIDE {}
MachineOperatorBuilder* machine() { return &machine_; } MachineOperatorBuilder* machine() { return &machine_; }

View File

@ -39,12 +39,12 @@ class NodeMatcher : public MatcherInterface<Node*> {
public: public:
explicit NodeMatcher(IrOpcode::Value opcode) : opcode_(opcode) {} explicit NodeMatcher(IrOpcode::Value opcode) : opcode_(opcode) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const OVERRIDE {
*os << "is a " << IrOpcode::Mnemonic(opcode_) << " node"; *os << "is a " << IrOpcode::Mnemonic(opcode_) << " node";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node,
MatchResultListener* listener) const OVERRIDE { MatchResultListener* listener) const OVERRIDE {
if (node == NULL) { if (node == NULL) {
*listener << "which is NULL"; *listener << "which is NULL";
return false; return false;
@ -70,7 +70,7 @@ class IsBranchMatcher FINAL : public NodeMatcher {
value_matcher_(value_matcher), value_matcher_(value_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose value ("; *os << " whose value (";
value_matcher_.DescribeTo(os); value_matcher_.DescribeTo(os);
@ -79,8 +79,7 @@ class IsBranchMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value", value_matcher_, listener) && "value", value_matcher_, listener) &&
@ -102,7 +101,7 @@ class IsMergeMatcher FINAL : public NodeMatcher {
control0_matcher_(control0_matcher), control0_matcher_(control0_matcher),
control1_matcher_(control1_matcher) {} control1_matcher_(control1_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose control0 ("; *os << " whose control0 (";
control0_matcher_.DescribeTo(os); control0_matcher_.DescribeTo(os);
@ -111,8 +110,7 @@ class IsMergeMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node, 0), PrintMatchAndExplain(NodeProperties::GetControlInput(node, 0),
"control0", control0_matcher_, listener) && "control0", control0_matcher_, listener) &&
@ -132,15 +130,14 @@ class IsControl1Matcher FINAL : public NodeMatcher {
const Matcher<Node*>& control_matcher) const Matcher<Node*>& control_matcher)
: NodeMatcher(opcode), control_matcher_(control_matcher) {} : NodeMatcher(opcode), control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose control ("; *os << " whose control (";
control_matcher_.DescribeTo(os); control_matcher_.DescribeTo(os);
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node), PrintMatchAndExplain(NodeProperties::GetControlInput(node),
"control", control_matcher_, listener)); "control", control_matcher_, listener));
@ -159,7 +156,7 @@ class IsFinishMatcher FINAL : public NodeMatcher {
value_matcher_(value_matcher), value_matcher_(value_matcher),
effect_matcher_(effect_matcher) {} effect_matcher_(effect_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose value ("; *os << " whose value (";
value_matcher_.DescribeTo(os); value_matcher_.DescribeTo(os);
@ -168,8 +165,7 @@ class IsFinishMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value", value_matcher_, listener) && "value", value_matcher_, listener) &&
@ -189,15 +185,14 @@ class IsConstantMatcher FINAL : public NodeMatcher {
IsConstantMatcher(IrOpcode::Value opcode, const Matcher<T>& value_matcher) IsConstantMatcher(IrOpcode::Value opcode, const Matcher<T>& value_matcher)
: NodeMatcher(opcode), value_matcher_(value_matcher) {} : NodeMatcher(opcode), value_matcher_(value_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose value ("; *os << " whose value (";
value_matcher_.DescribeTo(os); value_matcher_.DescribeTo(os);
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<T>(node), "value", value_matcher_, PrintMatchAndExplain(OpParameter<T>(node), "value", value_matcher_,
listener)); listener));
@ -220,7 +215,7 @@ class IsSelectMatcher FINAL : public NodeMatcher {
value1_matcher_(value1_matcher), value1_matcher_(value1_matcher),
value2_matcher_(value2_matcher) {} value2_matcher_(value2_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose type ("; *os << " whose type (";
type_matcher_.DescribeTo(os); type_matcher_.DescribeTo(os);
@ -233,8 +228,7 @@ class IsSelectMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<MachineType>(node), "type", PrintMatchAndExplain(OpParameter<MachineType>(node), "type",
type_matcher_, listener) && type_matcher_, listener) &&
@ -266,7 +260,7 @@ class IsPhiMatcher FINAL : public NodeMatcher {
value1_matcher_(value1_matcher), value1_matcher_(value1_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose type ("; *os << " whose type (";
type_matcher_.DescribeTo(os); type_matcher_.DescribeTo(os);
@ -279,8 +273,7 @@ class IsPhiMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<MachineType>(node), "type", PrintMatchAndExplain(OpParameter<MachineType>(node), "type",
type_matcher_, listener) && type_matcher_, listener) &&
@ -310,7 +303,7 @@ class IsEffectPhiMatcher FINAL : public NodeMatcher {
effect1_matcher_(effect1_matcher), effect1_matcher_(effect1_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << "), effect0 ("; *os << "), effect0 (";
effect0_matcher_.DescribeTo(os); effect0_matcher_.DescribeTo(os);
@ -321,8 +314,7 @@ class IsEffectPhiMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetEffectInput(node, 0), PrintMatchAndExplain(NodeProperties::GetEffectInput(node, 0),
"effect0", effect0_matcher_, listener) && "effect0", effect0_matcher_, listener) &&
@ -347,7 +339,7 @@ class IsProjectionMatcher FINAL : public NodeMatcher {
index_matcher_(index_matcher), index_matcher_(index_matcher),
base_matcher_(base_matcher) {} base_matcher_(base_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose index ("; *os << " whose index (";
index_matcher_.DescribeTo(os); index_matcher_.DescribeTo(os);
@ -356,8 +348,7 @@ class IsProjectionMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<size_t>(node), "index", PrintMatchAndExplain(OpParameter<size_t>(node), "index",
index_matcher_, listener) && index_matcher_, listener) &&
@ -385,7 +376,7 @@ class IsCall2Matcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose value0 ("; *os << " whose value0 (";
value0_matcher_.DescribeTo(os); value0_matcher_.DescribeTo(os);
@ -398,8 +389,7 @@ class IsCall2Matcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<CallDescriptor*>(node), PrintMatchAndExplain(OpParameter<CallDescriptor*>(node),
"descriptor", descriptor_matcher_, listener) && "descriptor", descriptor_matcher_, listener) &&
@ -440,7 +430,7 @@ class IsCall4Matcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose value0 ("; *os << " whose value0 (";
value0_matcher_.DescribeTo(os); value0_matcher_.DescribeTo(os);
@ -457,8 +447,7 @@ class IsCall4Matcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<CallDescriptor*>(node), PrintMatchAndExplain(OpParameter<CallDescriptor*>(node),
"descriptor", descriptor_matcher_, listener) && "descriptor", descriptor_matcher_, listener) &&
@ -499,7 +488,7 @@ class IsLoadFieldMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -512,8 +501,7 @@ class IsLoadFieldMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<FieldAccess>(node), "access", PrintMatchAndExplain(OpParameter<FieldAccess>(node), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -547,7 +535,7 @@ class IsStoreFieldMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -562,8 +550,7 @@ class IsStoreFieldMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<FieldAccess>(node), "access", PrintMatchAndExplain(OpParameter<FieldAccess>(node), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -602,7 +589,7 @@ class IsLoadBufferMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -619,8 +606,7 @@ class IsLoadBufferMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(BufferAccessOf(node->op()), "access", PrintMatchAndExplain(BufferAccessOf(node->op()), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -664,7 +650,7 @@ class IsStoreBufferMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -683,8 +669,7 @@ class IsStoreBufferMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(BufferAccessOf(node->op()), "access", PrintMatchAndExplain(BufferAccessOf(node->op()), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -727,7 +712,7 @@ class IsLoadElementMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -742,8 +727,7 @@ class IsLoadElementMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<ElementAccess>(node), "access", PrintMatchAndExplain(OpParameter<ElementAccess>(node), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -782,7 +766,7 @@ class IsStoreElementMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose access ("; *os << " whose access (";
access_matcher_.DescribeTo(os); access_matcher_.DescribeTo(os);
@ -799,8 +783,7 @@ class IsStoreElementMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<ElementAccess>(node), "access", PrintMatchAndExplain(OpParameter<ElementAccess>(node), "access",
access_matcher_, listener) && access_matcher_, listener) &&
@ -840,7 +823,7 @@ class IsLoadMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose rep ("; *os << " whose rep (";
rep_matcher_.DescribeTo(os); rep_matcher_.DescribeTo(os);
@ -855,8 +838,7 @@ class IsLoadMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<LoadRepresentation>(node), "rep", PrintMatchAndExplain(OpParameter<LoadRepresentation>(node), "rep",
rep_matcher_, listener) && rep_matcher_, listener) &&
@ -891,7 +873,7 @@ class IsToNumberMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose base ("; *os << " whose base (";
base_matcher_.DescribeTo(os); base_matcher_.DescribeTo(os);
@ -904,8 +886,7 @@ class IsToNumberMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base", PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener) && base_matcher_, listener) &&
@ -941,7 +922,7 @@ class IsStoreMatcher FINAL : public NodeMatcher {
effect_matcher_(effect_matcher), effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {} control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose rep ("; *os << " whose rep (";
rep_matcher_.DescribeTo(os); rep_matcher_.DescribeTo(os);
@ -958,8 +939,7 @@ class IsStoreMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<StoreRepresentation>(node), "rep", PrintMatchAndExplain(OpParameter<StoreRepresentation>(node), "rep",
rep_matcher_, listener) && rep_matcher_, listener) &&
@ -993,7 +973,7 @@ class IsBinopMatcher FINAL : public NodeMatcher {
lhs_matcher_(lhs_matcher), lhs_matcher_(lhs_matcher),
rhs_matcher_(rhs_matcher) {} rhs_matcher_(rhs_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose lhs ("; *os << " whose lhs (";
lhs_matcher_.DescribeTo(os); lhs_matcher_.DescribeTo(os);
@ -1002,8 +982,7 @@ class IsBinopMatcher FINAL : public NodeMatcher {
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs", PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs",
lhs_matcher_, listener) && lhs_matcher_, listener) &&
@ -1022,15 +1001,14 @@ class IsUnopMatcher FINAL : public NodeMatcher {
IsUnopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& input_matcher) IsUnopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& input_matcher)
: NodeMatcher(opcode), input_matcher_(input_matcher) {} : NodeMatcher(opcode), input_matcher_(input_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE { void DescribeTo(std::ostream* os) const FINAL {
NodeMatcher::DescribeTo(os); NodeMatcher::DescribeTo(os);
*os << " whose input ("; *os << " whose input (";
input_matcher_.DescribeTo(os); input_matcher_.DescribeTo(os);
*os << ")"; *os << ")";
} }
virtual bool MatchAndExplain(Node* node, bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL {
MatchResultListener* listener) const OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) && return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"input", input_matcher_, listener)); "input", input_matcher_, listener));