| Index: src/interpreter/interpreter.cc
|
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
|
| index f39910356a967a3299438f2c1bb702588fc257dc..5c05b8b193c0d06a50dd93c1bbf42045e690c75d 100644
|
| --- a/src/interpreter/interpreter.cc
|
| +++ b/src/interpreter/interpreter.cc
|
| @@ -154,10 +154,37 @@ InterpreterCompilationJob::InterpreterCompilationJob(CompilationInfo* info)
|
|
|
| InterpreterCompilationJob::Status InterpreterCompilationJob::PrepareJobImpl() {
|
| generator_.reset(new BytecodeGenerator(info()));
|
| +
|
| + 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() {
|
| + // 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();
|
|
|
| if (generator()->HasStackOverflow()) {
|
| @@ -183,34 +210,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() {
|
|
|