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 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 for (size_t index = 0; index < target_count; ++index) { | 1753 for (size_t index = 0; index < target_count; ++index) { |
1754 __ dq(targets[index]); | 1754 __ dq(targets[index]); |
1755 } | 1755 } |
1756 } | 1756 } |
1757 | 1757 |
1758 | 1758 |
1759 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 1759 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
1760 | 1760 |
1761 | 1761 |
1762 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1762 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1763 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1764 return; |
| 1765 } |
| 1766 |
1763 int space_needed = Deoptimizer::patch_size(); | 1767 int space_needed = Deoptimizer::patch_size(); |
1764 if (!info()->IsStub()) { | 1768 // Ensure that we have enough space after the previous lazy-bailout |
1765 // Ensure that we have enough space after the previous lazy-bailout | 1769 // instruction for patching the code here. |
1766 // instruction for patching the code here. | 1770 int current_pc = masm()->pc_offset(); |
1767 int current_pc = masm()->pc_offset(); | 1771 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1768 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1772 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1769 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1773 __ Nop(padding_size); |
1770 __ Nop(padding_size); | |
1771 } | |
1772 } | 1774 } |
1773 } | 1775 } |
1774 | 1776 |
1775 #undef __ | 1777 #undef __ |
1776 | 1778 |
1777 } // namespace internal | 1779 } // namespace internal |
1778 } // namespace compiler | 1780 } // namespace compiler |
1779 } // namespace v8 | 1781 } // namespace v8 |
OLD | NEW |