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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 565643002: Refactor emitting of deoptimization descriptors for calls. (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/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 40101)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -2270,17 +2270,30 @@
LocationSummary* TargetEntryInstr::MakeLocationSummary(Isolate* isolate,
bool optimizing) const {
- // FlowGraphCompiler::EmitInstructionPrologue is not called for block
- // entry instructions, so this function is unused. If it becomes
- // reachable, note that the deoptimization descriptor in unoptimized code
- // comes after the point of local register allocation due to pattern
- // matching the edge counter code backwards (as a code reuse convenience
- // on some platforms).
UNREACHABLE();
return NULL;
}
+void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Bind(compiler->GetJumpLabel(this));
+ if (!compiler->is_optimizing()) {
+ if (compiler->NeedsEdgeCounter(this)) {
+ compiler->EmitEdgeCounter();
+ }
+ // The deoptimization descriptor points after the edge counter code for
+ // uniformity with ARM and MIPS, where we can reuse pattern matching
+ // code that matches backwards from the end of the pattern.
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
+ deopt_id_,
+ Scanner::kNoSourcePos);
+ }
+ if (HasParallelMove()) {
+ compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
+ }
+}
+
+
LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate,
bool optimizing) const {
UNREACHABLE();
@@ -2513,9 +2526,6 @@
} else {
// Unoptimized code.
ASSERT(!HasICData());
- compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
- deopt_id(),
- token_pos());
bool is_smi_two_args_op = false;
const uword label_address = TwoArgsSmiOpInlineCacheEntry(token_kind());
if (label_address != 0) {
@@ -2613,13 +2623,6 @@
} else {
call_ic_data = &ICData::ZoneHandle(ic_data()->raw());
}
- if (!compiler->is_optimizing()) {
- // Some static calls can be optimized by the optimizing compiler (e.g. sqrt)
- // and therefore need a deoptimization descriptor.
- compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
- deopt_id(),
- token_pos());
- }
compiler->GenerateStaticCall(deopt_id(),
token_pos(),
function(),
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698