Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 4f961318085e12bbf63f5d336d006ddda14c909d..6167efe4befc7e1e60f2b2d79d563d66c86a40b8 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -7,6 +7,7 @@ |
#include "src/compiler.h" |
#include "src/compiler/interpreter-assembler.h" |
#include "src/factory.h" |
+#include "src/interpreter/bytecode-generator.h" |
#include "src/interpreter/bytecodes.h" |
#include "src/zone.h" |
@@ -56,6 +57,27 @@ void Interpreter::Initialize() { |
} |
+bool Interpreter::MakeBytecode(CompilationInfo* info) { |
+ Handle<SharedFunctionInfo> shared_info = info->shared_info(); |
+ |
+ BytecodeGenerator generator(info->isolate(), info->zone()); |
+ Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); |
+ if (FLAG_print_bytecode) { |
+ bytecodes->Print(); |
+ } |
+ |
+ DCHECK(shared_info->function_data()->IsUndefined()); |
+ if (!shared_info->function_data()->IsUndefined()) { |
+ return false; |
+ } |
+ |
+ shared_info->set_function_data(*bytecodes); |
+ info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline()); |
+ info->EnsureFeedbackVector(); |
+ return true; |
+} |
+ |
+ |
bool Interpreter::IsInterpreterTableInitialized( |
Handle<FixedArray> handler_table) { |
DCHECK(handler_table->length() == static_cast<int>(Bytecode::kLast) + 1); |