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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 612 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { |
613 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 613 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
614 isolate(), deoptimization_id, Deoptimizer::LAZY); | 614 isolate(), deoptimization_id, Deoptimizer::LAZY); |
615 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 615 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
616 } | 616 } |
617 | 617 |
618 | 618 |
619 void CodeGenerator::AssemblePrologue() { | 619 void CodeGenerator::AssemblePrologue() { |
620 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 620 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
621 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 621 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 622 bool saved_pp; |
622 if (FLAG_enable_ool_constant_pool) { | 623 if (FLAG_enable_ool_constant_pool) { |
623 __ Push(lr, fp, pp); | 624 __ Push(lr, fp, pp); |
624 // Adjust FP to point to saved FP. | 625 // Adjust FP to point to saved FP. |
625 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); | 626 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); |
| 627 saved_pp = true; |
626 } else { | 628 } else { |
627 __ Push(lr, fp); | 629 __ Push(lr, fp); |
628 __ mov(fp, sp); | 630 __ mov(fp, sp); |
| 631 saved_pp = false; |
629 } | 632 } |
630 const RegList saves = descriptor->CalleeSavedRegisters(); | 633 const RegList saves = descriptor->CalleeSavedRegisters(); |
631 if (saves != 0) { // Save callee-saved registers. | 634 if (saves != 0 || saved_pp) { |
632 int register_save_area_size = 0; | 635 // Save callee-saved registers. |
| 636 int register_save_area_size = saved_pp ? kPointerSize : 0; |
633 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { | 637 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
634 if (!((1 << i) & saves)) continue; | 638 if (!((1 << i) & saves)) continue; |
635 register_save_area_size += kPointerSize; | 639 register_save_area_size += kPointerSize; |
636 } | 640 } |
637 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 641 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
638 __ stm(db_w, sp, saves); | 642 __ stm(db_w, sp, saves); |
639 } | 643 } |
640 } else if (descriptor->IsJSFunctionCall()) { | 644 } else if (descriptor->IsJSFunctionCall()) { |
641 CompilationInfo* info = linkage()->info(); | 645 CompilationInfo* info = linkage()->info(); |
642 __ Prologue(info->IsCodePreAgingActive()); | 646 __ Prologue(info->IsCodePreAgingActive()); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 | 854 |
851 void CodeGenerator::AddNopForSmiCodeInlining() { | 855 void CodeGenerator::AddNopForSmiCodeInlining() { |
852 // On 32-bit ARM we do not insert nops for inlined Smi code. | 856 // On 32-bit ARM we do not insert nops for inlined Smi code. |
853 } | 857 } |
854 | 858 |
855 #undef __ | 859 #undef __ |
856 | 860 |
857 } // namespace compiler | 861 } // namespace compiler |
858 } // namespace internal | 862 } // namespace internal |
859 } // namespace v8 | 863 } // namespace v8 |
OLD | NEW |