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

Unified Diff: src/ia32/lithium-codegen-ia32.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/arm/lithium-codegen-arm.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 05152b7ce8efe6b5a1fc4279241501cd0a72aad8..9c473a08c3f109eab1329da78a2e7741e6086507 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -860,44 +860,38 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
__ popfd();
}
+ 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_needed = info()->IsStub();
- if (cc == no_condition) {
- if (FLAG_trap_on_deopt) __ int3();
- if (lazy_deopt_needed) {
+ bool needs_lazy_deopt = info()->IsStub();
+ if (cc == no_condition && frame_is_built_) {
+ if (needs_lazy_deopt) {
__ call(entry, RelocInfo::RUNTIME_ENTRY);
} else {
__ jmp(entry, RelocInfo::RUNTIME_ENTRY);
}
} else {
- Label done;
- if (FLAG_trap_on_deopt) {
- __ j(NegateCondition(cc), &done, Label::kNear);
- __ int3();
+ // We often have several deopts to the same entry, reuse the last
+ // jump entry if this is the case.
+ if (jump_table_.is_empty() ||
+ jump_table_.last().address != entry ||
+ jump_table_.last().needs_frame != !frame_is_built_ ||
+ 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());
}
- if (!lazy_deopt_needed && frame_is_built_) {
- if (FLAG_trap_on_deopt) {
- __ jmp(entry, RelocInfo::RUNTIME_ENTRY);
- } else {
- __ j(cc, entry, RelocInfo::RUNTIME_ENTRY);
- }
+ if (cc == no_condition) {
+ __ jmp(&jump_table_.last().label);
} else {
- // We often have several deopts to the same entry, reuse the last
- // jump entry if this is the case.
- 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_needed) {
- JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt_needed);
- jump_table_.Add(table_entry, zone());
- }
- if (FLAG_trap_on_deopt) {
- __ jmp(&jump_table_.last().label);
- } else {
- __ j(cc, &jump_table_.last().label);
- }
+ __ j(cc, &jump_table_.last().label);
}
- __ bind(&done);
}
}
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698