Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 14791014: Deoptimized by soft deoptimize should not affect the opt count (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698