Index: runtime/vm/flow_graph_compiler_ia32.cc |
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc |
index 2ea07d5a3a8a93b1e5c667d8e84dee3bbc100e51..cfcde17ef825c8373caf2831cd5d485615084df6 100644 |
--- a/runtime/vm/flow_graph_compiler_ia32.cc |
+++ b/runtime/vm/flow_graph_compiler_ia32.cc |
@@ -742,28 +742,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
} |
-void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { |
- if (!is_optimizing()) { |
- if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { |
- AssertAssignableInstr* assert = instr->AsAssertAssignable(); |
- AddCurrentDescriptor(PcDescriptors::kDeopt, |
- assert->deopt_id(), |
- assert->token_pos()); |
- } else if (instr->IsGuardField() || |
- instr->CanBecomeDeoptimizationTarget()) { |
- AddCurrentDescriptor(PcDescriptors::kDeopt, |
- instr->deopt_id(), |
- Scanner::kDummyTokenIndex); |
- } |
- AllocateRegistersLocally(instr); |
- } else if (instr->MayThrow() && |
- (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) { |
- // Optimized try-block: Sync locals to fixed stack locations. |
- EmitTrySync(instr, CurrentTryIndex()); |
- } |
-} |
- |
- |
void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset, |
Location loc, |
bool* push_emitted) { |
@@ -1323,6 +1301,21 @@ void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
} |
+void FlowGraphCompiler::EmitEdgeCounter() { |
+ // We do not check for overflow when incrementing the edge counter. The |
+ // function should normally be optimized long before the counter can |
+ // overflow; and though we do not reset the counters when we optimize or |
+ // deoptimize, there is a bound on the number of |
+ // optimization/deoptimization cycles we will attempt. |
+ const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
+ counter.SetAt(0, Smi::Handle(Smi::New(0))); |
+ __ Comment("Edge counter"); |
+ __ LoadObject(EAX, counter); |
+ __ addl(FieldAddress(EAX, Array::element_offset(0)), |
+ Immediate(Smi::RawValue(1))); |
+} |
+ |
+ |
void FlowGraphCompiler::EmitOptimizedInstanceCall( |
ExternalLabel* target_label, |
const ICData& ic_data, |