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

Unified Diff: src/parsing/preparser.cc

Issue 2481163002: Assign unique IDs to FunctionLiterals (Closed)
Patch Set: updates Created 4 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
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 7f95164412209f2e6c20cda76c9528457dcf91ee..0343b8321b12d66c99cd199a8ca016e64f0a0cf0 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -195,6 +195,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
FunctionState function_state(&function_state_, &scope_state_, function_scope);
DuplicateFinder duplicate_finder(scanner()->unicode_cache());
ExpressionClassifier formals_classifier(this, &duplicate_finder);
+ GetNextFunctionLiteralNum();
Expect(Token::LPAREN, CHECK_OK);
int start_position = scanner()->location().beg_pos;
@@ -242,6 +243,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
PreParser::LazyParsingResult PreParser::ParseStatementListAndLogFunction(
PreParserFormalParameters* formals, bool has_duplicate_parameters,
bool may_abort, bool* ok) {
+ ResetFunctionLiteralNum();
+
PreParserStatementList body;
LazyParsingResult result = ParseStatementList(
body, Token::RBRACE, may_abort, CHECK_OK_VALUE(kLazyParsingComplete));
@@ -254,7 +257,8 @@ PreParser::LazyParsingResult PreParser::ParseStatementListAndLogFunction(
log_.LogFunction(body_end, formals->num_parameters(),
formals->function_length, has_duplicate_parameters,
function_state_->materialized_literal_count(),
- function_state_->expected_property_count());
+ function_state_->expected_property_count(),
+ GetNextFunctionLiteralNum() - 1);
return kLazyParsingComplete;
}

Powered by Google App Engine
This is Rietveld 408576698