Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 50abb0f1a290053782082ad52f0cce149d0876bb..efabd93e44a501ba4d9a5f515ec1943185435ecc 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" |
@@ -59,6 +60,23 @@ void Interpreter::Initialize() { |
} |
+bool Interpreter::MakeBytecode(CompilationInfo* info) { |
+ Handle<SharedFunctionInfo> shared_info = |
+ Compiler::GetSharedFunctionInfo(info->function(), info->script(), info); |
+ BytecodeGenerator generator(info->isolate(), info->zone()); |
+ Handle<BytecodeArray> bytecodes = generator.MakeBytecode(info); |
+ if (FLAG_print_ignition_bytecode) { |
+ bytecodes->Print(); |
+ } |
+ |
+ CHECK(shared_info->function_data()->IsUndefined()); |
+ 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); |