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

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: Incorporate review comments on patch sets 2 & 3. 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698