| Index: src/ia32/lithium-codegen-ia32.cc
|
| ===================================================================
|
| --- src/ia32/lithium-codegen-ia32.cc (revision 14601)
|
| +++ src/ia32/lithium-codegen-ia32.cc (working copy)
|
| @@ -887,7 +887,8 @@
|
| }
|
|
|
|
|
| -void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
|
| +void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment,
|
| + bool soft_deopt) {
|
| RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
|
| ASSERT(environment->HasBeenRegistered());
|
| // It's an error to deoptimize with the x87 fp stack in use.
|
| @@ -904,6 +905,23 @@
|
| return;
|
| }
|
|
|
| + if (soft_deopt) {
|
| + // It's better soft deopt does not waste the opt count
|
| + Handle<SharedFunctionInfo> shared(info()->shared_info());
|
| + __ pushfd();
|
| + __ push(eax);
|
| + __ push(ebx);
|
| + __ mov(ebx, shared);
|
| + __ mov(eax,
|
| + FieldOperand(ebx, SharedFunctionInfo::kOptCountOffset));
|
| + __ sub(Operand(eax), Immediate(Smi::FromInt(1)));
|
| + __ mov(FieldOperand(ebx, SharedFunctionInfo::kOptCountOffset),
|
| + eax);
|
| + __ pop(ebx);
|
| + __ pop(eax);
|
| + __ popfd();
|
| + }
|
| +
|
| if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) {
|
| Handle<SharedFunctionInfo> shared(info()->shared_info());
|
| Label no_deopt;
|
| @@ -6399,7 +6417,7 @@
|
|
|
|
|
| void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
|
| - DeoptimizeIf(no_condition, instr->environment());
|
| + DeoptimizeIf(no_condition, instr->environment(), instr->is_soft_deopt());
|
| }
|
|
|
|
|
|
|