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

Unified Diff: src/compiler.cc

Issue 1266713004: [Intepreter] Addition of BytecodeArrayBuilder and accumulator based bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak BytecodeArray::Disassemble(). 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
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.h » ('j') | src/interpreter/bytecode-array-builder.h » ('J')
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 1815c9a8d6441176ba61503aa3ba2186ddc30abe..0cd34ca5b787e7f31f4101d107f1f77a2a213392 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -17,6 +17,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/liveedit.h"
#include "src/messages.h"
@@ -657,6 +658,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());
@@ -670,11 +683,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 | « no previous file | src/interpreter/bytecode-array-builder.h » ('j') | src/interpreter/bytecode-array-builder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698