Commit 1ec1f595 authored by Benedikt Meurer's avatar Benedikt Meurer

[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}
parent eff42215
...@@ -114,7 +114,7 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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;
}; };
......
...@@ -21,9 +21,9 @@ class ChangeLowering FINAL : public Reducer { ...@@ -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();
......
...@@ -86,10 +86,10 @@ class CodeGenerator FINAL : public GapResolver::Assembler { ...@@ -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
......
...@@ -40,7 +40,7 @@ class ControlBuilder { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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_
...@@ -39,8 +39,9 @@ class GapResolver FINAL { ...@@ -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_
...@@ -86,7 +86,7 @@ class StructuredGraphBuilder : public GraphBuilder { ...@@ -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 { ...@@ -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; }
......
...@@ -22,13 +22,14 @@ class CommonOperatorBuilder; ...@@ -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);
......
...@@ -48,7 +48,7 @@ class RawMachineAssembler : public GraphBuilder { ...@@ -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 { ...@@ -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; }
......
...@@ -23,9 +23,9 @@ class MachineOperatorBuilder; ...@@ -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);
......
...@@ -10,12 +10,12 @@ namespace v8 { ...@@ -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_);
} }
......
...@@ -138,10 +138,10 @@ class LazyTypeCache FINAL : public ZoneObject { ...@@ -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_;
......
...@@ -24,7 +24,7 @@ namespace compiler { ...@@ -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 ...@@ -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, ...@@ -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) { ...@@ -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; }
}; };
......
...@@ -117,7 +117,7 @@ namespace { ...@@ -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_; }
......
...@@ -30,7 +30,7 @@ using ::testing::Matcher; ...@@ -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);
......
...@@ -21,7 +21,7 @@ namespace compiler { ...@@ -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_; }
......
...@@ -40,7 +40,7 @@ const StrictMode kStrictModes[] = {SLOPPY, STRICT}; ...@@ -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) {
......
...@@ -66,7 +66,7 @@ class MachineOperatorReducerTestWithParam ...@@ -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 {}
}; };
......
...@@ -19,7 +19,7 @@ namespace compiler { ...@@ -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_; }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment