| 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/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 void CodeGenerator::AssemblePrologue() { | 745 void CodeGenerator::AssemblePrologue() { |
| 746 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 746 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 747 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 747 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 748 __ SetStackPointer(csp); | 748 __ SetStackPointer(csp); |
| 749 __ Push(lr, fp); | 749 __ Push(lr, fp); |
| 750 __ Mov(fp, csp); | 750 __ Mov(fp, csp); |
| 751 // TODO(dcarney): correct callee saved registers. | 751 // TODO(dcarney): correct callee saved registers. |
| 752 __ PushCalleeSavedRegisters(); | 752 __ PushCalleeSavedRegisters(); |
| 753 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); | 753 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); |
| 754 } else if (descriptor->IsJSFunctionCall()) { | 754 } else if (descriptor->IsJSFunctionCall()) { |
| 755 CompilationInfo* info = linkage()->info(); | 755 CompilationInfo* info = this->info(); |
| 756 __ SetStackPointer(jssp); | 756 __ SetStackPointer(jssp); |
| 757 __ Prologue(info->IsCodePreAgingActive()); | 757 __ Prologue(info->IsCodePreAgingActive()); |
| 758 frame()->SetRegisterSaveAreaSize( | 758 frame()->SetRegisterSaveAreaSize( |
| 759 StandardFrameConstants::kFixedFrameSizeFromFp); | 759 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 760 | 760 |
| 761 // Sloppy mode functions and builtins need to replace the receiver with the | 761 // Sloppy mode functions and builtins need to replace the receiver with the |
| 762 // global proxy when called as functions (without an explicit receiver | 762 // global proxy when called as functions (without an explicit receiver |
| 763 // object). | 763 // object). |
| 764 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | 764 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? |
| 765 if (info->strict_mode() == SLOPPY && !info->is_native()) { | 765 if (info->strict_mode() == SLOPPY && !info->is_native()) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 UNREACHABLE(); | 960 UNREACHABLE(); |
| 961 } | 961 } |
| 962 } | 962 } |
| 963 | 963 |
| 964 | 964 |
| 965 void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); } | 965 void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); } |
| 966 | 966 |
| 967 | 967 |
| 968 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 968 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 969 int space_needed = Deoptimizer::patch_size(); | 969 int space_needed = Deoptimizer::patch_size(); |
| 970 if (!linkage()->info()->IsStub()) { | 970 if (!info()->IsStub()) { |
| 971 // Ensure that we have enough space after the previous lazy-bailout | 971 // Ensure that we have enough space after the previous lazy-bailout |
| 972 // instruction for patching the code here. | 972 // instruction for patching the code here. |
| 973 intptr_t current_pc = masm()->pc_offset(); | 973 intptr_t current_pc = masm()->pc_offset(); |
| 974 | 974 |
| 975 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { | 975 if (current_pc < (last_lazy_deopt_pc_ + space_needed)) { |
| 976 intptr_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 976 intptr_t padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 977 DCHECK((padding_size % kInstructionSize) == 0); | 977 DCHECK((padding_size % kInstructionSize) == 0); |
| 978 InstructionAccurateScope instruction_accurate( | 978 InstructionAccurateScope instruction_accurate( |
| 979 masm(), padding_size / kInstructionSize); | 979 masm(), padding_size / kInstructionSize); |
| 980 | 980 |
| 981 while (padding_size > 0) { | 981 while (padding_size > 0) { |
| 982 __ nop(); | 982 __ nop(); |
| 983 padding_size -= kInstructionSize; | 983 padding_size -= kInstructionSize; |
| 984 } | 984 } |
| 985 } | 985 } |
| 986 } | 986 } |
| 987 MarkLazyDeoptSite(); | 987 MarkLazyDeoptSite(); |
| 988 } | 988 } |
| 989 | 989 |
| 990 #undef __ | 990 #undef __ |
| 991 | 991 |
| 992 } // namespace compiler | 992 } // namespace compiler |
| 993 } // namespace internal | 993 } // namespace internal |
| 994 } // namespace v8 | 994 } // namespace v8 |
| OLD | NEW |