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

Unified Diff: src/ast/ast.h

Issue 2414003002: Move function length tracking from Scope to (Pre)?ParserFormalParameters. (Closed)
Patch Set: oops cont Created 4 years, 2 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/scopes.h » ('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 51da0930c350a15baced104f82111a936105cbef..e6e2a368631409e5c14143d4752477afc2a1fc7c 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -2597,6 +2597,7 @@ class FunctionLiteral final : public Expression {
int materialized_literal_count() { return materialized_literal_count_; }
int expected_property_count() { return expected_property_count_; }
int parameter_count() { return parameter_count_; }
+ int function_length() { return function_length_; }
bool AllowsLazyCompilation();
@@ -2710,7 +2711,7 @@ class FunctionLiteral final : public Expression {
AstValueFactory* ast_value_factory, DeclarationScope* scope,
ZoneList<Statement*>* body, int materialized_literal_count,
int expected_property_count, int parameter_count,
- FunctionType function_type,
+ int function_length, FunctionType function_type,
ParameterFlag has_duplicate_parameters,
EagerCompileHint eager_compile_hint, int position,
bool is_function)
@@ -2718,6 +2719,7 @@ class FunctionLiteral final : public Expression {
materialized_literal_count_(materialized_literal_count),
expected_property_count_(expected_property_count),
parameter_count_(parameter_count),
+ function_length_(function_length),
function_token_position_(kNoSourcePosition),
yield_count_(0),
raw_name_(name),
@@ -2754,6 +2756,7 @@ class FunctionLiteral final : public Expression {
int materialized_literal_count_;
int expected_property_count_;
int parameter_count_;
+ int function_length_;
int function_token_position_;
int yield_count_;
@@ -3453,15 +3456,15 @@ class AstNodeFactory final BASE_EMBEDDED {
FunctionLiteral* NewFunctionLiteral(
const AstRawString* name, DeclarationScope* scope,
ZoneList<Statement*>* body, int materialized_literal_count,
- int expected_property_count, int parameter_count,
+ int expected_property_count, int parameter_count, int function_length,
FunctionLiteral::ParameterFlag has_duplicate_parameters,
FunctionLiteral::FunctionType function_type,
FunctionLiteral::EagerCompileHint eager_compile_hint, int position) {
- return new (zone_) FunctionLiteral(zone_, name, ast_value_factory_, scope,
- body, materialized_literal_count,
- expected_property_count, parameter_count,
- function_type, has_duplicate_parameters,
- eager_compile_hint, position, true);
+ return new (zone_) FunctionLiteral(
+ zone_, name, ast_value_factory_, scope, body,
+ materialized_literal_count, expected_property_count, parameter_count,
+ function_length, function_type, has_duplicate_parameters,
+ eager_compile_hint, position, true);
}
// Creates a FunctionLiteral representing a top-level script, the
@@ -3474,7 +3477,7 @@ class AstNodeFactory final BASE_EMBEDDED {
return new (zone_) FunctionLiteral(
zone_, ast_value_factory_->empty_string(), ast_value_factory_, scope,
body, materialized_literal_count, expected_property_count,
- parameter_count, FunctionLiteral::kAnonymousExpression,
+ parameter_count, parameter_count, FunctionLiteral::kAnonymousExpression,
FunctionLiteral::kNoDuplicateParameters,
FunctionLiteral::kShouldLazyCompile, 0, false);
}
« no previous file with comments | « no previous file | src/ast/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698