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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 __ Mov(fp, csp); | 795 __ Mov(fp, csp); |
796 // TODO(dcarney): correct callee saved registers. | 796 // TODO(dcarney): correct callee saved registers. |
797 __ PushCalleeSavedRegisters(); | 797 __ PushCalleeSavedRegisters(); |
798 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); | 798 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); |
799 } else if (descriptor->IsJSFunctionCall()) { | 799 } else if (descriptor->IsJSFunctionCall()) { |
800 CompilationInfo* info = this->info(); | 800 CompilationInfo* info = this->info(); |
801 __ SetStackPointer(jssp); | 801 __ SetStackPointer(jssp); |
802 __ Prologue(info->IsCodePreAgingActive()); | 802 __ Prologue(info->IsCodePreAgingActive()); |
803 frame()->SetRegisterSaveAreaSize( | 803 frame()->SetRegisterSaveAreaSize( |
804 StandardFrameConstants::kFixedFrameSizeFromFp); | 804 StandardFrameConstants::kFixedFrameSizeFromFp); |
805 | |
806 // Sloppy mode functions and builtins need to replace the receiver with the | |
807 // global proxy when called as functions (without an explicit receiver | |
808 // object). | |
809 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC? | |
810 if (info->strict_mode() == SLOPPY && !info->is_native()) { | |
811 Label ok; | |
812 // +2 for return address and saved frame pointer. | |
813 int receiver_slot = info->scope()->num_parameters() + 2; | |
814 __ Ldr(x10, MemOperand(fp, receiver_slot * kXRegSize)); | |
815 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); | |
816 __ Ldr(x10, GlobalObjectMemOperand()); | |
817 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset)); | |
818 __ Str(x10, MemOperand(fp, receiver_slot * kXRegSize)); | |
819 __ Bind(&ok); | |
820 } | |
821 | |
822 } else { | 805 } else { |
823 __ SetStackPointer(jssp); | 806 __ SetStackPointer(jssp); |
824 __ StubPrologue(); | 807 __ StubPrologue(); |
825 frame()->SetRegisterSaveAreaSize( | 808 frame()->SetRegisterSaveAreaSize( |
826 StandardFrameConstants::kFixedFrameSizeFromFp); | 809 StandardFrameConstants::kFixedFrameSizeFromFp); |
827 } | 810 } |
828 int stack_slots = frame()->GetSpillSlotCount(); | 811 int stack_slots = frame()->GetSpillSlotCount(); |
829 if (stack_slots > 0) { | 812 if (stack_slots > 0) { |
830 Register sp = __ StackPointer(); | 813 Register sp = __ StackPointer(); |
831 if (!sp.Is(csp)) { | 814 if (!sp.Is(csp)) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 } | 1013 } |
1031 } | 1014 } |
1032 MarkLazyDeoptSite(); | 1015 MarkLazyDeoptSite(); |
1033 } | 1016 } |
1034 | 1017 |
1035 #undef __ | 1018 #undef __ |
1036 | 1019 |
1037 } // namespace compiler | 1020 } // namespace compiler |
1038 } // namespace internal | 1021 } // namespace internal |
1039 } // namespace v8 | 1022 } // namespace v8 |
OLD | NEW |