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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/osr.h" | 9 #include "src/compiler/osr.h" |
10 #include "src/mips/macro-assembler-mips.h" | 10 #include "src/mips/macro-assembler-mips.h" |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 | 1354 |
1355 | 1355 |
1356 void CodeGenerator::AddNopForSmiCodeInlining() { | 1356 void CodeGenerator::AddNopForSmiCodeInlining() { |
1357 // Unused on 32-bit ARM. Still exists on 64-bit arm. | 1357 // Unused on 32-bit ARM. Still exists on 64-bit arm. |
1358 // TODO(plind): Unclear when this is called now. Understand, fix if needed. | 1358 // TODO(plind): Unclear when this is called now. Understand, fix if needed. |
1359 __ nop(); // Maybe PROPERTY_ACCESS_INLINED? | 1359 __ nop(); // Maybe PROPERTY_ACCESS_INLINED? |
1360 } | 1360 } |
1361 | 1361 |
1362 | 1362 |
1363 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1363 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1364 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1365 return; |
| 1366 } |
| 1367 |
1364 int space_needed = Deoptimizer::patch_size(); | 1368 int space_needed = Deoptimizer::patch_size(); |
1365 if (!info()->IsStub()) { | 1369 // Ensure that we have enough space after the previous lazy-bailout |
1366 // Ensure that we have enough space after the previous lazy-bailout | 1370 // instruction for patching the code here. |
1367 // instruction for patching the code here. | 1371 int current_pc = masm()->pc_offset(); |
1368 int current_pc = masm()->pc_offset(); | 1372 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
1369 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1373 // Block tramoline pool emission for duration of padding. |
1370 // Block tramoline pool emission for duration of padding. | 1374 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( |
1371 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( | 1375 masm()); |
1372 masm()); | 1376 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1373 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1377 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
1374 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); | 1378 while (padding_size > 0) { |
1375 while (padding_size > 0) { | 1379 __ nop(); |
1376 __ nop(); | 1380 padding_size -= v8::internal::Assembler::kInstrSize; |
1377 padding_size -= v8::internal::Assembler::kInstrSize; | |
1378 } | |
1379 } | 1381 } |
1380 } | 1382 } |
1381 } | 1383 } |
1382 | 1384 |
1383 #undef __ | 1385 #undef __ |
1384 | 1386 |
1385 } // namespace compiler | 1387 } // namespace compiler |
1386 } // namespace internal | 1388 } // namespace internal |
1387 } // namespace v8 | 1389 } // namespace v8 |
OLD | NEW |