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 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 for (size_t index = 0; index < target_count; ++index) { | 1831 for (size_t index = 0; index < target_count; ++index) { |
1832 __ dd(targets[index]); | 1832 __ dd(targets[index]); |
1833 } | 1833 } |
1834 } | 1834 } |
1835 | 1835 |
1836 | 1836 |
1837 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 1837 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
1838 | 1838 |
1839 | 1839 |
1840 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1840 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1841 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1842 return; |
| 1843 } |
| 1844 |
1841 int space_needed = Deoptimizer::patch_size(); | 1845 int space_needed = Deoptimizer::patch_size(); |
1842 if (!info()->IsStub()) { | 1846 // Ensure that we have enough space after the previous lazy-bailout |
1843 // Ensure that we have enough space after the previous lazy-bailout | 1847 // instruction for patching the code here. |
1844 // instruction for patching the code here. | 1848 int current_pc = masm()->pc_offset(); |
1845 int current_pc = masm()->pc_offset(); | 1849 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1846 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1850 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1847 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1851 __ Nop(padding_size); |
1848 __ Nop(padding_size); | |
1849 } | |
1850 } | 1852 } |
1851 } | 1853 } |
1852 | 1854 |
1853 #undef __ | 1855 #undef __ |
1854 | 1856 |
1855 } // namespace compiler | 1857 } // namespace compiler |
1856 } // namespace internal | 1858 } // namespace internal |
1857 } // namespace v8 | 1859 } // namespace v8 |
OLD | NEW |