| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // global proxy when called as functions (without an explicit receiver | 120 // global proxy when called as functions (without an explicit receiver |
| 121 // object). | 121 // object). |
| 122 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 122 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
| 123 Label ok; | 123 Label ok; |
| 124 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 124 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
| 125 __ ldr(r2, MemOperand(sp, receiver_offset)); | 125 __ ldr(r2, MemOperand(sp, receiver_offset)); |
| 126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
| 127 __ b(ne, &ok); | 127 __ b(ne, &ok); |
| 128 | 128 |
| 129 __ ldr(r2, GlobalObjectOperand()); | 129 __ ldr(r2, GlobalObjectOperand()); |
| 130 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); | 130 __ ldr(r2, FieldMemOperand(r2, JSGlobalObject::kGlobalProxyOffset)); |
| 131 | 131 |
| 132 __ str(r2, MemOperand(sp, receiver_offset)); | 132 __ str(r2, MemOperand(sp, receiver_offset)); |
| 133 | 133 |
| 134 __ bind(&ok); | 134 __ bind(&ok); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Open a frame scope to indicate that there is a frame on the stack. The | 137 // Open a frame scope to indicate that there is a frame on the stack. The |
| 138 // MANUAL indicates that the scope shouldn't actually generate code to set up | 138 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 139 // the frame (that is done below). | 139 // the frame (that is done below). |
| 140 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 140 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2259 | 2259 |
| 2260 __ Allocate(JSIteratorResult::kSize, r0, r2, r3, &allocate, TAG_OBJECT); | 2260 __ Allocate(JSIteratorResult::kSize, r0, r2, r3, &allocate, TAG_OBJECT); |
| 2261 __ b(&done_allocate); | 2261 __ b(&done_allocate); |
| 2262 | 2262 |
| 2263 __ bind(&allocate); | 2263 __ bind(&allocate); |
| 2264 __ Push(Smi::FromInt(JSIteratorResult::kSize)); | 2264 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
| 2265 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2265 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2266 | 2266 |
| 2267 __ bind(&done_allocate); | 2267 __ bind(&done_allocate); |
| 2268 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2268 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 2269 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kNativeContextOffset)); | 2269 __ ldr(r1, FieldMemOperand(r1, JSGlobalObject::kNativeContextOffset)); |
| 2270 __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX)); | 2270 __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 2271 __ pop(r2); | 2271 __ pop(r2); |
| 2272 __ LoadRoot(r3, | 2272 __ LoadRoot(r3, |
| 2273 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 2273 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
| 2274 __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 2274 __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
| 2275 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 2275 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 2276 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 2276 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 2277 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); | 2277 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); |
| 2278 __ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset)); | 2278 __ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset)); |
| 2279 __ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset)); | 2279 __ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset)); |
| (...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4238 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { | 4238 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
| 4239 ZoneList<Expression*>* args = expr->arguments(); | 4239 ZoneList<Expression*>* args = expr->arguments(); |
| 4240 DCHECK_EQ(2, args->length()); | 4240 DCHECK_EQ(2, args->length()); |
| 4241 VisitForStackValue(args->at(0)); | 4241 VisitForStackValue(args->at(0)); |
| 4242 VisitForStackValue(args->at(1)); | 4242 VisitForStackValue(args->at(1)); |
| 4243 | 4243 |
| 4244 Label runtime, done; | 4244 Label runtime, done; |
| 4245 | 4245 |
| 4246 __ Allocate(JSIteratorResult::kSize, r0, r2, r3, &runtime, TAG_OBJECT); | 4246 __ Allocate(JSIteratorResult::kSize, r0, r2, r3, &runtime, TAG_OBJECT); |
| 4247 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 4247 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 4248 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kNativeContextOffset)); | 4248 __ ldr(r1, FieldMemOperand(r1, JSGlobalObject::kNativeContextOffset)); |
| 4249 __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX)); | 4249 __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 4250 __ pop(r3); | 4250 __ pop(r3); |
| 4251 __ pop(r2); | 4251 __ pop(r2); |
| 4252 __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 4252 __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
| 4253 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 4253 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 4254 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 4254 __ str(r4, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 4255 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); | 4255 __ str(r4, FieldMemOperand(r0, JSObject::kElementsOffset)); |
| 4256 __ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset)); | 4256 __ str(r2, FieldMemOperand(r0, JSIteratorResult::kValueOffset)); |
| 4257 __ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset)); | 4257 __ str(r3, FieldMemOperand(r0, JSIteratorResult::kDoneOffset)); |
| 4258 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); | 4258 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
| 4259 __ b(&done); | 4259 __ b(&done); |
| 4260 | 4260 |
| 4261 __ bind(&runtime); | 4261 __ bind(&runtime); |
| 4262 __ CallRuntime(Runtime::kCreateIterResultObject, 2); | 4262 __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
| 4263 | 4263 |
| 4264 __ bind(&done); | 4264 __ bind(&done); |
| 4265 context()->Plug(r0); | 4265 context()->Plug(r0); |
| 4266 } | 4266 } |
| 4267 | 4267 |
| 4268 | 4268 |
| 4269 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 4269 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
| 4270 // Push undefined as the receiver. | 4270 // Push undefined as the receiver. |
| 4271 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 4271 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 4272 __ push(r0); | 4272 __ push(r0); |
| 4273 | 4273 |
| 4274 __ ldr(r0, GlobalObjectOperand()); | 4274 __ ldr(r0, GlobalObjectOperand()); |
| 4275 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); | 4275 __ ldr(r0, FieldMemOperand(r0, JSGlobalObject::kNativeContextOffset)); |
| 4276 __ ldr(r0, ContextOperand(r0, expr->context_index())); | 4276 __ ldr(r0, ContextOperand(r0, expr->context_index())); |
| 4277 } | 4277 } |
| 4278 | 4278 |
| 4279 | 4279 |
| 4280 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4280 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
| 4281 ZoneList<Expression*>* args = expr->arguments(); | 4281 ZoneList<Expression*>* args = expr->arguments(); |
| 4282 int arg_count = args->length(); | 4282 int arg_count = args->length(); |
| 4283 | 4283 |
| 4284 SetCallPosition(expr, arg_count); | 4284 SetCallPosition(expr, arg_count); |
| 4285 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 4285 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5144 DCHECK(interrupt_address == | 5144 DCHECK(interrupt_address == |
| 5145 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5145 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5146 return OSR_AFTER_STACK_CHECK; | 5146 return OSR_AFTER_STACK_CHECK; |
| 5147 } | 5147 } |
| 5148 | 5148 |
| 5149 | 5149 |
| 5150 } // namespace internal | 5150 } // namespace internal |
| 5151 } // namespace v8 | 5151 } // namespace v8 |
| 5152 | 5152 |
| 5153 #endif // V8_TARGET_ARCH_ARM | 5153 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |