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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 2251713002: [Compiler] Add compile to CompilerDispatcherJob. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_compilerdispatcher
Patch Set: Fix comment Created 4 years, 4 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/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index d83a23b3f8f72810896634712042b74ed55ce498..1b64afabe8b9fd0232ba90f052b5197fd0e91dad 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -25,7 +25,31 @@ namespace internal {
#define __ ACCESS_MASM(masm())
-bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
+class FullCodegenCompilationJob final : public CompilationJob {
+ public:
+ explicit FullCodegenCompilationJob(CompilationInfo* info)
+ : CompilationJob(info->isolate(), info, "Full-Codegen") {}
+
+ bool can_execute_on_background_thread() const override { return false; }
+
+ CompilationJob::Status PrepareJobImpl() final { return SUCCEEDED; }
+
+ CompilationJob::Status ExecuteJobImpl() final {
+ DCHECK(ThreadId::Current().Equals(isolate()->thread_id()));
+ return FullCodeGenerator::MakeCode(info(), stack_limit()) ? SUCCEEDED
+ : FAILED;
+ }
+
+ CompilationJob::Status FinalizeJobImpl() final { return SUCCEEDED; }
+};
+
+// static
+CompilationJob* FullCodeGenerator::NewCompilationJob(CompilationInfo* info) {
+ return new FullCodegenCompilationJob(info);
+}
+
+// static
+bool FullCodeGenerator::MakeCode(CompilationInfo* info, uintptr_t stack_limit) {
Isolate* isolate = info->isolate();
DCHECK(!FLAG_minimal);
@@ -47,7 +71,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
CodeObjectRequired::kYes);
if (info->will_serialize()) masm.enable_serializer();
- FullCodeGenerator cgen(&masm, info);
+ FullCodeGenerator cgen(&masm, info, stack_limit);
cgen.Generate();
if (cgen.HasStackOverflow()) {
DCHECK(!isolate->has_pending_exception());
@@ -157,9 +181,8 @@ bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime(
expr->values()->length() > JSArray::kInitialMaxFastElementArray;
}
-
-void FullCodeGenerator::Initialize() {
- InitializeAstVisitor(info_->isolate());
+void FullCodeGenerator::Initialize(uintptr_t stack_limit) {
+ InitializeAstVisitor(stack_limit);
masm_->set_emit_debug_code(FLAG_debug_code);
masm_->set_predictable_code_size(true);
}
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698