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

Unified Diff: src/parsing/parser-base.h

Issue 1693523002: [es6] More efficient way of marking AST call expressions in tail positions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed MarkTail() from Statement 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 | « src/parsing/parser.cc ('k') | test/mjsunit/es6/tail-call.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index e75e87a65a427da96e9382f58b0a9a8c33fa8460..53d32767fe3ab3684ac0b59a398dfcac6580da83 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -246,6 +246,22 @@ class ParserBase : public Traits {
destructuring_assignments_to_rewrite_.Add(pair);
}
+ List<ExpressionT>& expressions_in_tail_position() {
+ return expressions_in_tail_position_;
+ }
+ void AddExpressionInTailPosition(ExpressionT expression) {
+ if (collect_expressions_in_tail_position_) {
+ expressions_in_tail_position_.Add(expression);
+ }
+ }
+
+ bool collect_expressions_in_tail_position() const {
+ return collect_expressions_in_tail_position_;
+ }
+ void set_collect_expressions_in_tail_position(bool collect) {
+ collect_expressions_in_tail_position_ = collect;
+ }
+
private:
// Used to assign an index to each literal that needs materialization in
// the function. Includes regexp literals, and boilerplate for object and
@@ -276,6 +292,8 @@ class ParserBase : public Traits {
Scope* outer_scope_;
List<DestructuringAssignment> destructuring_assignments_to_rewrite_;
+ List<ExpressionT> expressions_in_tail_position_;
+ bool collect_expressions_in_tail_position_;
void RewriteDestructuringAssignments();
@@ -933,7 +951,6 @@ class ParserBase : public Traits {
bool allow_harmony_function_name_;
};
-
template <class Traits>
ParserBase<Traits>::FunctionState::FunctionState(
FunctionState** function_state_stack, Scope** scope_stack, Scope* scope,
@@ -949,6 +966,7 @@ ParserBase<Traits>::FunctionState::FunctionState(
outer_function_state_(*function_state_stack),
scope_stack_(scope_stack),
outer_scope_(*scope_stack),
+ collect_expressions_in_tail_position_(true),
factory_(factory) {
*scope_stack_ = scope;
*function_state_stack = this;
« no previous file with comments | « src/parsing/parser.cc ('k') | test/mjsunit/es6/tail-call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698