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/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 | 1418 |
1419 void CodeGenerator::AssembleDeoptimizerCall( | 1419 void CodeGenerator::AssembleDeoptimizerCall( |
1420 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { | 1420 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1421 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1421 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1422 isolate(), deoptimization_id, bailout_type); | 1422 isolate(), deoptimization_id, bailout_type); |
1423 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1423 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1424 } | 1424 } |
1425 | 1425 |
1426 | 1426 |
1427 void CodeGenerator::AssemblePrologue() { | 1427 void CodeGenerator::AssemblePrologue() { |
1428 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1428 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1429 if (descriptor->IsCFunctionCall()) { | 1429 if (descriptor->IsCFunctionCall()) { |
1430 __ SetStackPointer(csp); | 1430 __ SetStackPointer(csp); |
1431 __ Push(lr, fp); | 1431 __ Push(lr, fp); |
1432 __ Mov(fp, csp); | 1432 __ Mov(fp, csp); |
1433 } else if (descriptor->IsJSFunctionCall()) { | 1433 } else if (descriptor->IsJSFunctionCall()) { |
1434 __ SetStackPointer(jssp); | 1434 __ SetStackPointer(jssp); |
1435 __ Prologue(this->info()->GeneratePreagedPrologue()); | 1435 __ Prologue(this->info()->GeneratePreagedPrologue()); |
1436 } else if (frame()->needs_frame()) { | 1436 } else if (frame()->needs_frame()) { |
1437 if (descriptor->UseNativeStack()) { | 1437 if (descriptor->UseNativeStack()) { |
1438 __ SetStackPointer(csp); | 1438 __ SetStackPointer(csp); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 descriptor->CalleeSavedRegisters()); | 1492 descriptor->CalleeSavedRegisters()); |
1493 saved_count = saves.Count(); | 1493 saved_count = saves.Count(); |
1494 if (saved_count != 0) { | 1494 if (saved_count != 0) { |
1495 __ PushCPURegList(saves); | 1495 __ PushCPURegList(saves); |
1496 frame()->AllocateSavedCalleeRegisterSlots(saved_count); | 1496 frame()->AllocateSavedCalleeRegisterSlots(saved_count); |
1497 } | 1497 } |
1498 } | 1498 } |
1499 | 1499 |
1500 | 1500 |
1501 void CodeGenerator::AssembleReturn() { | 1501 void CodeGenerator::AssembleReturn() { |
1502 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1502 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1503 | 1503 |
1504 // Restore registers. | 1504 // Restore registers. |
1505 CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits, | 1505 CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits, |
1506 descriptor->CalleeSavedRegisters()); | 1506 descriptor->CalleeSavedRegisters()); |
1507 if (saves.Count() != 0) { | 1507 if (saves.Count() != 0) { |
1508 __ PopCPURegList(saves); | 1508 __ PopCPURegList(saves); |
1509 } | 1509 } |
1510 | 1510 |
1511 // Restore fp registers. | 1511 // Restore fp registers. |
1512 CPURegList saves_fp = CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, | 1512 CPURegList saves_fp = CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 padding_size -= kInstructionSize; | 1724 padding_size -= kInstructionSize; |
1725 } | 1725 } |
1726 } | 1726 } |
1727 } | 1727 } |
1728 | 1728 |
1729 #undef __ | 1729 #undef __ |
1730 | 1730 |
1731 } // namespace compiler | 1731 } // namespace compiler |
1732 } // namespace internal | 1732 } // namespace internal |
1733 } // namespace v8 | 1733 } // namespace v8 |
OLD | NEW |