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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 575443002: Refactor generating lazy deoptimization descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 40150)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -541,13 +541,16 @@
void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
- intptr_t token_pos) {
+ intptr_t token_pos,
+ intptr_t input_count) {
ASSERT(is_optimizing());
ASSERT(!intrinsic_mode());
+ Environment* env = pending_deoptimization_env_->DeepCopy(
+ isolate(), pending_deoptimization_env_->Length() - input_count);
CompilerDeoptInfo* info =
new CompilerDeoptInfo(deopt_id,
ICData::kDeoptAtCall,
- pending_deoptimization_env_);
+ env);
info->set_pc_offset(assembler()->CodeSize());
deopt_infos_.Add(info);
}
@@ -872,6 +875,29 @@
}
+// Record safe point and deoptimization info if applicable.
+void FlowGraphCompiler::RecordCallInfo(intptr_t token_pos,
+ RawPcDescriptors::Kind kind,
+ intptr_t deopt_id,
+ LocationSummary* locs,
+ intptr_t input_count_adjustment) {
+ AddCurrentDescriptor(kind, deopt_id, token_pos);
+ RecordSafepoint(locs);
+ if (deopt_id != Isolate::kNoDeoptId) {
+ // Marks either the continuation point in unoptimized code or the
+ // deoptimization point in optimized code, after call.
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos, input_count_adjustment);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
+ }
+}
+
+
void FlowGraphCompiler::GenerateInstanceCall(
intptr_t deopt_id,
intptr_t token_pos,
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698