Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_arm.cc |
| diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc |
| index 7353b27fa753043056ae0cdb84efd4e644a492ed..9ffc88f3d9904ea9b280188a93c519eff3d65091 100644 |
| --- a/runtime/vm/flow_graph_compiler_arm.cc |
| +++ b/runtime/vm/flow_graph_compiler_arm.cc |
| @@ -720,28 +720,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) { |
| @@ -1275,6 +1253,22 @@ void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, |
| } |
| +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(R0, counter); |
| + __ ldr(IP, FieldAddress(R0, Array::element_offset(0))); |
| + __ adds(IP, IP, ShifterOperand(Smi::RawValue(1))); |
|
zra
2013/09/30 15:22:15
Maybe just add() if you don't need to set the cond
|
| + __ str(IP, FieldAddress(R0, Array::element_offset(0))); |
| +} |
| + |
| + |
| void FlowGraphCompiler::EmitOptimizedInstanceCall( |
| ExternalLabel* target_label, |
| const ICData& ic_data, |