| 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 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 __ CallRuntime(Runtime::kResumeJSGeneratorObject, 3); | 2257 __ CallRuntime(Runtime::kResumeJSGeneratorObject, 3); |
| 2258 // Not reached: the runtime call returns elsewhere. | 2258 // Not reached: the runtime call returns elsewhere. |
| 2259 __ stop("not-reached"); | 2259 __ stop("not-reached"); |
| 2260 | 2260 |
| 2261 __ bind(&done); | 2261 __ bind(&done); |
| 2262 context()->Plug(result_register()); | 2262 context()->Plug(result_register()); |
| 2263 } | 2263 } |
| 2264 | 2264 |
| 2265 | 2265 |
| 2266 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { | 2266 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { |
| 2267 Label gc_required; | 2267 Label allocate, done_allocate; |
| 2268 Label allocated; | |
| 2269 | 2268 |
| 2270 const int instance_size = 5 * kPointerSize; | 2269 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); |
| 2271 DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(), | 2270 __ jmp(&done_allocate); |
| 2272 instance_size); | |
| 2273 | 2271 |
| 2274 __ Allocate(instance_size, v0, a2, a3, &gc_required, TAG_OBJECT); | 2272 __ bind(&allocate); |
| 2275 __ jmp(&allocated); | 2273 __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
| 2274 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
| 2276 | 2275 |
| 2277 __ bind(&gc_required); | 2276 __ bind(&done_allocate); |
| 2278 __ Push(Smi::FromInt(instance_size)); | |
| 2279 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); | |
| 2280 __ ld(context_register(), | |
| 2281 MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 2282 | |
| 2283 __ bind(&allocated); | |
| 2284 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); | 2277 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 2285 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); | 2278 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); |
| 2286 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); | 2279 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 2287 __ pop(a2); | 2280 __ pop(a2); |
| 2288 __ li(a3, Operand(isolate()->factory()->ToBoolean(done))); | 2281 __ li(a3, Operand(isolate()->factory()->ToBoolean(done))); |
| 2289 __ li(a4, Operand(isolate()->factory()->empty_fixed_array())); | 2282 __ li(t0, Operand(isolate()->factory()->empty_fixed_array())); |
| 2290 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 2283 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
| 2291 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 2284 __ sd(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 2292 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); | 2285 __ sd(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 2293 __ sd(a2, | 2286 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
| 2294 FieldMemOperand(v0, JSGeneratorObject::kResultValuePropertyOffset)); | 2287 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
| 2295 __ sd(a3, | 2288 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
| 2296 FieldMemOperand(v0, JSGeneratorObject::kResultDonePropertyOffset)); | |
| 2297 | |
| 2298 // Only the value field needs a write barrier, as the other values are in the | |
| 2299 // root set. | |
| 2300 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, | |
| 2301 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); | |
| 2302 } | 2289 } |
| 2303 | 2290 |
| 2304 | 2291 |
| 2305 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2292 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2306 SetExpressionPosition(prop); | 2293 SetExpressionPosition(prop); |
| 2307 Literal* key = prop->key()->AsLiteral(); | 2294 Literal* key = prop->key()->AsLiteral(); |
| 2308 DCHECK(!prop->IsSuperAccess()); | 2295 DCHECK(!prop->IsSuperAccess()); |
| 2309 | 2296 |
| 2310 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2297 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2311 __ li(LoadDescriptor::SlotRegister(), | 2298 __ li(LoadDescriptor::SlotRegister(), |
| (...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4496 DCHECK(expr->arguments()->length() == 0); | 4483 DCHECK(expr->arguments()->length() == 0); |
| 4497 ExternalReference debug_is_active = | 4484 ExternalReference debug_is_active = |
| 4498 ExternalReference::debug_is_active_address(isolate()); | 4485 ExternalReference::debug_is_active_address(isolate()); |
| 4499 __ li(at, Operand(debug_is_active)); | 4486 __ li(at, Operand(debug_is_active)); |
| 4500 __ lbu(v0, MemOperand(at)); | 4487 __ lbu(v0, MemOperand(at)); |
| 4501 __ SmiTag(v0); | 4488 __ SmiTag(v0); |
| 4502 context()->Plug(v0); | 4489 context()->Plug(v0); |
| 4503 } | 4490 } |
| 4504 | 4491 |
| 4505 | 4492 |
| 4493 void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
| 4494 ZoneList<Expression*>* args = expr->arguments(); |
| 4495 DCHECK_EQ(2, args->length()); |
| 4496 VisitForStackValue(args->at(0)); |
| 4497 VisitForStackValue(args->at(1)); |
| 4498 |
| 4499 Label runtime, done; |
| 4500 |
| 4501 __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); |
| 4502 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| 4503 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); |
| 4504 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
| 4505 __ pop(a3); |
| 4506 __ pop(a2); |
| 4507 __ li(t0, Operand(isolate()->factory()->empty_fixed_array())); |
| 4508 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
| 4509 __ sd(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 4510 __ sd(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 4511 __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
| 4512 __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
| 4513 STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
| 4514 __ jmp(&done); |
| 4515 |
| 4516 __ bind(&runtime); |
| 4517 __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
| 4518 |
| 4519 __ bind(&done); |
| 4520 context()->Plug(v0); |
| 4521 } |
| 4522 |
| 4523 |
| 4506 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { | 4524 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
| 4507 // Push undefined as the receiver. | 4525 // Push undefined as the receiver. |
| 4508 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 4526 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
| 4509 __ push(v0); | 4527 __ push(v0); |
| 4510 | 4528 |
| 4511 __ ld(v0, GlobalObjectOperand()); | 4529 __ ld(v0, GlobalObjectOperand()); |
| 4512 __ ld(v0, FieldMemOperand(v0, GlobalObject::kNativeContextOffset)); | 4530 __ ld(v0, FieldMemOperand(v0, GlobalObject::kNativeContextOffset)); |
| 4513 __ ld(v0, ContextOperand(v0, expr->context_index())); | 4531 __ ld(v0, ContextOperand(v0, expr->context_index())); |
| 4514 } | 4532 } |
| 4515 | 4533 |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5328 reinterpret_cast<uint64_t>( | 5346 reinterpret_cast<uint64_t>( |
| 5329 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5347 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5330 return OSR_AFTER_STACK_CHECK; | 5348 return OSR_AFTER_STACK_CHECK; |
| 5331 } | 5349 } |
| 5332 | 5350 |
| 5333 | 5351 |
| 5334 } // namespace internal | 5352 } // namespace internal |
| 5335 } // namespace v8 | 5353 } // namespace v8 |
| 5336 | 5354 |
| 5337 #endif // V8_TARGET_ARCH_MIPS64 | 5355 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |