OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 for (size_t index = 0; index < target_count; ++index) { | 1511 for (size_t index = 0; index < target_count; ++index) { |
1512 __ dd(targets[index]); | 1512 __ dd(targets[index]); |
1513 } | 1513 } |
1514 } | 1514 } |
1515 | 1515 |
1516 | 1516 |
1517 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 1517 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
1518 | 1518 |
1519 | 1519 |
1520 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1520 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1521 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1522 return; |
| 1523 } |
| 1524 |
1521 int space_needed = Deoptimizer::patch_size(); | 1525 int space_needed = Deoptimizer::patch_size(); |
1522 if (!info()->IsStub()) { | 1526 // Ensure that we have enough space after the previous lazy-bailout |
1523 // Ensure that we have enough space after the previous lazy-bailout | 1527 // instruction for patching the code here. |
1524 // instruction for patching the code here. | 1528 int current_pc = masm()->pc_offset(); |
1525 int current_pc = masm()->pc_offset(); | 1529 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1526 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1530 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1527 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1531 __ Nop(padding_size); |
1528 __ Nop(padding_size); | |
1529 } | |
1530 } | 1532 } |
1531 } | 1533 } |
1532 | 1534 |
1533 #undef __ | 1535 #undef __ |
1534 | 1536 |
1535 } // namespace compiler | 1537 } // namespace compiler |
1536 } // namespace internal | 1538 } // namespace internal |
1537 } // namespace v8 | 1539 } // namespace v8 |
OLD | NEW |