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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2595553002: VM: [DBC] Fix more problems with lazy deopt. (Closed)
Patch Set: Created 4 years 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 | tests/language/vm/lazy_deopt_vm_test.dart » ('j') | tests/language/vm/lazy_deopt_vm_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index 60e9e9408436a4e8e767882260152fa23cb782f7..e15e4fa68dd633b9bb5b3a451bd3f9769f2358a1 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -917,7 +917,12 @@ EMIT_NATIVE_CODE(StringInterpolate,
__ PushConstant(CallFunction());
const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor);
__ StaticCall(kArgumentCount, argdesc_kidx);
- compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult);
+ // Note: can't use RecordAfterCall here because
+ // StringInterpolateInstr::ArgumentCount() is 0. However
+ // internally it does a call with 1 argument which needs to
+ // be reflected in the lazy deoptimization environment.
+ compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount,
+ FlowGraphCompiler::kHasResult, locs());
if (compiler->is_optimizing()) {
__ PopLocal(locs()->out(0).reg());
}
@@ -1145,7 +1150,15 @@ EMIT_NATIVE_CODE(CatchBlockEntry, 0) {
compiler->AddExceptionHandler(catch_try_index(), try_index(),
compiler->assembler()->CodeSize(),
catch_handler_types_, needs_stacktrace());
-
+ // On lazy deoptimization we patch the optimized code here to enter the
+ // deoptimization stub.
+ const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
+ if (compiler->is_optimizing()) {
+ compiler->AddDeoptIndexAtCall(deopt_id);
+ } else {
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
+ TokenPosition::kNoSource);
+ }
if (HasParallelMove()) {
compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
}
« no previous file with comments | « no previous file | tests/language/vm/lazy_deopt_vm_test.dart » ('j') | tests/language/vm/lazy_deopt_vm_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698