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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher-job.cc

Issue 2318653002: [Interpreter] Localize the CanonicalHandleScope to parsing and renumbering. (Closed)
Patch Set: Rebase Created 4 years, 3 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/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler-dispatcher/compiler-dispatcher-job.cc
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/compiler-dispatcher/compiler-dispatcher-job.cc
index b602c5bfceba5901cb70daca30a6d3e9d5b032ac..21e30c8d4c2bae906f4266b56af6f3d57397ce56 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -138,11 +138,6 @@ bool CompilerDispatcherJob::FinalizeParsingOnMainThread() {
DeferredHandleScope scope(isolate_);
{
- // Create a canonical handle scope before internalizing parsed values if
- // compiling bytecode. This is required for off-thread bytecode generation.
- std::unique_ptr<CanonicalHandleScope> canonical;
- if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_));
-
Handle<SharedFunctionInfo> shared(function_->shared(), isolate_);
Handle<Script> script(Script::cast(shared->script()), isolate_);
@@ -150,9 +145,17 @@ bool CompilerDispatcherJob::FinalizeParsingOnMainThread() {
parse_info_->set_context(handle(function_->context(), isolate_));
parse_info_->set_shared_info(handle(function_->shared(), isolate_));
- // Do the parsing tasks which need to be done on the main thread. This will
- // also handle parse errors.
- parser_->Internalize(isolate_, script, parse_info_->literal() == nullptr);
+ {
+ // Create a canonical handle scope if compiling ignition bytecode. This is
+ // required by the constant array builder to de-duplicate objects without
+ // dereferencing handles.
+ std::unique_ptr<CanonicalHandleScope> canonical;
+ if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_));
+
+ // Do the parsing tasks which need to be done on the main thread. This
+ // will also handle parse errors.
+ parser_->Internalize(isolate_, script, parse_info_->literal() == nullptr);
+ }
parser_->HandleSourceURLComments(isolate_, script);
parse_info_->set_character_stream(nullptr);
@@ -173,16 +176,9 @@ bool CompilerDispatcherJob::PrepareToCompileOnMainThread() {
compile_info_.reset(new CompilationInfo(parse_info_.get(), function_));
DeferredHandleScope scope(isolate_);
- {
- // Create a canonical handle scope before ast numbering if compiling
- // bytecode. This is required for off-thread bytecode generation.
- std::unique_ptr<CanonicalHandleScope> canonical;
- if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_));
-
- if (Compiler::Analyze(parse_info_.get())) {
- compile_job_.reset(
- Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get()));
- }
+ if (Compiler::Analyze(parse_info_.get())) {
+ compile_job_.reset(
+ Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get()));
}
compile_info_->set_deferred_handles(scope.Detach());
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698