Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index 75525ed5be95ee7723968a0084687de7c440c3c7..e6e763e6550f5913e59a9fd2d25bc64173252c55 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -359,9 +359,13 @@ bool LCodeGen::GenerateBody() { |
| instr->CompileToNative(this); |
| - if (!CpuFeatures::IsSupported(SSE2) && |
| - FLAG_debug_code && FLAG_enable_slow_asserts) { |
| + if (!CpuFeatures::IsSupported(SSE2)) { |
| + if (instr->IsGoto()) { |
| + x87_stack_.LeavingBlock(current_block_, LGoto::cast(instr)); |
| + } else if (FLAG_debug_code && FLAG_enable_slow_asserts && |
| + !instr->IsGap() && !instr->IsReturn()) { |
| __ VerifyX87StackDepth(x87_stack_.depth()); |
| + } |
| } |
| } |
| EnsureSpaceForLazyDeopt(); |
| @@ -659,6 +663,18 @@ void LCodeGen::X87Stack::FlushIfNecessary(LInstruction* instr, LCodeGen* cgen) { |
| __ fstp(0); |
| stack_depth_--; |
| } |
| + __ VerifyX87StackDepth(0); |
| + } |
| +} |
| + |
| + |
| +void LCodeGen::X87Stack::LeavingBlock(int current_block_id, LGoto* goto_instr) { |
| + ASSERT(stack_depth_ <= 1); |
|
Toon Verwaest
2013/09/11 12:28:30
Add comment as discussed. If ever used for other s
|
| + if (current_block_id + 1 != goto_instr->block_id()) { |
| + // If we have a value on the x87 stack on leaving a block, it must be a |
| + // phi input. If the next block we compile is not the join block, we have |
| + // to discard the stack state. |
| + stack_depth_ = 0; |
| } |
| } |
| @@ -2439,6 +2455,10 @@ void LCodeGen::EmitGoto(int block) { |
| } |
| +void LCodeGen::DoClobberDoubles(LClobberDoubles* instr) { |
| +} |
| + |
| + |
| void LCodeGen::DoGoto(LGoto* instr) { |
| EmitGoto(instr->block_id()); |
| } |