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

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: Rebased. 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') | src/compiler/bytecode-graph-builder.cc » ('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 9b59aca2e4d9da62a68b4600ce26c7db8b7f1c82..42c8bd89e9d1eba648a5444bc2b085e40b6a762a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -585,6 +585,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());
@@ -745,13 +749,15 @@ 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>();
- }
+ // TODO(4764): When compiling for OSR from bytecode, BailoutId might derive
+ // from bytecode offset and overlap with actual BailoutId. No lookup!
rmcilroy 2016/07/26 11:23:37 This comment should maybe be in the if below?
Michael Starzinger 2016/07/26 14:43:15 Done.
+ bool ignition_osr = !osr_ast_id.IsNone() && osr_frame->is_interpreted();
rmcilroy 2016/07/26 11:23:37 Should this check just be osr_frame->is_interprete
Michael Starzinger 2016/07/26 14:43:15 Done. As discussed offline, we still need to check
+ DCHECK_IMPLIES(ignition_osr, FLAG_ignition_osr); // Only when enabled.
+ if (ignition_osr && !FLAG_turbo_from_bytecode) return MaybeHandle<Code>();
rmcilroy 2016/07/26 11:23:37 nit - newline above to make this bailout clear.
Michael Starzinger 2016/07/26 14:43:15 Done. Also added a comment explaining this bailout
Handle<Code> cached_code;
- if (GetCodeFromOptimizedCodeMap(function, osr_ast_id)
+ if (!ignition_osr &&
+ GetCodeFromOptimizedCodeMap(function, osr_ast_id)
.ToHandle(&cached_code)) {
if (FLAG_trace_opt) {
PrintF("[found optimized code for ");
@@ -772,7 +778,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') | src/compiler/bytecode-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698