OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Sloppy mode functions and builtins need to replace the receiver with the | 118 // Sloppy mode functions and builtins need to replace the receiver with the |
119 // global proxy when called as functions (without an explicit receiver | 119 // global proxy when called as functions (without an explicit receiver |
120 // object). | 120 // object). |
121 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 121 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
122 Label ok; | 122 Label ok; |
123 int receiver_offset = info->scope()->num_parameters() * kXRegSize; | 123 int receiver_offset = info->scope()->num_parameters() * kXRegSize; |
124 __ Peek(x10, receiver_offset); | 124 __ Peek(x10, receiver_offset); |
125 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); | 125 __ JumpIfNotRoot(x10, Heap::kUndefinedValueRootIndex, &ok); |
126 | 126 |
127 __ Ldr(x10, GlobalObjectMemOperand()); | 127 __ Ldr(x10, GlobalObjectMemOperand()); |
128 __ Ldr(x10, FieldMemOperand(x10, GlobalObject::kGlobalProxyOffset)); | 128 __ Ldr(x10, FieldMemOperand(x10, JSGlobalObject::kGlobalProxyOffset)); |
129 __ Poke(x10, receiver_offset); | 129 __ Poke(x10, receiver_offset); |
130 | 130 |
131 __ Bind(&ok); | 131 __ Bind(&ok); |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 // Open a frame scope to indicate that there is a frame on the stack. | 135 // Open a frame scope to indicate that there is a frame on the stack. |
136 // The MANUAL indicates that the scope shouldn't actually generate code | 136 // The MANUAL indicates that the scope shouldn't actually generate code |
137 // to set up the frame because we do it manually below. | 137 // to set up the frame because we do it manually below. |
138 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 138 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
(...skipping 3802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3941 Label runtime, done; | 3941 Label runtime, done; |
3942 | 3942 |
3943 Register result = x0; | 3943 Register result = x0; |
3944 __ Allocate(JSIteratorResult::kSize, result, x10, x11, &runtime, TAG_OBJECT); | 3944 __ Allocate(JSIteratorResult::kSize, result, x10, x11, &runtime, TAG_OBJECT); |
3945 Register map_reg = x1; | 3945 Register map_reg = x1; |
3946 Register result_value = x2; | 3946 Register result_value = x2; |
3947 Register boolean_done = x3; | 3947 Register boolean_done = x3; |
3948 Register empty_fixed_array = x4; | 3948 Register empty_fixed_array = x4; |
3949 Register untagged_result = x5; | 3949 Register untagged_result = x5; |
3950 __ Ldr(map_reg, GlobalObjectMemOperand()); | 3950 __ Ldr(map_reg, GlobalObjectMemOperand()); |
3951 __ Ldr(map_reg, FieldMemOperand(map_reg, GlobalObject::kNativeContextOffset)); | 3951 __ Ldr(map_reg, |
| 3952 FieldMemOperand(map_reg, JSGlobalObject::kNativeContextOffset)); |
3952 __ Ldr(map_reg, | 3953 __ Ldr(map_reg, |
3953 ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX)); | 3954 ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX)); |
3954 __ Pop(boolean_done); | 3955 __ Pop(boolean_done); |
3955 __ Pop(result_value); | 3956 __ Pop(result_value); |
3956 __ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex); | 3957 __ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex); |
3957 STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize == | 3958 STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize == |
3958 JSObject::kElementsOffset); | 3959 JSObject::kElementsOffset); |
3959 STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize == | 3960 STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize == |
3960 JSIteratorResult::kDoneOffset); | 3961 JSIteratorResult::kDoneOffset); |
3961 __ ObjectUntag(untagged_result, result); | 3962 __ ObjectUntag(untagged_result, result); |
(...skipping 12 matching lines...) Expand all Loading... |
3974 context()->Plug(x0); | 3975 context()->Plug(x0); |
3975 } | 3976 } |
3976 | 3977 |
3977 | 3978 |
3978 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 3979 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
3979 // Push undefined as the receiver. | 3980 // Push undefined as the receiver. |
3980 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | 3981 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
3981 __ Push(x0); | 3982 __ Push(x0); |
3982 | 3983 |
3983 __ Ldr(x0, GlobalObjectMemOperand()); | 3984 __ Ldr(x0, GlobalObjectMemOperand()); |
3984 __ Ldr(x0, FieldMemOperand(x0, GlobalObject::kNativeContextOffset)); | 3985 __ Ldr(x0, FieldMemOperand(x0, JSGlobalObject::kNativeContextOffset)); |
3985 __ Ldr(x0, ContextMemOperand(x0, expr->context_index())); | 3986 __ Ldr(x0, ContextMemOperand(x0, expr->context_index())); |
3986 } | 3987 } |
3987 | 3988 |
3988 | 3989 |
3989 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 3990 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
3990 ZoneList<Expression*>* args = expr->arguments(); | 3991 ZoneList<Expression*>* args = expr->arguments(); |
3991 int arg_count = args->length(); | 3992 int arg_count = args->length(); |
3992 | 3993 |
3993 SetCallPosition(expr, arg_count); | 3994 SetCallPosition(expr, arg_count); |
3994 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 3995 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4897 __ Push(Smi::FromInt(JSIteratorResult::kSize)); | 4898 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
4898 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 4899 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
4899 | 4900 |
4900 __ Bind(&done_allocate); | 4901 __ Bind(&done_allocate); |
4901 Register map_reg = x1; | 4902 Register map_reg = x1; |
4902 Register result_value = x2; | 4903 Register result_value = x2; |
4903 Register boolean_done = x3; | 4904 Register boolean_done = x3; |
4904 Register empty_fixed_array = x4; | 4905 Register empty_fixed_array = x4; |
4905 Register untagged_result = x5; | 4906 Register untagged_result = x5; |
4906 __ Ldr(map_reg, GlobalObjectMemOperand()); | 4907 __ Ldr(map_reg, GlobalObjectMemOperand()); |
4907 __ Ldr(map_reg, FieldMemOperand(map_reg, GlobalObject::kNativeContextOffset)); | 4908 __ Ldr(map_reg, |
| 4909 FieldMemOperand(map_reg, JSGlobalObject::kNativeContextOffset)); |
4908 __ Ldr(map_reg, | 4910 __ Ldr(map_reg, |
4909 ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX)); | 4911 ContextMemOperand(map_reg, Context::ITERATOR_RESULT_MAP_INDEX)); |
4910 __ Pop(result_value); | 4912 __ Pop(result_value); |
4911 __ LoadRoot(boolean_done, | 4913 __ LoadRoot(boolean_done, |
4912 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 4914 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
4913 __ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex); | 4915 __ LoadRoot(empty_fixed_array, Heap::kEmptyFixedArrayRootIndex); |
4914 STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize == | 4916 STATIC_ASSERT(JSObject::kPropertiesOffset + kPointerSize == |
4915 JSObject::kElementsOffset); | 4917 JSObject::kElementsOffset); |
4916 STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize == | 4918 STATIC_ASSERT(JSIteratorResult::kValueOffset + kPointerSize == |
4917 JSIteratorResult::kDoneOffset); | 4919 JSIteratorResult::kDoneOffset); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5131 } | 5133 } |
5132 | 5134 |
5133 return INTERRUPT; | 5135 return INTERRUPT; |
5134 } | 5136 } |
5135 | 5137 |
5136 | 5138 |
5137 } // namespace internal | 5139 } // namespace internal |
5138 } // namespace v8 | 5140 } // namespace v8 |
5139 | 5141 |
5140 #endif // V8_TARGET_ARCH_ARM64 | 5142 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |