| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // global proxy when called as functions (without an explicit receiver | 128 // global proxy when called as functions (without an explicit receiver |
| 129 // object). | 129 // object). |
| 130 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 130 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
| 131 Label ok; | 131 Label ok; |
| 132 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 132 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
| 133 __ ld(at, MemOperand(sp, receiver_offset)); | 133 __ ld(at, MemOperand(sp, receiver_offset)); |
| 134 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 134 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
| 135 __ Branch(&ok, ne, a2, Operand(at)); | 135 __ Branch(&ok, ne, a2, Operand(at)); |
| 136 | 136 |
| 137 __ ld(a2, GlobalObjectOperand()); | 137 __ ld(a2, GlobalObjectOperand()); |
| 138 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 138 __ ld(a2, FieldMemOperand(a2, JSGlobalObject::kGlobalProxyOffset)); |
| 139 | 139 |
| 140 __ sd(a2, MemOperand(sp, receiver_offset)); | 140 __ sd(a2, MemOperand(sp, receiver_offset)); |
| 141 __ bind(&ok); | 141 __ bind(&ok); |
| 142 } | 142 } |
| 143 // Open a frame scope to indicate that there is a frame on the stack. The | 143 // Open a frame scope to indicate that there is a frame on the stack. The |
| 144 // MANUAL indicates that the scope shouldn't actually generate code to set up | 144 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 145 // the frame (that is done below). | 145 // the frame (that is done below). |
| 146 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 146 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 147 info->set_prologue_offset(masm_->pc_offset()); | 147 info->set_prologue_offset(masm_->pc_offset()); |
| 148 __ Prologue(info->IsCodePreAgingActive()); | 148 __ Prologue(info->IsCodePreAgingActive()); |
| (...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 | 2247 |
| 2248 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); | 2248 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); |
| 2249 __ jmp(&done_allocate); | 2249 __ jmp(&done_allocate); |
| 2250 | 2250 |
| 2251 __ bind(&allocate); | 2251 __ bind(&allocate); |
| 2252 __ Push(Smi::FromInt(JSIteratorResult::kSize)); | 2252 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
| 2253 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2253 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2254 | 2254 |
| 2255 __ bind(&done_allocate); | 2255 __ bind(&done_allocate); |
| 2256 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2256 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 2257 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); | 2257 __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset)); |
| 2258 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); | 2258 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 2259 __ pop(a2); | 2259 __ pop(a2); |
| 2260 __ LoadRoot(a3, | 2260 __ LoadRoot(a3, |
| 2261 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 2261 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
| 2262 __ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex); | 2262 __ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex); |
| 2263 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 2263 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
| 2264 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 2264 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 2265 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); | 2265 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 2266 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); | 2266 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
| 2267 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); | 2267 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
| (...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4261 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { | 4261 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
| 4262 ZoneList<Expression*>* args = expr->arguments(); | 4262 ZoneList<Expression*>* args = expr->arguments(); |
| 4263 DCHECK_EQ(2, args->length()); | 4263 DCHECK_EQ(2, args->length()); |
| 4264 VisitForStackValue(args->at(0)); | 4264 VisitForStackValue(args->at(0)); |
| 4265 VisitForStackValue(args->at(1)); | 4265 VisitForStackValue(args->at(1)); |
| 4266 | 4266 |
| 4267 Label runtime, done; | 4267 Label runtime, done; |
| 4268 | 4268 |
| 4269 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); | 4269 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); |
| 4270 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 4270 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 4271 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); | 4271 __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset)); |
| 4272 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); | 4272 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 4273 __ Pop(a2, a3); | 4273 __ Pop(a2, a3); |
| 4274 __ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex); | 4274 __ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex); |
| 4275 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 4275 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
| 4276 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 4276 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 4277 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); | 4277 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 4278 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); | 4278 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
| 4279 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); | 4279 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
| 4280 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); | 4280 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
| 4281 __ jmp(&done); | 4281 __ jmp(&done); |
| 4282 | 4282 |
| 4283 __ bind(&runtime); | 4283 __ bind(&runtime); |
| 4284 __ CallRuntime(Runtime::kCreateIterResultObject, 2); | 4284 __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
| 4285 | 4285 |
| 4286 __ bind(&done); | 4286 __ bind(&done); |
| 4287 context()->Plug(v0); | 4287 context()->Plug(v0); |
| 4288 } | 4288 } |
| 4289 | 4289 |
| 4290 | 4290 |
| 4291 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 4291 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
| 4292 // Push undefined as the receiver. | 4292 // Push undefined as the receiver. |
| 4293 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 4293 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
| 4294 __ push(v0); | 4294 __ push(v0); |
| 4295 | 4295 |
| 4296 __ ld(v0, GlobalObjectOperand()); | 4296 __ ld(v0, GlobalObjectOperand()); |
| 4297 __ ld(v0, FieldMemOperand(v0, GlobalObject::kNativeContextOffset)); | 4297 __ ld(v0, FieldMemOperand(v0, JSGlobalObject::kNativeContextOffset)); |
| 4298 __ ld(v0, ContextOperand(v0, expr->context_index())); | 4298 __ ld(v0, ContextOperand(v0, expr->context_index())); |
| 4299 } | 4299 } |
| 4300 | 4300 |
| 4301 | 4301 |
| 4302 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4302 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
| 4303 ZoneList<Expression*>* args = expr->arguments(); | 4303 ZoneList<Expression*>* args = expr->arguments(); |
| 4304 int arg_count = args->length(); | 4304 int arg_count = args->length(); |
| 4305 | 4305 |
| 4306 SetCallPosition(expr, arg_count); | 4306 SetCallPosition(expr, arg_count); |
| 4307 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 4307 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5114 reinterpret_cast<uint64_t>( | 5114 reinterpret_cast<uint64_t>( |
| 5115 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5115 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5116 return OSR_AFTER_STACK_CHECK; | 5116 return OSR_AFTER_STACK_CHECK; |
| 5117 } | 5117 } |
| 5118 | 5118 |
| 5119 | 5119 |
| 5120 } // namespace internal | 5120 } // namespace internal |
| 5121 } // namespace v8 | 5121 } // namespace v8 |
| 5122 | 5122 |
| 5123 #endif // V8_TARGET_ARCH_MIPS64 | 5123 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |