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

Unified Diff: src/api.cc

Issue 2650883002: Reland: [Compiler] Enable handles created during parsing and scope analysis to be deferred. (Closed)
Patch Set: Remove unused variable Created 3 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/api.h ('k') | src/compilation-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 2501544f3cd3ee13e1630922a62dd9a9cd811bb9..28a86d1609844e45588178174a299227c3d92ecb 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2418,12 +2418,19 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
}
source->info->set_script(script);
+ if (source->info->literal() == nullptr) {
+ source->parser->ReportErrors(isolate, script);
+ }
+ source->parser->UpdateStatistics(isolate, script);
- // Do the parsing tasks which need to be done on the main thread. This will
- // also handle parse errors.
- source->parser->Internalize(isolate, script,
- source->info->literal() == nullptr);
- source->parser->HandleSourceURLComments(isolate, script);
+ i::DeferredHandleScope deferred_handle_scope(isolate);
+ {
+ // Internalize AST values on the main thread.
+ source->info->ReopenHandlesInNewHandleScope();
+ source->info->ast_value_factory()->Internalize(isolate);
+ source->parser->HandleSourceURLComments(isolate, script);
+ }
+ source->info->set_deferred_handles(deferred_handle_scope.Detach());
i::Handle<i::SharedFunctionInfo> result;
if (source->info->literal() != nullptr) {
« no previous file with comments | « src/api.h ('k') | src/compilation-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698