| 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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 break; | 1423 break; |
| 1424 } | 1424 } |
| 1425 | 1425 |
| 1426 case VariableLocation::LOOKUP: { | 1426 case VariableLocation::LOOKUP: { |
| 1427 Comment cmnt(masm_, "[ Lookup variable"); | 1427 Comment cmnt(masm_, "[ Lookup variable"); |
| 1428 Label done, slow; | 1428 Label done, slow; |
| 1429 // Generate code for loading from variables potentially shadowed | 1429 // Generate code for loading from variables potentially shadowed |
| 1430 // by eval-introduced variables. | 1430 // by eval-introduced variables. |
| 1431 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1431 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
| 1432 __ bind(&slow); | 1432 __ bind(&slow); |
| 1433 __ li(a1, Operand(var->name())); | 1433 __ Push(var->name()); |
| 1434 __ Push(cp, a1); // Context and name. | |
| 1435 Runtime::FunctionId function_id = | 1434 Runtime::FunctionId function_id = |
| 1436 typeof_mode == NOT_INSIDE_TYPEOF | 1435 typeof_mode == NOT_INSIDE_TYPEOF |
| 1437 ? Runtime::kLoadLookupSlot | 1436 ? Runtime::kLoadLookupSlot |
| 1438 : Runtime::kLoadLookupSlotNoReferenceError; | 1437 : Runtime::kLoadLookupSlotInsideTypeof; |
| 1439 __ CallRuntime(function_id); | 1438 __ CallRuntime(function_id); |
| 1440 __ bind(&done); | 1439 __ bind(&done); |
| 1441 context()->Plug(v0); | 1440 context()->Plug(v0); |
| 1442 } | 1441 } |
| 1443 } | 1442 } |
| 1444 } | 1443 } |
| 1445 | 1444 |
| 1446 | 1445 |
| 1447 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { | 1446 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
| 1448 Comment cmnt(masm_, "[ RegExpLiteral"); | 1447 Comment cmnt(masm_, "[ RegExpLiteral"); |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2434 __ li(a0, Operand(var->name())); | 2433 __ li(a0, Operand(var->name())); |
| 2435 __ Push(a0); | 2434 __ Push(a0); |
| 2436 __ CallRuntime(Runtime::kThrowReferenceError); | 2435 __ CallRuntime(Runtime::kThrowReferenceError); |
| 2437 __ bind(&uninitialized_this); | 2436 __ bind(&uninitialized_this); |
| 2438 EmitStoreToStackLocalOrContextSlot(var, location); | 2437 EmitStoreToStackLocalOrContextSlot(var, location); |
| 2439 | 2438 |
| 2440 } else if (!var->is_const_mode() || | 2439 } else if (!var->is_const_mode() || |
| 2441 (var->mode() == CONST && op == Token::INIT)) { | 2440 (var->mode() == CONST && op == Token::INIT)) { |
| 2442 if (var->IsLookupSlot()) { | 2441 if (var->IsLookupSlot()) { |
| 2443 // Assignment to var. | 2442 // Assignment to var. |
| 2444 __ li(a1, Operand(var->name())); | 2443 __ Push(var->name()); |
| 2445 __ li(a0, Operand(Smi::FromInt(language_mode()))); | 2444 __ Push(v0); |
| 2446 __ Push(v0, cp, a1, a0); // Value, context, name, language mode. | 2445 __ CallRuntime(is_strict(language_mode()) |
| 2447 __ CallRuntime(Runtime::kStoreLookupSlot); | 2446 ? Runtime::kStoreLookupSlot_Strict |
| 2447 : Runtime::kStoreLookupSlot_Sloppy); |
| 2448 } else { | 2448 } else { |
| 2449 // Assignment to var or initializing assignment to let/const in harmony | 2449 // Assignment to var or initializing assignment to let/const in harmony |
| 2450 // mode. | 2450 // mode. |
| 2451 DCHECK((var->IsStackAllocated() || var->IsContextSlot())); | 2451 DCHECK((var->IsStackAllocated() || var->IsContextSlot())); |
| 2452 MemOperand location = VarOperand(var, a1); | 2452 MemOperand location = VarOperand(var, a1); |
| 2453 if (generate_debug_code_ && var->mode() == LET && op == Token::INIT) { | 2453 if (generate_debug_code_ && var->mode() == LET && op == Token::INIT) { |
| 2454 // Check for an uninitialized let binding. | 2454 // Check for an uninitialized let binding. |
| 2455 __ lw(a2, location); | 2455 __ lw(a2, location); |
| 2456 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); | 2456 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); |
| 2457 __ Check(eq, kLetBindingReInitialization, a2, Operand(t0)); | 2457 __ Check(eq, kLetBindingReInitialization, a2, Operand(t0)); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2787 Label slow, done; | 2787 Label slow, done; |
| 2788 | 2788 |
| 2789 SetExpressionPosition(callee); | 2789 SetExpressionPosition(callee); |
| 2790 // Generate code for loading from variables potentially shadowed by | 2790 // Generate code for loading from variables potentially shadowed by |
| 2791 // eval-introduced variables. | 2791 // eval-introduced variables. |
| 2792 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); | 2792 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); |
| 2793 | 2793 |
| 2794 __ bind(&slow); | 2794 __ bind(&slow); |
| 2795 // Call the runtime to find the function to call (returned in v0) | 2795 // Call the runtime to find the function to call (returned in v0) |
| 2796 // and the object holding it (returned in v1). | 2796 // and the object holding it (returned in v1). |
| 2797 DCHECK(!context_register().is(a2)); | 2797 __ Push(callee->name()); |
| 2798 __ li(a2, Operand(callee->name())); | 2798 __ CallRuntime(Runtime::kLoadLookupSlotForCall); |
| 2799 __ Push(context_register(), a2); | |
| 2800 __ CallRuntime(Runtime::kLoadLookupSlot); | |
| 2801 __ Push(v0, v1); // Function, receiver. | 2799 __ Push(v0, v1); // Function, receiver. |
| 2802 PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); | 2800 PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); |
| 2803 | 2801 |
| 2804 // If fast case code has been generated, emit code to push the | 2802 // If fast case code has been generated, emit code to push the |
| 2805 // function and receiver and have the slow path jump around this | 2803 // function and receiver and have the slow path jump around this |
| 2806 // code. | 2804 // code. |
| 2807 if (done.is_linked()) { | 2805 if (done.is_linked()) { |
| 2808 Label call; | 2806 Label call; |
| 2809 __ Branch(&call); | 2807 __ Branch(&call); |
| 2810 __ bind(&done); | 2808 __ bind(&done); |
| (...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4638 reinterpret_cast<uint32_t>( | 4636 reinterpret_cast<uint32_t>( |
| 4639 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4637 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4640 return OSR_AFTER_STACK_CHECK; | 4638 return OSR_AFTER_STACK_CHECK; |
| 4641 } | 4639 } |
| 4642 | 4640 |
| 4643 | 4641 |
| 4644 } // namespace internal | 4642 } // namespace internal |
| 4645 } // namespace v8 | 4643 } // namespace v8 |
| 4646 | 4644 |
| 4647 #endif // V8_TARGET_ARCH_MIPS | 4645 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |