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 ab741b7062686d9bf24fd4023a9b653711cd20a9..2f1b88e78961fc384ce3451c160357fdf764a2e1 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -255,28 +255,20 @@ LInstruction* LCodeGen::GetNextInstruction() { |
| bool LCodeGen::GenerateDeferredCode() { |
| ASSERT(is_generating()); |
| - Label last_jump; |
| if (deferred_.length() > 0) { |
| for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| LDeferredCode* code = deferred_[i]; |
| __ bind(code->entry()); |
| code->Generate(); |
| -#ifdef DEBUG |
| - if (i == deferred_.length() - 1) { |
| - __ bind(&last_jump); |
| - } |
| -#endif |
| __ jmp(code->exit()); |
| } |
| - // Reserve some space to ensure that the last piece of deferred code |
| - // have room for lazy bailout. |
| - __ nop(); |
| - __ nop(); |
| - __ nop(); |
| - |
| - ASSERT(Deoptimizer::patch_size() <= |
| - masm_->SizeOfCodeGeneratedSince(&last_jump)); |
| + // Pad code to ensure that the last piece of deferred code have |
| + // room for lazy bailout. |
| + while ((masm()->pc_offset() - LastSafepointEnd()) |
| + < Deoptimizer::patch_size()) { |
| + __ nop(); |
| + } |
|
sra1
2011/07/06 17:13:03
This is much nicer. Thanks!
|
| } |
| // Deferred code is the last part of the instruction sequence. Mark |