| 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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 | 1421 |
| 1422 | 1422 |
| 1423 void CodeGenerator::AddNopForSmiCodeInlining() { | 1423 void CodeGenerator::AddNopForSmiCodeInlining() { |
| 1424 // Unused on 32-bit ARM. Still exists on 64-bit arm. | 1424 // Unused on 32-bit ARM. Still exists on 64-bit arm. |
| 1425 // TODO(plind): Unclear when this is called now. Understand, fix if needed. | 1425 // TODO(plind): Unclear when this is called now. Understand, fix if needed. |
| 1426 __ nop(); // Maybe PROPERTY_ACCESS_INLINED? | 1426 __ nop(); // Maybe PROPERTY_ACCESS_INLINED? |
| 1427 } | 1427 } |
| 1428 | 1428 |
| 1429 | 1429 |
| 1430 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1430 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1431 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1432 return; |
| 1433 } |
| 1434 |
| 1431 int space_needed = Deoptimizer::patch_size(); | 1435 int space_needed = Deoptimizer::patch_size(); |
| 1432 if (!info()->IsStub()) { | 1436 // Ensure that we have enough space after the previous lazy-bailout |
| 1433 // Ensure that we have enough space after the previous lazy-bailout | 1437 // instruction for patching the code here. |
| 1434 // instruction for patching the code here. | 1438 int current_pc = masm()->pc_offset(); |
| 1435 int current_pc = masm()->pc_offset(); | 1439 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 1436 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 1440 // Block tramoline pool emission for duration of padding. |
| 1437 // Block tramoline pool emission for duration of padding. | 1441 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( |
| 1438 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( | 1442 masm()); |
| 1439 masm()); | 1443 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 1440 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1444 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
| 1441 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); | 1445 while (padding_size > 0) { |
| 1442 while (padding_size > 0) { | 1446 __ nop(); |
| 1443 __ nop(); | 1447 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1444 padding_size -= v8::internal::Assembler::kInstrSize; | |
| 1445 } | |
| 1446 } | 1448 } |
| 1447 } | 1449 } |
| 1448 } | 1450 } |
| 1449 | 1451 |
| 1450 #undef __ | 1452 #undef __ |
| 1451 | 1453 |
| 1452 } // namespace compiler | 1454 } // namespace compiler |
| 1453 } // namespace internal | 1455 } // namespace internal |
| 1454 } // namespace v8 | 1456 } // namespace v8 |
| OLD | NEW |