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

Unified Diff: src/interpreter/interpreter.cc

Issue 1294543002: [Interpreter] Minimal bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-register-conversion
Patch Set: Created 5 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 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);

Powered by Google App Engine
This is Rietveld 408576698