Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 3fbd044df52c0094f8bc547efdbd07adde39686f..7089c762242e5b500a65722944f5c161a28bda27 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -385,9 +385,7 @@ bool LCodeGen::GenerateJumpTable() { |
for (int i = 0; i < jump_table_.length(); i++) { |
__ bind(&jump_table_[i].label); |
Address entry = jump_table_[i].address; |
- bool is_lazy_deopt = jump_table_[i].is_lazy_deopt; |
- Deoptimizer::BailoutType type = |
- is_lazy_deopt ? Deoptimizer::LAZY : Deoptimizer::EAGER; |
+ Deoptimizer::BailoutType type = jump_table_[i].bailout_type; |
int id = Deoptimizer::GetDeoptimizationId(isolate(), entry, type); |
if (id == Deoptimizer::kNotDeoptimizationEntry) { |
Comment(";;; jump table entry %d.", i); |
@@ -396,7 +394,7 @@ bool LCodeGen::GenerateJumpTable() { |
} |
if (jump_table_[i].needs_frame) { |
__ push(Immediate(ExternalReference::ForDeoptEntry(entry))); |
- if (is_lazy_deopt) { |
+ if (type == Deoptimizer::LAZY) { |
if (needs_frame_is_call.is_bound()) { |
__ jmp(&needs_frame_is_call); |
} else { |
@@ -441,7 +439,7 @@ bool LCodeGen::GenerateJumpTable() { |
} |
} |
} else { |
- if (is_lazy_deopt) { |
+ if (type == Deoptimizer::LAZY) { |
__ call(entry, RelocInfo::RUNTIME_ENTRY); |
} else { |
__ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
@@ -893,16 +891,15 @@ void LCodeGen::RegisterEnvironmentForDeoptimization( |
} |
-void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
+void LCodeGen::DeoptimizeIf(Condition cc, |
+ LEnvironment* environment, |
+ Deoptimizer::BailoutType bailout_type) { |
RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
ASSERT(environment->HasBeenRegistered()); |
// It's an error to deoptimize with the x87 fp stack in use. |
ASSERT(x87_stack_depth_ == 0); |
int id = environment->deoptimization_index(); |
ASSERT(info()->IsOptimizing() || info()->IsStub()); |
- Deoptimizer::BailoutType bailout_type = info()->IsStub() |
- ? Deoptimizer::LAZY |
- : Deoptimizer::EAGER; |
Address entry = |
Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
if (entry == NULL) { |
@@ -948,9 +945,8 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
} |
ASSERT(info()->IsStub() || frame_is_built_); |
- bool needs_lazy_deopt = info()->IsStub(); |
if (cc == no_condition && frame_is_built_) { |
- if (needs_lazy_deopt) { |
+ if (bailout_type == Deoptimizer::LAZY) { |
__ call(entry, RelocInfo::RUNTIME_ENTRY); |
} else { |
__ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
@@ -961,8 +957,10 @@ 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 != needs_lazy_deopt) { |
- JumpTableEntry table_entry(entry, !frame_is_built_, needs_lazy_deopt); |
+ jump_table_.last().bailout_type != bailout_type) { |
+ Deoptimizer::JumpTableEntry table_entry(entry, |
+ bailout_type, |
+ !frame_is_built_); |
jump_table_.Add(table_entry, zone()); |
} |
if (cc == no_condition) { |
@@ -974,6 +972,21 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
} |
+void LCodeGen::DeoptimizeIf(Condition cc, |
+ LEnvironment* environment) { |
+ Deoptimizer::BailoutType bailout_type = info()->IsStub() |
+ ? Deoptimizer::LAZY |
+ : Deoptimizer::EAGER; |
+ DeoptimizeIf(cc, environment, bailout_type); |
+} |
+ |
+ |
+void LCodeGen::SoftDeoptimize(LEnvironment* environment) { |
+ ASSERT(!info()->IsStub()); |
+ DeoptimizeIf(no_condition, environment, Deoptimizer::SOFT); |
+} |
+ |
+ |
void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
ZoneList<Handle<Map> > maps(1, zone()); |
int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
@@ -6316,7 +6329,11 @@ void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
- DeoptimizeIf(no_condition, instr->environment()); |
+ if (instr->hydrogen_value()->IsSoftDeoptimize()) { |
+ SoftDeoptimize(instr->environment()); |
+ } else { |
+ DeoptimizeIf(no_condition, instr->environment()); |
+ } |
} |