OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/ppc/macro-assembler-ppc.h" | 10 #include "src/ppc/macro-assembler-ppc.h" |
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 } | 1575 } |
1576 } | 1576 } |
1577 | 1577 |
1578 | 1578 |
1579 void CodeGenerator::AddNopForSmiCodeInlining() { | 1579 void CodeGenerator::AddNopForSmiCodeInlining() { |
1580 // We do not insert nops for inlined Smi code. | 1580 // We do not insert nops for inlined Smi code. |
1581 } | 1581 } |
1582 | 1582 |
1583 | 1583 |
1584 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1584 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1585 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1586 return; |
| 1587 } |
| 1588 |
1585 int space_needed = Deoptimizer::patch_size(); | 1589 int space_needed = Deoptimizer::patch_size(); |
1586 if (!info()->IsStub()) { | 1590 // Ensure that we have enough space after the previous lazy-bailout |
1587 // Ensure that we have enough space after the previous lazy-bailout | 1591 // instruction for patching the code here. |
1588 // instruction for patching the code here. | 1592 int current_pc = masm()->pc_offset(); |
1589 int current_pc = masm()->pc_offset(); | 1593 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1590 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1594 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1591 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1595 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
1592 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); | 1596 while (padding_size > 0) { |
1593 while (padding_size > 0) { | 1597 __ nop(); |
1594 __ nop(); | 1598 padding_size -= v8::internal::Assembler::kInstrSize; |
1595 padding_size -= v8::internal::Assembler::kInstrSize; | |
1596 } | |
1597 } | 1599 } |
1598 } | 1600 } |
1599 } | 1601 } |
1600 | 1602 |
1601 #undef __ | 1603 #undef __ |
1602 | 1604 |
1603 } // namespace compiler | 1605 } // namespace compiler |
1604 } // namespace internal | 1606 } // namespace internal |
1605 } // namespace v8 | 1607 } // namespace v8 |
OLD | NEW |