Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/full-codegen/full-codegen.h

Issue 1412223018: [presubmit] Enabling readability/inheritance linter checking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/elements.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.h
diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h
index 4212bdfc02667284db6e446b6b49d23d28d01b13..3aad2e01be6b74efc83e1a0fbcc616de9b811f7d 100644
--- a/src/full-codegen/full-codegen.h
+++ b/src/full-codegen/full-codegen.h
@@ -153,10 +153,9 @@ class FullCodeGenerator: public AstVisitor {
Breakable(FullCodeGenerator* codegen, BreakableStatement* statement)
: NestedStatement(codegen), statement_(statement) {
}
- virtual ~Breakable() {}
- virtual Breakable* AsBreakable() { return this; }
- virtual bool IsBreakTarget(Statement* target) {
+ Breakable* AsBreakable() override { return this; }
+ bool IsBreakTarget(Statement* target) override {
return statement() == target;
}
@@ -174,10 +173,9 @@ class FullCodeGenerator: public AstVisitor {
Iteration(FullCodeGenerator* codegen, IterationStatement* statement)
: Breakable(codegen, statement) {
}
- virtual ~Iteration() {}
- virtual Iteration* AsIteration() { return this; }
- virtual bool IsContinueTarget(Statement* target) {
+ Iteration* AsIteration() override { return this; }
+ bool IsContinueTarget(Statement* target) override {
return statement() == target;
}
@@ -193,9 +191,8 @@ class FullCodeGenerator: public AstVisitor {
NestedBlock(FullCodeGenerator* codegen, Block* block)
: Breakable(codegen, block) {
}
- virtual ~NestedBlock() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override {
auto block_scope = statement()->AsBlock()->scope();
if (block_scope != nullptr) {
if (block_scope->ContextLocalCount() > 0) ++(*context_length);
@@ -210,13 +207,12 @@ class FullCodeGenerator: public AstVisitor {
static const int kElementCount = TryBlockConstant::kElementCount;
explicit TryCatch(FullCodeGenerator* codegen) : NestedStatement(codegen) {}
- virtual ~TryCatch() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override {
*stack_depth += kElementCount;
return previous_;
}
- virtual NestedStatement* AccumulateDepth(int* stack_depth) {
+ NestedStatement* AccumulateDepth(int* stack_depth) override {
*stack_depth += kElementCount;
return previous_;
}
@@ -230,10 +226,9 @@ class FullCodeGenerator: public AstVisitor {
TryFinally(FullCodeGenerator* codegen, Label* finally_entry)
: NestedStatement(codegen), finally_entry_(finally_entry) {
}
- virtual ~TryFinally() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length);
- virtual NestedStatement* AccumulateDepth(int* stack_depth) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override;
+ NestedStatement* AccumulateDepth(int* stack_depth) override {
*stack_depth += kElementCount;
return previous_;
}
@@ -248,13 +243,12 @@ class FullCodeGenerator: public AstVisitor {
static const int kElementCount = 3;
explicit Finally(FullCodeGenerator* codegen) : NestedStatement(codegen) {}
- virtual ~Finally() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override {
*stack_depth += kElementCount;
return previous_;
}
- virtual NestedStatement* AccumulateDepth(int* stack_depth) {
+ NestedStatement* AccumulateDepth(int* stack_depth) override {
*stack_depth += kElementCount;
return previous_;
}
@@ -268,13 +262,12 @@ class FullCodeGenerator: public AstVisitor {
ForIn(FullCodeGenerator* codegen, ForInStatement* statement)
: Iteration(codegen, statement) {
}
- virtual ~ForIn() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override {
*stack_depth += kElementCount;
return previous_;
}
- virtual NestedStatement* AccumulateDepth(int* stack_depth) {
+ NestedStatement* AccumulateDepth(int* stack_depth) override {
*stack_depth += kElementCount;
return previous_;
}
@@ -287,9 +280,8 @@ class FullCodeGenerator: public AstVisitor {
explicit WithOrCatch(FullCodeGenerator* codegen)
: NestedStatement(codegen) {
}
- virtual ~WithOrCatch() {}
- virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ NestedStatement* Exit(int* stack_depth, int* context_length) override {
++(*context_length);
return previous_;
}
@@ -723,7 +715,7 @@ class FullCodeGenerator: public AstVisitor {
void PushCalleeAndWithBaseObject(Call* expr);
// AST node visit functions.
-#define DECLARE_VISIT(type) virtual void Visit##type(type* node) override;
+#define DECLARE_VISIT(type) void Visit##type(type* node) override;
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
@@ -837,20 +829,18 @@ class FullCodeGenerator: public AstVisitor {
explicit AccumulatorValueContext(FullCodeGenerator* codegen)
: ExpressionContext(codegen) { }
- virtual void Plug(bool flag) const;
- virtual void Plug(Register reg) const;
- virtual void Plug(Label* materialize_true, Label* materialize_false) const;
- virtual void Plug(Variable* var) const;
- virtual void Plug(Handle<Object> lit) const;
- virtual void Plug(Heap::RootListIndex) const;
- virtual void PlugTOS() const;
- virtual void DropAndPlug(int count, Register reg) const;
- virtual void PrepareTest(Label* materialize_true,
- Label* materialize_false,
- Label** if_true,
- Label** if_false,
- Label** fall_through) const;
- virtual bool IsAccumulatorValue() const { return true; }
+ void Plug(bool flag) const override;
+ void Plug(Register reg) const override;
+ void Plug(Label* materialize_true, Label* materialize_false) const override;
+ void Plug(Variable* var) const override;
+ void Plug(Handle<Object> lit) const override;
+ void Plug(Heap::RootListIndex) const override;
+ void PlugTOS() const override;
+ void DropAndPlug(int count, Register reg) const override;
+ void PrepareTest(Label* materialize_true, Label* materialize_false,
+ Label** if_true, Label** if_false,
+ Label** fall_through) const override;
+ bool IsAccumulatorValue() const override { return true; }
};
class StackValueContext : public ExpressionContext {
@@ -858,20 +848,18 @@ class FullCodeGenerator: public AstVisitor {
explicit StackValueContext(FullCodeGenerator* codegen)
: ExpressionContext(codegen) { }
- virtual void Plug(bool flag) const;
- virtual void Plug(Register reg) const;
- virtual void Plug(Label* materialize_true, Label* materialize_false) const;
- virtual void Plug(Variable* var) const;
- virtual void Plug(Handle<Object> lit) const;
- virtual void Plug(Heap::RootListIndex) const;
- virtual void PlugTOS() const;
- virtual void DropAndPlug(int count, Register reg) const;
- virtual void PrepareTest(Label* materialize_true,
- Label* materialize_false,
- Label** if_true,
- Label** if_false,
- Label** fall_through) const;
- virtual bool IsStackValue() const { return true; }
+ void Plug(bool flag) const override;
+ void Plug(Register reg) const override;
+ void Plug(Label* materialize_true, Label* materialize_false) const override;
+ void Plug(Variable* var) const override;
+ void Plug(Handle<Object> lit) const override;
+ void Plug(Heap::RootListIndex) const override;
+ void PlugTOS() const override;
+ void DropAndPlug(int count, Register reg) const override;
+ void PrepareTest(Label* materialize_true, Label* materialize_false,
+ Label** if_true, Label** if_false,
+ Label** fall_through) const override;
+ bool IsStackValue() const override { return true; }
};
class TestContext : public ExpressionContext {
@@ -897,20 +885,18 @@ class FullCodeGenerator: public AstVisitor {
Label* false_label() const { return false_label_; }
Label* fall_through() const { return fall_through_; }
- virtual void Plug(bool flag) const;
- virtual void Plug(Register reg) const;
- virtual void Plug(Label* materialize_true, Label* materialize_false) const;
- virtual void Plug(Variable* var) const;
- virtual void Plug(Handle<Object> lit) const;
- virtual void Plug(Heap::RootListIndex) const;
- virtual void PlugTOS() const;
- virtual void DropAndPlug(int count, Register reg) const;
- virtual void PrepareTest(Label* materialize_true,
- Label* materialize_false,
- Label** if_true,
- Label** if_false,
- Label** fall_through) const;
- virtual bool IsTest() const { return true; }
+ void Plug(bool flag) const override;
+ void Plug(Register reg) const override;
+ void Plug(Label* materialize_true, Label* materialize_false) const override;
+ void Plug(Variable* var) const override;
+ void Plug(Handle<Object> lit) const override;
+ void Plug(Heap::RootListIndex) const override;
+ void PlugTOS() const override;
+ void DropAndPlug(int count, Register reg) const override;
+ void PrepareTest(Label* materialize_true, Label* materialize_false,
+ Label** if_true, Label** if_false,
+ Label** fall_through) const override;
+ bool IsTest() const override { return true; }
private:
Expression* condition_;
@@ -924,20 +910,18 @@ class FullCodeGenerator: public AstVisitor {
explicit EffectContext(FullCodeGenerator* codegen)
: ExpressionContext(codegen) { }
- virtual void Plug(bool flag) const;
- virtual void Plug(Register reg) const;
- virtual void Plug(Label* materialize_true, Label* materialize_false) const;
- virtual void Plug(Variable* var) const;
- virtual void Plug(Handle<Object> lit) const;
- virtual void Plug(Heap::RootListIndex) const;
- virtual void PlugTOS() const;
- virtual void DropAndPlug(int count, Register reg) const;
- virtual void PrepareTest(Label* materialize_true,
- Label* materialize_false,
- Label** if_true,
- Label** if_false,
- Label** fall_through) const;
- virtual bool IsEffect() const { return true; }
+ void Plug(bool flag) const override;
+ void Plug(Register reg) const override;
+ void Plug(Label* materialize_true, Label* materialize_false) const override;
+ void Plug(Variable* var) const override;
+ void Plug(Handle<Object> lit) const override;
+ void Plug(Heap::RootListIndex) const override;
+ void PlugTOS() const override;
+ void DropAndPlug(int count, Register reg) const override;
+ void PrepareTest(Label* materialize_true, Label* materialize_false,
+ Label** if_true, Label** if_false,
+ Label** fall_through) const override;
+ bool IsEffect() const override { return true; }
};
class EnterBlockScopeIfNeeded {
« no previous file with comments | « src/elements.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698