Chromium Code Reviews| Index: runtime/vm/intermediate_language_ia32.cc |
| diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc |
| index b8c4942414596f265b2f7b6fe1ce46e9d2431b5d..f082b898e71775623f8b095e83677d387a0dedf3 100644 |
| --- a/runtime/vm/intermediate_language_ia32.cc |
| +++ b/runtime/vm/intermediate_language_ia32.cc |
| @@ -4314,12 +4314,56 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| } |
| +void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + __ Bind(compiler->GetJumpLabel(this)); |
| + if (!compiler->is_optimizing()) { |
| + compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| + deopt_id_, |
| + Scanner::kDummyTokenIndex); |
| + // Add an edge counter. |
|
srdjan
2013/08/14 00:28:24
I would add/use special counter objects, that way
|
| + const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| + counter.SetAt(0, Smi::Handle(Smi::New(0))); |
| + Label done; |
| + __ Comment("Edge counter"); |
| + __ LoadObject(EAX, counter); |
| + __ addl(FieldAddress(EAX, Array::element_offset(0)), |
| + Immediate(Smi::RawValue(1))); |
| + __ j(NO_OVERFLOW, &done); |
| + __ movl(FieldAddress(EAX, Array::element_offset(0)), |
| + Immediate(Smi::RawValue(Smi::kMaxValue))); |
| + __ Bind(&done); |
| + } |
| + if (HasParallelMove()) { |
| + compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| + } |
| +} |
| + |
| + |
| LocationSummary* GotoInstr::MakeLocationSummary() const { |
| return new LocationSummary(0, 0, LocationSummary::kNoCall); |
| } |
| void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| + if (!compiler->is_optimizing()) { |
| + // Add deoptimization descriptor for deoptimizing instructions that may |
| + // be inserted before this instruction. |
| + compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
| + GetDeoptId(), |
| + 0); // No token position. |
| + // Add an edge counter. |
| + const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| + counter.SetAt(0, Smi::Handle(Smi::New(0))); |
| + Label done; |
| + __ Comment("Edge counter"); |
| + __ LoadObject(EAX, counter); |
| + __ addl(FieldAddress(EAX, Array::element_offset(0)), |
| + Immediate(Smi::RawValue(1))); |
| + __ j(NO_OVERFLOW, &done); |
| + __ movl(FieldAddress(EAX, Array::element_offset(0)), |
| + Immediate(Smi::RawValue(Smi::kMaxValue))); |
| + __ Bind(&done); |
| + } |
| if (HasParallelMove()) { |
| compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| } |