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

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

Issue 2191443003: Add a prepare to parse step to CompilerDispatcherJob (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
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 557203628330c4033cb9f547f84f324e704e8626..59dc58583f1440ec122d7cd6a3239a4ad56809cd 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -7,6 +7,9 @@
#include "src/global-handles.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
+#include "src/parsing/parser.h"
+#include "src/unicode-cache.h"
+#include "src/zone.h"
namespace v8 {
namespace internal {
@@ -18,8 +21,22 @@ CompilerDispatcherJob::CompilerDispatcherJob(Isolate* isolate,
isolate_->global_handles()->Create(*function))) {}
CompilerDispatcherJob::~CompilerDispatcherJob() {
+ DCHECK(ThreadId::Current().Equals(isolate_->thread_id()));
i::GlobalHandles::Destroy(Handle<Object>::cast(function_).location());
}
+void CompilerDispatcherJob::PrepareToParseOnMainThread() {
+ DCHECK(ThreadId::Current().Equals(isolate_->thread_id()));
+ DCHECK(status_ == CompileJobStatus::kInitial);
+ unicode_cache_.reset(new UnicodeCache());
+ zone_.reset(new Zone(isolate_->allocator()));
+ parse_info_.reset(new ParseInfo(zone_.get()));
+ parse_info_->set_isolate(isolate_);
+ // TODO(jochen): We need to hook up a fake source stream here.
+ parse_info_->set_hash_seed(isolate_->heap()->HashSeed());
+ parse_info_->set_unicode_cache(unicode_cache_.get());
+ status_ = CompileJobStatus::kReadyToParse;
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698