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 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 | 2503 |
2504 CallConstructStub stub(isolate()); | 2504 CallConstructStub stub(isolate()); |
2505 CallIC(stub.GetCode()); | 2505 CallIC(stub.GetCode()); |
2506 OperandStackDepthDecrement(arg_count + 1); | 2506 OperandStackDepthDecrement(arg_count + 1); |
2507 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2507 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
2508 RestoreContext(); | 2508 RestoreContext(); |
2509 context()->Plug(v0); | 2509 context()->Plug(v0); |
2510 } | 2510 } |
2511 | 2511 |
2512 | 2512 |
2513 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
2514 SuperCallReference* super_call_ref = | |
2515 expr->expression()->AsSuperCallReference(); | |
2516 DCHECK_NOT_NULL(super_call_ref); | |
2517 | |
2518 // Push the super constructor target on the stack (may be null, | |
2519 // but the Construct builtin can deal with that properly). | |
2520 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
2521 __ AssertFunction(result_register()); | |
2522 __ lw(result_register(), | |
2523 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
2524 __ lw(result_register(), | |
2525 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
2526 PushOperand(result_register()); | |
2527 | |
2528 // Push the arguments ("left-to-right") on the stack. | |
2529 ZoneList<Expression*>* args = expr->arguments(); | |
2530 int arg_count = args->length(); | |
2531 for (int i = 0; i < arg_count; i++) { | |
2532 VisitForStackValue(args->at(i)); | |
2533 } | |
2534 | |
2535 // Call the construct call builtin that handles allocation and | |
2536 // constructor invocation. | |
2537 SetConstructCallPosition(expr); | |
2538 | |
2539 // Load new target into a3. | |
2540 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
2541 __ mov(a3, result_register()); | |
2542 | |
2543 // Load function and argument count into a1 and a0. | |
2544 __ li(a0, Operand(arg_count)); | |
2545 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); | |
2546 | |
2547 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
2548 OperandStackDepthDecrement(arg_count + 1); | |
2549 | |
2550 RecordJSReturnSite(expr); | |
2551 RestoreContext(); | |
2552 context()->Plug(v0); | |
2553 } | |
2554 | |
2555 | |
2556 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2513 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
2557 ZoneList<Expression*>* args = expr->arguments(); | 2514 ZoneList<Expression*>* args = expr->arguments(); |
2558 DCHECK(args->length() == 1); | 2515 DCHECK(args->length() == 1); |
2559 | 2516 |
2560 VisitForAccumulatorValue(args->at(0)); | 2517 VisitForAccumulatorValue(args->at(0)); |
2561 | 2518 |
2562 Label materialize_true, materialize_false; | 2519 Label materialize_true, materialize_false; |
2563 Label* if_true = NULL; | 2520 Label* if_true = NULL; |
2564 Label* if_false = NULL; | 2521 Label* if_false = NULL; |
2565 Label* fall_through = NULL; | 2522 Label* fall_through = NULL; |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3594 reinterpret_cast<uint32_t>( | 3551 reinterpret_cast<uint32_t>( |
3595 isolate->builtins()->OnStackReplacement()->entry())); | 3552 isolate->builtins()->OnStackReplacement()->entry())); |
3596 return ON_STACK_REPLACEMENT; | 3553 return ON_STACK_REPLACEMENT; |
3597 } | 3554 } |
3598 | 3555 |
3599 | 3556 |
3600 } // namespace internal | 3557 } // namespace internal |
3601 } // namespace v8 | 3558 } // namespace v8 |
3602 | 3559 |
3603 #endif // V8_TARGET_ARCH_MIPS | 3560 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |