| 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 __ Branch(done); | 1377 __ Branch(done); |
| 1378 } | 1378 } |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 | 1381 |
| 1382 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 1382 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
| 1383 TypeofMode typeof_mode) { | 1383 TypeofMode typeof_mode) { |
| 1384 Variable* var = proxy->var(); | 1384 Variable* var = proxy->var(); |
| 1385 DCHECK(var->IsUnallocatedOrGlobalSlot() || | 1385 DCHECK(var->IsUnallocatedOrGlobalSlot() || |
| 1386 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 1386 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
| 1387 if (var->IsGlobalSlot()) { | 1387 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 1388 DCHECK(var->index() > 0); | 1388 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); |
| 1389 DCHECK(var->IsStaticGlobalObjectProperty()); | 1389 __ li(LoadDescriptor::SlotRegister(), |
| 1390 int const slot = var->index(); | 1390 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
| 1391 int const depth = scope()->ContextChainLength(var->scope()); | 1391 CallLoadIC(typeof_mode); |
| 1392 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | |
| 1393 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
| 1394 LoadGlobalViaContextStub stub(isolate(), depth); | |
| 1395 __ CallStub(&stub); | |
| 1396 } else { | |
| 1397 __ Push(Smi::FromInt(slot)); | |
| 1398 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
| 1399 } | |
| 1400 | |
| 1401 } else { | |
| 1402 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | |
| 1403 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); | |
| 1404 __ li(LoadDescriptor::SlotRegister(), | |
| 1405 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); | |
| 1406 CallLoadIC(typeof_mode); | |
| 1407 } | |
| 1408 } | 1392 } |
| 1409 | 1393 |
| 1410 | 1394 |
| 1411 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1395 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1412 TypeofMode typeof_mode) { | 1396 TypeofMode typeof_mode) { |
| 1413 // Record position before possible IC call. | 1397 // Record position before possible IC call. |
| 1414 SetExpressionPosition(proxy); | 1398 SetExpressionPosition(proxy); |
| 1415 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); | 1399 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
| 1416 Variable* var = proxy->var(); | 1400 Variable* var = proxy->var(); |
| 1417 | 1401 |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2599 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2583 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
| 2600 FeedbackVectorSlot slot) { | 2584 FeedbackVectorSlot slot) { |
| 2601 if (var->IsUnallocated()) { | 2585 if (var->IsUnallocated()) { |
| 2602 // Global var, const, or let. | 2586 // Global var, const, or let. |
| 2603 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 2587 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
| 2604 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); | 2588 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); |
| 2605 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2589 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 2606 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2590 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 2607 CallStoreIC(); | 2591 CallStoreIC(); |
| 2608 | 2592 |
| 2609 } else if (var->IsGlobalSlot()) { | |
| 2610 // Global var, const, or let. | |
| 2611 DCHECK(var->index() > 0); | |
| 2612 DCHECK(var->IsStaticGlobalObjectProperty()); | |
| 2613 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(a0)); | |
| 2614 __ mov(StoreGlobalViaContextDescriptor::ValueRegister(), result_register()); | |
| 2615 int const slot = var->index(); | |
| 2616 int const depth = scope()->ContextChainLength(var->scope()); | |
| 2617 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | |
| 2618 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
| 2619 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); | |
| 2620 __ CallStub(&stub); | |
| 2621 } else { | |
| 2622 __ Push(Smi::FromInt(slot)); | |
| 2623 __ Push(a0); | |
| 2624 __ CallRuntime(is_strict(language_mode()) | |
| 2625 ? Runtime::kStoreGlobalViaContext_Strict | |
| 2626 : Runtime::kStoreGlobalViaContext_Sloppy, | |
| 2627 2); | |
| 2628 } | |
| 2629 | |
| 2630 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2593 } else if (var->mode() == LET && op != Token::INIT_LET) { |
| 2631 // Non-initializing assignment to let variable needs a write barrier. | 2594 // Non-initializing assignment to let variable needs a write barrier. |
| 2632 DCHECK(!var->IsLookupSlot()); | 2595 DCHECK(!var->IsLookupSlot()); |
| 2633 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2596 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2634 Label assign; | 2597 Label assign; |
| 2635 MemOperand location = VarOperand(var, a1); | 2598 MemOperand location = VarOperand(var, a1); |
| 2636 __ ld(a3, location); | 2599 __ ld(a3, location); |
| 2637 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); | 2600 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); |
| 2638 __ Branch(&assign, ne, a3, Operand(a4)); | 2601 __ Branch(&assign, ne, a3, Operand(a4)); |
| 2639 __ li(a3, Operand(var->name())); | 2602 __ li(a3, Operand(var->name())); |
| (...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5196 reinterpret_cast<uint64_t>( | 5159 reinterpret_cast<uint64_t>( |
| 5197 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5160 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5198 return OSR_AFTER_STACK_CHECK; | 5161 return OSR_AFTER_STACK_CHECK; |
| 5199 } | 5162 } |
| 5200 | 5163 |
| 5201 | 5164 |
| 5202 } // namespace internal | 5165 } // namespace internal |
| 5203 } // namespace v8 | 5166 } // namespace v8 |
| 5204 | 5167 |
| 5205 #endif // V8_TARGET_ARCH_MIPS64 | 5168 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |