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

Unified Diff: src/interpreter/interpreter.cc

Issue 1230753004: [Interpreter] Add BytecodeArray class and add to SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use BytecodeArray in bytecode emission path in interpreter. Created 5 years, 5 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 c0b1bb90d5d4cbedcf61b8326f6f902af6d2534a..734a1ba4347cf0b8c2ae46d20a800ca4eb5b4303 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-emitter.h"
#include "src/interpreter/bytecodes.h"
#include "src/zone.h"
@@ -46,7 +47,11 @@ void Interpreter::Initialize(Isolate* isolate, bool create_heap_objects) {
// static
bool Interpreter::MakeBytecode(CompilationInfo* info) {
- // TODO(rmcilroy): Generate bytecodes...
+ Handle<SharedFunctionInfo> shared_info =
+ Compiler::GetSharedFunctionInfo(info->function(), info->script(), info);
+ BytecodeEmitter emitter(info->isolate(), info->zone());
+ Handle<BytecodeArray> bytecodes = emitter.Emit(info->function());
+ shared_info->set_bytecode_array(*bytecodes);
info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline());
info->EnsureFeedbackVector();
return true;

Powered by Google App Engine
This is Rietveld 408576698