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

Unified Diff: src/parsing/parser.cc

Issue 2424013002: Add support to trace preparsing decisions (Closed)
Patch Set: 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 | « src/flag-definitions.h ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 541557396f070b9c9c7c5388032b149540d6e4c5..11e73f4acabf550f3808bd8c5fc7ef774ec51788 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -2696,13 +2696,23 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
expected_property_count = function_state.expected_property_count();
}
- if (use_temp_zone || is_lazy_top_level_function) {
+ DCHECK(use_temp_zone || !is_lazy_top_level_function);
+ if (use_temp_zone) {
// If the preconditions are correct the function body should never be
// accessed, but do this anyway for better behaviour if they're wrong.
body = nullptr;
scope->AnalyzePartially(&previous_zone_ast_node_factory);
}
+ if (FLAG_trace_preparse) {
+ PrintF(" [%s]: %i-%i %.*s\n",
+ is_lazy_top_level_function
+ ? "Preparse no-resolution"
+ : (use_temp_zone ? "Preparse resolution" : "Full parse"),
+ scope->start_position(), scope->end_position(),
+ function_name->byte_length(), function_name->raw_data());
+ }
+
// Parsing the body may change the language mode in our scope.
language_mode = scope->language_mode();
« no previous file with comments | « src/flag-definitions.h ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698