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

Unified Diff: src/x64/lithium-codegen-x64.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/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
===================================================================
--- src/x64/lithium-codegen-x64.cc (revision 14601)
+++ src/x64/lithium-codegen-x64.cc (working copy)
@@ -713,7 +713,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());
int id = environment->deoptimization_index();
@@ -728,6 +729,23 @@
return;
}
+ if (soft_deopt) {
+ // It's better soft deopt does not waste the opt count
+ Handle<SharedFunctionInfo> shared(info()->shared_info());
+ __ pushfq();
+ __ push(rax);
+ __ push(rbx);
+ __ movq(rbx, shared, RelocInfo::EMBEDDED_OBJECT);
+ __ movq(rax,
+ FieldOperand(rbx, SharedFunctionInfo::kOptCountOffset));
+ __ SmiSubConstant(rax, rax, Smi::FromInt(1));
+ __ movq(FieldOperand(rbx, SharedFunctionInfo::kOptCountOffset),
+ rax);
+ __ pop(rbx);
+ __ pop(rax);
+ __ popfq();
+ }
+
ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64.
if (FLAG_trap_on_deopt) {
@@ -5495,7 +5513,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/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698