Index: src/compiler/arm/code-generator-arm.cc |
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc |
index dca6d4e3ecbb90cd57c2fabd4f331f4222281386..08d7426ad274ac0347c14f6c1f63d703c25cdba4 100644 |
--- a/src/compiler/arm/code-generator-arm.cc |
+++ b/src/compiler/arm/code-generator-arm.cc |
@@ -1240,20 +1240,22 @@ void CodeGenerator::AddNopForSmiCodeInlining() { |
void CodeGenerator::EnsureSpaceForLazyDeopt() { |
+ if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
+ return; |
+ } |
+ |
int space_needed = Deoptimizer::patch_size(); |
- if (!info()->IsStub()) { |
- // Ensure that we have enough space after the previous lazy-bailout |
- // instruction for patching the code here. |
- int current_pc = masm()->pc_offset(); |
- if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
- // Block literal pool emission for duration of padding. |
- v8::internal::Assembler::BlockConstPoolScope block_const_pool(masm()); |
- int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
- DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
- while (padding_size > 0) { |
- __ nop(); |
- padding_size -= v8::internal::Assembler::kInstrSize; |
- } |
+ // Ensure that we have enough space after the previous lazy-bailout |
+ // instruction for patching the code here. |
+ int current_pc = masm()->pc_offset(); |
+ if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
+ // Block literal pool emission for duration of padding. |
+ v8::internal::Assembler::BlockConstPoolScope block_const_pool(masm()); |
+ int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
+ DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
+ while (padding_size > 0) { |
+ __ nop(); |
+ padding_size -= v8::internal::Assembler::kInstrSize; |
} |
} |
} |