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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 __ lw(at, MemOperand(sp, receiver_offset)); | 133 __ lw(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 __ lw(a2, GlobalObjectOperand()); | 137 __ lw(a2, GlobalObjectOperand()); |
138 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 138 __ lw(a2, FieldMemOperand(a2, JSGlobalObject::kGlobalProxyOffset)); |
139 | 139 |
140 __ sw(a2, MemOperand(sp, receiver_offset)); | 140 __ sw(a2, MemOperand(sp, receiver_offset)); |
141 | 141 |
142 __ bind(&ok); | 142 __ bind(&ok); |
143 } | 143 } |
144 | 144 |
145 // Open a frame scope to indicate that there is a frame on the stack. The | 145 // Open a frame scope to indicate that there is a frame on the stack. The |
146 // MANUAL indicates that the scope shouldn't actually generate code to set up | 146 // MANUAL indicates that the scope shouldn't actually generate code to set up |
147 // the frame (that is done below). | 147 // the frame (that is done below). |
148 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 148 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 | 2249 |
2250 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); | 2250 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); |
2251 __ jmp(&done_allocate); | 2251 __ jmp(&done_allocate); |
2252 | 2252 |
2253 __ bind(&allocate); | 2253 __ bind(&allocate); |
2254 __ Push(Smi::FromInt(JSIteratorResult::kSize)); | 2254 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
2255 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | 2255 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
2256 | 2256 |
2257 __ bind(&done_allocate); | 2257 __ bind(&done_allocate); |
2258 __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2258 __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
2259 __ lw(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); | 2259 __ lw(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset)); |
2260 __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); | 2260 __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
2261 __ pop(a2); | 2261 __ pop(a2); |
2262 __ LoadRoot(a3, | 2262 __ LoadRoot(a3, |
2263 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 2263 done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
2264 __ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex); | 2264 __ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex); |
2265 __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 2265 __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
2266 __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 2266 __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
2267 __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); | 2267 __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
2268 __ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); | 2268 __ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
2269 __ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); | 2269 __ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4258 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { | 4258 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
4259 ZoneList<Expression*>* args = expr->arguments(); | 4259 ZoneList<Expression*>* args = expr->arguments(); |
4260 DCHECK_EQ(2, args->length()); | 4260 DCHECK_EQ(2, args->length()); |
4261 VisitForStackValue(args->at(0)); | 4261 VisitForStackValue(args->at(0)); |
4262 VisitForStackValue(args->at(1)); | 4262 VisitForStackValue(args->at(1)); |
4263 | 4263 |
4264 Label runtime, done; | 4264 Label runtime, done; |
4265 | 4265 |
4266 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); | 4266 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); |
4267 __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 4267 __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
4268 __ lw(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); | 4268 __ lw(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset)); |
4269 __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); | 4269 __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
4270 __ Pop(a2, a3); | 4270 __ Pop(a2, a3); |
4271 __ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex); | 4271 __ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex); |
4272 __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 4272 __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
4273 __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 4273 __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
4274 __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); | 4274 __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
4275 __ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); | 4275 __ sw(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
4276 __ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); | 4276 __ sw(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
4277 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); | 4277 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
4278 __ jmp(&done); | 4278 __ jmp(&done); |
4279 | 4279 |
4280 __ bind(&runtime); | 4280 __ bind(&runtime); |
4281 __ CallRuntime(Runtime::kCreateIterResultObject, 2); | 4281 __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
4282 | 4282 |
4283 __ bind(&done); | 4283 __ bind(&done); |
4284 context()->Plug(v0); | 4284 context()->Plug(v0); |
4285 } | 4285 } |
4286 | 4286 |
4287 | 4287 |
4288 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 4288 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
4289 // Push undefined as the receiver. | 4289 // Push undefined as the receiver. |
4290 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 4290 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
4291 __ push(v0); | 4291 __ push(v0); |
4292 | 4292 |
4293 __ lw(v0, GlobalObjectOperand()); | 4293 __ lw(v0, GlobalObjectOperand()); |
4294 __ lw(v0, FieldMemOperand(v0, GlobalObject::kNativeContextOffset)); | 4294 __ lw(v0, FieldMemOperand(v0, JSGlobalObject::kNativeContextOffset)); |
4295 __ lw(v0, ContextOperand(v0, expr->context_index())); | 4295 __ lw(v0, ContextOperand(v0, expr->context_index())); |
4296 } | 4296 } |
4297 | 4297 |
4298 | 4298 |
4299 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4299 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
4300 ZoneList<Expression*>* args = expr->arguments(); | 4300 ZoneList<Expression*>* args = expr->arguments(); |
4301 int arg_count = args->length(); | 4301 int arg_count = args->length(); |
4302 | 4302 |
4303 SetCallPosition(expr, arg_count); | 4303 SetCallPosition(expr, arg_count); |
4304 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); | 4304 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5108 reinterpret_cast<uint32_t>( | 5108 reinterpret_cast<uint32_t>( |
5109 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5109 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5110 return OSR_AFTER_STACK_CHECK; | 5110 return OSR_AFTER_STACK_CHECK; |
5111 } | 5111 } |
5112 | 5112 |
5113 | 5113 |
5114 } // namespace internal | 5114 } // namespace internal |
5115 } // namespace v8 | 5115 } // namespace v8 |
5116 | 5116 |
5117 #endif // V8_TARGET_ARCH_MIPS | 5117 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |