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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 10885039: Deoptimization can occur at Dart calls (includes native calls to C) but not at runtime calls. This … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/vm/flow_graph_compiler_ia32.cc
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 11533)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -49,7 +49,7 @@
}
__ call(&StubCode::DeoptimizeLabel());
const intptr_t deopt_info_index = stub_ix;
- compiler->pc_descriptors_list()->AddDeoptInfo(
+ compiler->pc_descriptors_list()->AddDeoptIndex(
compiler->assembler()->CodeSize(),
deopt_id_,
reason_,
@@ -997,6 +997,29 @@
}
+void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
+ intptr_t token_pos,
+ const ExternalLabel* label,
+ PcDescriptors::Kind kind,
+ LocationSummary* locs) {
+ ASSERT(!IsLeaf());
+ __ call(label);
+ AddCurrentDescriptor(kind, deopt_id, token_pos);
+ RecordSafepoint(locs);
+ // Marks either the continuation point in unoptimized code or the
+ // deoptimization point in optimized code, after call.
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(PcDescriptors::kDeoptAfter,
+ deopt_id,
+ token_pos);
+ }
+}
+
+
void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id,
intptr_t token_pos,
const RuntimeEntry& entry,
@@ -1018,11 +1041,11 @@
ASSERT(!IsLeaf());
__ LoadObject(ECX, ic_data);
__ LoadObject(EDX, arguments_descriptor);
-
- __ call(target_label);
- AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos);
- RecordSafepoint(locs);
-
+ GenerateDartCall(deopt_id,
+ token_pos,
+ target_label,
+ PcDescriptors::kIcCall,
+ locs);
__ Drop(argument_count);
}
@@ -1036,12 +1059,11 @@
ASSERT(!IsLeaf());
__ LoadObject(ECX, function);
__ LoadObject(EDX, arguments_descriptor);
- __ call(&StubCode::CallStaticFunctionLabel());
- AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos);
- RecordSafepoint(locs);
- if (is_optimizing()) {
- AddDeoptIndexAtCall(deopt_id, token_pos);
- }
+ GenerateDartCall(deopt_id,
+ token_pos,
+ &StubCode::CallStaticFunctionLabel(),
+ PcDescriptors::kFuncCall,
+ locs);
__ Drop(argument_count);
}

Powered by Google App Engine
This is Rietveld 408576698