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

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

Issue 2687973003: Revert of [Compiler] Enable handles created during parsing and scope analysis to be deferred. (Closed)
Patch Set: 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/compiler-dispatcher/compiler-dispatcher-job.h ('k') | src/handles.h » ('j') | 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 986a822093ff4fa2dcb81da13ec13f9915a158b5..793b02d2614817de99a5784448b8d4ca102e0827 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -84,27 +84,26 @@
}
}
-CompilerDispatcherJob::CompilerDispatcherJob(
- Isolate* isolate, CompilerDispatcherTracer* tracer,
- Handle<SharedFunctionInfo> shared, FunctionLiteral* literal,
- std::shared_ptr<Zone> parse_zone,
- std::shared_ptr<DeferredHandles> parse_handles,
- std::shared_ptr<DeferredHandles> compile_handles, size_t max_stack_size)
+CompilerDispatcherJob::CompilerDispatcherJob(Isolate* isolate,
+ CompilerDispatcherTracer* tracer,
+ Handle<SharedFunctionInfo> shared,
+ FunctionLiteral* literal,
+ size_t max_stack_size)
: status_(CompileJobStatus::kAnalyzed),
isolate_(isolate),
tracer_(tracer),
shared_(Handle<SharedFunctionInfo>::cast(
isolate_->global_handles()->Create(*shared))),
max_stack_size_(max_stack_size),
- parse_info_(new ParseInfo(shared_)),
- parse_zone_(parse_zone),
+ parse_info_(
+ new ParseInfo(Handle<Script>(Script::cast(shared->script())))),
compile_info_(new CompilationInfo(parse_info_->zone(), parse_info_.get(),
Handle<JSFunction>::null())),
trace_compiler_dispatcher_jobs_(FLAG_trace_compiler_dispatcher_jobs) {
parse_info_->set_literal(literal);
- parse_info_->set_deferred_handles(parse_handles);
- compile_info_->set_deferred_handles(compile_handles);
-
+ parse_info_->set_shared_info(shared);
+ parse_info_->set_function_literal_id(shared->function_literal_id());
+ parse_info_->set_language_mode(literal->scope()->language_mode());
if (trace_compiler_dispatcher_jobs_) {
PrintF("CompilerDispatcherJob[%p] created for ", static_cast<void*>(this));
shared_->ShortPrint();
@@ -277,19 +276,17 @@
wrapper_ = Handle<String>::null();
}
- Handle<Script> script(Script::cast(shared_->script()), isolate_);
- parse_info_->set_script(script);
if (parse_info_->literal() == nullptr) {
- parser_->ReportErrors(isolate_, script);
status_ = CompileJobStatus::kFailed;
} else {
status_ = CompileJobStatus::kReadyToAnalyze;
}
- parser_->UpdateStatistics(isolate_, script);
DeferredHandleScope scope(isolate_);
{
- parse_info_->ReopenHandlesInNewHandleScope();
+ Handle<Script> script(Script::cast(shared_->script()), isolate_);
+
+ parse_info_->set_script(script);
Handle<ScopeInfo> outer_scope_info(
handle(ScopeInfo::cast(shared_->outer_scope_info())));
if (outer_scope_info->length() > 0) {
@@ -297,8 +294,9 @@
}
parse_info_->set_shared_info(shared_);
- // Internalize ast values on the main thread.
- parse_info_->ast_value_factory()->Internalize(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);
@@ -307,7 +305,7 @@
unicode_cache_.reset();
character_stream_.reset();
}
- parse_info_->set_deferred_handles(scope.Detach());
+ handles_from_parsing_.reset(scope.Detach());
return status_ != CompileJobStatus::kFailed;
}
@@ -395,7 +393,7 @@
compile_job_.reset();
compile_info_.reset();
- parse_zone_.reset();
+ handles_from_parsing_.reset();
parse_info_.reset();
status_ = CompileJobStatus::kDone;
@@ -411,10 +409,10 @@
compile_job_.reset();
compile_info_.reset();
- parse_zone_.reset();
parser_.reset();
unicode_cache_.reset();
character_stream_.reset();
+ handles_from_parsing_.reset();
parse_info_.reset();
if (!source_.is_null()) {
« no previous file with comments | « src/compiler-dispatcher/compiler-dispatcher-job.h ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698