| 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 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
| 9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
| 10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { | 1339 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { |
| 1340 // On 64-bit ARM we emit the jump tables inline. | 1340 // On 64-bit ARM we emit the jump tables inline. |
| 1341 UNREACHABLE(); | 1341 UNREACHABLE(); |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 | 1344 |
| 1345 void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); } | 1345 void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); } |
| 1346 | 1346 |
| 1347 | 1347 |
| 1348 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 1348 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 1349 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 1350 return; |
| 1351 } |
| 1352 |
| 1349 int space_needed = Deoptimizer::patch_size(); | 1353 int space_needed = Deoptimizer::patch_size(); |
| 1350 if (!info()->IsStub()) { | 1354 // Ensure that we have enough space after the previous lazy-bailout |
| 1351 // Ensure that we have enough space after the previous lazy-bailout | 1355 // instruction for patching the code here. |
| 1352 // instruction for patching the code here. | 1356 intptr_t current_pc = masm()->pc_offset(); |
| 1353 intptr_t current_pc = masm()->pc_offset(); | |
| 1354 | 1357 |
| 1355 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { | 1358 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { |
| 1356 intptr_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1359 intptr_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 1357 DCHECK((padding_size % kInstructionSize) == 0); | 1360 DCHECK((padding_size % kInstructionSize) == 0); |
| 1358 InstructionAccurateScope instruction_accurate( | 1361 InstructionAccurateScope instruction_accurate( |
| 1359 masm(), padding_size / kInstructionSize); | 1362 masm(), padding_size / kInstructionSize); |
| 1360 | 1363 |
| 1361 while (padding_size > 0) { | 1364 while (padding_size > 0) { |
| 1362 __ nop(); | 1365 __ nop(); |
| 1363 padding_size -= kInstructionSize; | 1366 padding_size -= kInstructionSize; |
| 1364 } | |
| 1365 } | 1367 } |
| 1366 } | 1368 } |
| 1367 } | 1369 } |
| 1368 | 1370 |
| 1369 #undef __ | 1371 #undef __ |
| 1370 | 1372 |
| 1371 } // namespace compiler | 1373 } // namespace compiler |
| 1372 } // namespace internal | 1374 } // namespace internal |
| 1373 } // namespace v8 | 1375 } // namespace v8 |
| OLD | NEW |