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

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

Issue 12223053: Fix bugs in DeoptimizeIf when lazy deopt is requested. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Allow continuation after the int3 trap. Created 7 years, 10 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index b3c4bc827d8f98ca76ea6d0427167a9137271cfd..f1e6e59891460230b39685aef839360f49e27172 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -719,10 +719,21 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
return;
}
+ ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64.
+
+ if (FLAG_trap_on_deopt) {
+ Label done;
+ if (cc != no_condition) {
+ __ j(NegateCondition(cc), &done, Label::kNear);
+ }
+ __ int3();
+ __ bind(&done);
+ }
+
ASSERT(info()->IsStub() || frame_is_built_);
- bool lazy_deopt = info()->IsStub();
- if (cc == no_condition) {
- if (lazy_deopt) {
+ bool needs_lazy_deopt = info()->IsStub();
+ if (cc == no_condition && frame_is_built_) {
+ if (needs_lazy_deopt) {
__ Call(entry, RelocInfo::RUNTIME_ENTRY);
} else {
__ Jump(entry, RelocInfo::RUNTIME_ENTRY);
@@ -733,11 +744,15 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
if (jump_table_.is_empty() ||
jump_table_.last().address != entry ||
jump_table_.last().needs_frame != !frame_is_built_ ||
- jump_table_.last().is_lazy_deopt != lazy_deopt) {
- JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt);
+ jump_table_.last().is_lazy_deopt != needs_lazy_deopt) {
+ JumpTableEntry table_entry(entry, !frame_is_built_, needs_lazy_deopt);
jump_table_.Add(table_entry, zone());
}
- __ j(cc, &jump_table_.last().label);
+ if (cc == no_condition) {
+ __ jmp(&jump_table_.last().label);
+ } else {
+ __ j(cc, &jump_table_.last().label);
+ }
}
}
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698