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

Unified Diff: src/ast/ast.h

Issue 1666183002: [es6] Fix tail Call nodes marking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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 | « no previous file | src/ast/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 3bc5690f033a764018c4c3b824526fe61bb8cb16..dc0e03d03bb4e11960c2bf00c1e05a36ae5e777f 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -483,7 +483,10 @@ class Block final : public BreakableStatement {
}
void MarkTail() override {
- if (!statements_.is_empty()) statements_.last()->MarkTail();
+ for (int i = 0; i < statements_.length(); i++) {
+ Statement* stmt = statements_.at(i);
+ stmt->MarkTail();
+ }
}
Scope* scope() const { return scope_; }
@@ -968,7 +971,6 @@ class ExpressionStatement final : public Statement {
void set_expression(Expression* e) { expression_ = e; }
Expression* expression() const { return expression_; }
bool IsJump() const override { return expression_->IsThrow(); }
- void MarkTail() override { expression_->MarkTail(); }
protected:
ExpressionStatement(Zone* zone, Expression* expression, int pos)
@@ -1026,6 +1028,8 @@ class ReturnStatement final : public JumpStatement {
void set_expression(Expression* e) { expression_ = e; }
+ void MarkTail() override { expression_->MarkTail(); }
+
protected:
explicit ReturnStatement(Zone* zone, Expression* expression, int pos)
: JumpStatement(zone, pos), expression_(expression) { }
@@ -1095,7 +1099,10 @@ class CaseClause final : public Expression {
TypeFeedbackId CompareId() { return TypeFeedbackId(local_id(1)); }
void MarkTail() override {
- if (!statements_->is_empty()) statements_->last()->MarkTail();
+ for (int i = 0; i < statements_->length(); i++) {
+ Statement* stmt = statements_->at(i);
+ stmt->MarkTail();
+ }
}
Type* compare_type() { return compare_type_; }
@@ -1131,7 +1138,10 @@ class SwitchStatement final : public BreakableStatement {
void set_tag(Expression* t) { tag_ = t; }
void MarkTail() override {
- if (!cases_->is_empty()) cases_->last()->MarkTail();
+ for (int i = 0; i < cases_->length(); i++) {
+ CaseClause* clause = cases_->at(i);
+ clause->MarkTail();
+ }
}
protected:
« no previous file with comments | « no previous file | src/ast/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698