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

Unified Diff: src/compiler.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 | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 8a0ea19b62caf3a70e1d929fa1b698cd2d07fd49..063e2c6b1c4e7fec26f122fd289877ea54396697 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -18,6 +18,7 @@
#include "src/full-codegen/full-codegen.h"
#include "src/gdb-jit.h"
#include "src/hydrogen.h"
+#include "src/interpreter/interpreter.h"
#include "src/lithium.h"
#include "src/log-inl.h"
#include "src/messages.h"
@@ -661,6 +662,18 @@ static bool CompileUnoptimizedCode(CompilationInfo* info) {
}
+static bool GenerateBytecode(CompilationInfo* info) {
+ DCHECK(AllowCompilation::IsAllowed(info->isolate()));
+ if (!Compiler::Analyze(info->parse_info()) ||
+ !interpreter::Interpreter::MakeBytecode(info)) {
+ Isolate* isolate = info->isolate();
+ if (!isolate->has_pending_exception()) isolate->StackOverflow();
+ return false;
+ }
+ return true;
+}
+
+
MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon(
CompilationInfo* info) {
VMState<COMPILER> state(info->isolate());
@@ -674,11 +687,16 @@ MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon(
SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
MaybeDisableOptimization(shared, lit->dont_optimize_reason());
- // Compile unoptimized code.
- if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>();
+ if (FLAG_ignition && info->closure()->PassesFilter(FLAG_ignition_filter)) {
+ // Compile bytecode for the interpreter.
+ if (!GenerateBytecode(info)) return MaybeHandle<Code>();
+ } else {
+ // Compile unoptimized code.
+ if (!CompileUnoptimizedCode(info)) return MaybeHandle<Code>();
- CHECK_EQ(Code::FUNCTION, info->code()->kind());
- RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
+ CHECK_EQ(Code::FUNCTION, info->code()->kind());
+ RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared);
+ }
// Update the shared function info with the scope info. Allocating the
// ScopeInfo object may cause a GC.
« no previous file with comments | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698