| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // global proxy when called as functions (without an explicit receiver | 117 // global proxy when called as functions (without an explicit receiver |
| 118 // object). | 118 // object). |
| 119 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 119 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
| 120 Label ok; | 120 Label ok; |
| 121 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 121 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
| 122 __ LoadP(r5, MemOperand(sp, receiver_offset), r0); | 122 __ LoadP(r5, MemOperand(sp, receiver_offset), r0); |
| 123 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); | 123 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); |
| 124 __ bne(&ok); | 124 __ bne(&ok); |
| 125 | 125 |
| 126 __ LoadP(r5, GlobalObjectOperand()); | 126 __ LoadP(r5, GlobalObjectOperand()); |
| 127 __ LoadP(r5, FieldMemOperand(r5, GlobalObject::kGlobalProxyOffset)); | 127 __ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset)); |
| 128 | 128 |
| 129 __ StoreP(r5, MemOperand(sp, receiver_offset), r0); | 129 __ StoreP(r5, MemOperand(sp, receiver_offset), r0); |
| 130 | 130 |
| 131 __ bind(&ok); | 131 __ bind(&ok); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Open a frame scope to indicate that there is a frame on the stack. The | 134 // Open a frame scope to indicate that there is a frame on the stack. The |
| 135 // MANUAL indicates that the scope shouldn't actually generate code to set up | 135 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 136 // the frame (that is done below). | 136 // the frame (that is done below). |
| 137 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 137 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 | 2229 |
| 2230 __ Allocate(JSIteratorResult::kSize, r3, r5, r6, &allocate, TAG_OBJECT); | 2230 __ Allocate(JSIteratorResult::kSize, r3, r5, r6, &allocate, TAG_OBJECT); |
| 2231 __ b(&done_allocate); | 2231 __ b(&done_allocate); |
| 2232 | 2232 |
| 2233 __ bind(&allocate); | 2233 __ bind(&allocate); |
| 2234 __ Push(Smi::FromInt(JSIteratorResult::kSize)); | 2234 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
| 2235 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2235 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2236 | 2236 |
| 2237 __ bind(&done_allocate); | 2237 __ bind(&done_allocate); |
| 2238 __ LoadP(r4, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2238 __ LoadP(r4, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 2239 __ LoadP(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 2239 __ LoadP(r4, FieldMemOperand(r4, JSGlobalObject::kNativeContextOffset)); |
| 2240 __ LoadP(r4, ContextOperand(r4, Context::ITERATOR_RESULT_MAP_INDEX)); | 2240 __ LoadP(r4, ContextOperand(r4, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 2241 __ pop(r5); | 2241 __ pop(r5); |
| 2242 __ LoadRoot(r6, | 2242 __ LoadRoot(r6, |
| 2243 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 2243 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
| 2244 __ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex); | 2244 __ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex); |
| 2245 __ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0); | 2245 __ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0); |
| 2246 __ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); | 2246 __ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); |
| 2247 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | 2247 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); |
| 2248 __ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0); | 2248 __ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0); |
| 2249 __ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0); | 2249 __ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0); |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4262 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { | 4262 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
| 4263 ZoneList<Expression*>* args = expr->arguments(); | 4263 ZoneList<Expression*>* args = expr->arguments(); |
| 4264 DCHECK_EQ(2, args->length()); | 4264 DCHECK_EQ(2, args->length()); |
| 4265 VisitForStackValue(args->at(0)); | 4265 VisitForStackValue(args->at(0)); |
| 4266 VisitForStackValue(args->at(1)); | 4266 VisitForStackValue(args->at(1)); |
| 4267 | 4267 |
| 4268 Label runtime, done; | 4268 Label runtime, done; |
| 4269 | 4269 |
| 4270 __ Allocate(JSIteratorResult::kSize, r3, r5, r6, &runtime, TAG_OBJECT); | 4270 __ Allocate(JSIteratorResult::kSize, r3, r5, r6, &runtime, TAG_OBJECT); |
| 4271 __ LoadP(r4, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 4271 __ LoadP(r4, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 4272 __ LoadP(r4, FieldMemOperand(r4, GlobalObject::kNativeContextOffset)); | 4272 __ LoadP(r4, FieldMemOperand(r4, JSGlobalObject::kNativeContextOffset)); |
| 4273 __ LoadP(r4, ContextOperand(r4, Context::ITERATOR_RESULT_MAP_INDEX)); | 4273 __ LoadP(r4, ContextOperand(r4, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 4274 __ Pop(r5, r6); | 4274 __ Pop(r5, r6); |
| 4275 __ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex); | 4275 __ LoadRoot(r7, Heap::kEmptyFixedArrayRootIndex); |
| 4276 __ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0); | 4276 __ StoreP(r4, FieldMemOperand(r3, HeapObject::kMapOffset), r0); |
| 4277 __ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); | 4277 __ StoreP(r7, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); |
| 4278 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | 4278 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); |
| 4279 __ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0); | 4279 __ StoreP(r5, FieldMemOperand(r3, JSIteratorResult::kValueOffset), r0); |
| 4280 __ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0); | 4280 __ StoreP(r6, FieldMemOperand(r3, JSIteratorResult::kDoneOffset), r0); |
| 4281 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); | 4281 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
| 4282 __ b(&done); | 4282 __ b(&done); |
| 4283 | 4283 |
| 4284 __ bind(&runtime); | 4284 __ bind(&runtime); |
| 4285 __ CallRuntime(Runtime::kCreateIterResultObject, 2); | 4285 __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
| 4286 | 4286 |
| 4287 __ bind(&done); | 4287 __ bind(&done); |
| 4288 context()->Plug(r3); | 4288 context()->Plug(r3); |
| 4289 } | 4289 } |
| 4290 | 4290 |
| 4291 | 4291 |
| 4292 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 4292 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
| 4293 // Push undefined as the receiver. | 4293 // Push undefined as the receiver. |
| 4294 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); | 4294 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
| 4295 __ push(r3); | 4295 __ push(r3); |
| 4296 | 4296 |
| 4297 __ LoadP(r3, GlobalObjectOperand()); | 4297 __ LoadP(r3, GlobalObjectOperand()); |
| 4298 __ LoadP(r3, FieldMemOperand(r3, GlobalObject::kNativeContextOffset)); | 4298 __ LoadP(r3, FieldMemOperand(r3, JSGlobalObject::kNativeContextOffset)); |
| 4299 __ LoadP(r3, ContextOperand(r3, expr->context_index())); | 4299 __ LoadP(r3, ContextOperand(r3, expr->context_index())); |
| 4300 } | 4300 } |
| 4301 | 4301 |
| 4302 | 4302 |
| 4303 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4303 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
| 4304 ZoneList<Expression*>* args = expr->arguments(); | 4304 ZoneList<Expression*>* args = expr->arguments(); |
| 4305 int arg_count = args->length(); | 4305 int arg_count = args->length(); |
| 4306 | 4306 |
| 4307 SetCallPosition(expr, arg_count); | 4307 SetCallPosition(expr, arg_count); |
| 4308 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 4308 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5095 return ON_STACK_REPLACEMENT; | 5095 return ON_STACK_REPLACEMENT; |
| 5096 } | 5096 } |
| 5097 | 5097 |
| 5098 DCHECK(interrupt_address == | 5098 DCHECK(interrupt_address == |
| 5099 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5099 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5100 return OSR_AFTER_STACK_CHECK; | 5100 return OSR_AFTER_STACK_CHECK; |
| 5101 } | 5101 } |
| 5102 } // namespace internal | 5102 } // namespace internal |
| 5103 } // namespace v8 | 5103 } // namespace v8 |
| 5104 #endif // V8_TARGET_ARCH_PPC | 5104 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |