Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 770cecb7b41963a49fdfec72f1f4539a998d1d5e..f0238f0aba95a8fcd4fdf7c3270bb5aa9b739dd1 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -932,30 +932,22 @@ void LCodeGen::DeoptimizeIf(Condition cc, |
} |
if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
- Handle<SharedFunctionInfo> shared(info()->shared_info()); |
+ ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
danno
2013/07/16 14:47:00
For extra points: Put this code in a code stub wit
|
Label no_deopt; |
__ pushfd(); |
__ push(eax); |
- __ push(ebx); |
- __ mov(ebx, shared); |
- __ mov(eax, |
- FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset)); |
+ __ mov(eax, Operand::StaticVariable(count)); |
__ sub(Operand(eax), Immediate(Smi::FromInt(1))); |
__ j(not_zero, &no_deopt, Label::kNear); |
if (FLAG_trap_on_deopt) __ int3(); |
__ mov(eax, Immediate(Smi::FromInt(FLAG_deopt_every_n_times))); |
- __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), |
- eax); |
- __ pop(ebx); |
+ __ mov(Operand::StaticVariable(count), eax); |
__ pop(eax); |
__ popfd(); |
ASSERT(frame_is_built_); |
__ call(entry, RelocInfo::RUNTIME_ENTRY); |
- |
__ bind(&no_deopt); |
- __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), |
- eax); |
- __ pop(ebx); |
+ __ mov(Operand::StaticVariable(count), eax); |
__ pop(eax); |
__ popfd(); |
} |