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

Unified Diff: src/compiler.cc

Issue 2171083004: [interpreter] Implement OSR graph construction from bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-osr-2
Patch Set: Fix build on Windows. Created 4 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/compiler/bytecode-graph-builder.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 dbefcfebfb72adcac99e4e7efe3d67f44aaa47a4..5dc97671435c9e35667ec1adfc159849066ce78b 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -587,6 +587,10 @@ void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
// Frame specialization implies function context specialization.
DCHECK(!info->is_frame_specializing());
+ // TODO(4764): When compiling for OSR from bytecode, BailoutId might derive
+ // from bytecode offset and overlap with actual BailoutId. No caching!
+ if (info->is_osr() && info->is_optimizing_from_bytecode()) return;
+
// Cache optimized context-specific code.
Handle<JSFunction> function = info->closure();
Handle<SharedFunctionInfo> shared(function->shared());
@@ -747,13 +751,18 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
Isolate* isolate = function->GetIsolate();
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
- // TODO(4764): Remove this guard once OSR graph construction works.
- if (!osr_ast_id.IsNone() && osr_frame->is_interpreted()) {
- return MaybeHandle<Code>();
- }
+ bool ignition_osr = osr_frame && osr_frame->is_interpreted();
+ DCHECK_IMPLIES(ignition_osr, !osr_ast_id.IsNone());
+ DCHECK_IMPLIES(ignition_osr, FLAG_ignition_osr);
+
+ // Flag combination --ignition-osr --no-turbo-from-bytecode is unsupported.
+ if (ignition_osr && !FLAG_turbo_from_bytecode) return MaybeHandle<Code>();
Handle<Code> cached_code;
- if (GetCodeFromOptimizedCodeMap(function, osr_ast_id)
+ // TODO(4764): When compiling for OSR from bytecode, BailoutId might derive
+ // from bytecode offset and overlap with actual BailoutId. No lookup!
+ if (!ignition_osr &&
+ GetCodeFromOptimizedCodeMap(function, osr_ast_id)
.ToHandle(&cached_code)) {
if (FLAG_trace_opt) {
PrintF("[found optimized code for ");
@@ -774,7 +783,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
VMState<COMPILER> state(isolate);
DCHECK(!isolate->has_pending_exception());
PostponeInterruptsScope postpone(isolate);
- bool use_turbofan = UseTurboFan(shared);
+ bool use_turbofan = UseTurboFan(shared) || ignition_osr;
std::unique_ptr<CompilationJob> job(
use_turbofan ? compiler::Pipeline::NewCompilationJob(function)
: new HCompilationJob(function));
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698