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

Unified Diff: src/interpreter/interpreter.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
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 93bfebaff2cf8846a4d121de98d7ea4b0df30e76..06f7d66d574925c29156a6b0f8b8cd8fe065c8f6 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -150,14 +150,40 @@ int Interpreter::InterruptBudget() {
}
InterpreterCompilationJob::InterpreterCompilationJob(CompilationInfo* info)
- : CompilationJob(info, "Ignition"), generator_(info) {}
+ : CompilationJob(info->isolate(), info, "Ignition"), generator_(info) {}
InterpreterCompilationJob::Status InterpreterCompilationJob::PrepareJobImpl() {
+ if (FLAG_print_bytecode || FLAG_print_ast) {
+ OFStream os(stdout);
+ std::unique_ptr<char[]> name = info()->GetDebugName();
+ os << "[generating bytecode for function: " << info()->GetDebugName().get()
+ << "]" << std::endl
+ << std::flush;
+ }
+
+#ifdef DEBUG
+ if (info()->parse_info() && FLAG_print_ast) {
+ OFStream os(stdout);
+ os << "--- AST ---" << std::endl
+ << AstPrinter(info()->isolate()).PrintProgram(info()->literal())
+ << std::endl
+ << std::flush;
+ }
+#endif // DEBUG
+
return SUCCEEDED;
}
InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() {
- generator()->GenerateBytecode();
+ // TODO(5203): These timers aren't thread safe, move to using the CompilerJob
+ // timers.
+ RuntimeCallTimerScope runtimeTimer(info()->isolate(),
+ &RuntimeCallStats::CompileIgnition);
+ TimerEventScope<TimerEventCompileIgnition> timer(info()->isolate());
+ TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
+ info()->isolate(), &tracing::TraceEventStatsTable::CompileIgnition);
+
+ generator()->GenerateBytecode(stack_limit());
if (generator()->HasStackOverflow()) {
return FAILED;
@@ -182,34 +208,8 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl() {
return SUCCEEDED;
}
-bool Interpreter::MakeBytecode(CompilationInfo* info) {
- RuntimeCallTimerScope runtimeTimer(info->isolate(),
- &RuntimeCallStats::CompileIgnition);
- TimerEventScope<TimerEventCompileIgnition> timer(info->isolate());
- TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
- info->isolate(), &tracing::TraceEventStatsTable::CompileIgnition);
-
- if (FLAG_print_bytecode || FLAG_print_ast) {
- OFStream os(stdout);
- std::unique_ptr<char[]> name = info->GetDebugName();
- os << "[generating bytecode for function: " << info->GetDebugName().get()
- << "]" << std::endl
- << std::flush;
- }
-
-#ifdef DEBUG
- if (info->parse_info() && FLAG_print_ast) {
- OFStream os(stdout);
- os << "--- AST ---" << std::endl
- << AstPrinter(info->isolate()).PrintProgram(info->literal()) << std::endl
- << std::flush;
- }
-#endif // DEBUG
-
- InterpreterCompilationJob job(info);
- if (job.PrepareJob() != CompilationJob::SUCCEEDED) return false;
- if (job.ExecuteJob() != CompilationJob::SUCCEEDED) return false;
- return job.FinalizeJob() == CompilationJob::SUCCEEDED;
+CompilationJob* Interpreter::NewCompilationJob(CompilationInfo* info) {
+ return new InterpreterCompilationJob(info);
}
bool Interpreter::IsDispatchTableInitialized() {
« no previous file with comments | « src/interpreter/interpreter.h ('k') | test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698