OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 Variable* var = proxy->var(); | 1374 Variable* var = proxy->var(); |
1375 DCHECK(var->IsUnallocatedOrGlobalSlot() || | 1375 DCHECK(var->IsUnallocatedOrGlobalSlot() || |
1376 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 1376 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
1377 if (var->IsGlobalSlot()) { | 1377 if (var->IsGlobalSlot()) { |
1378 DCHECK(var->index() > 0); | 1378 DCHECK(var->index() > 0); |
1379 DCHECK(var->IsStaticGlobalObjectProperty()); | 1379 DCHECK(var->IsStaticGlobalObjectProperty()); |
1380 const int slot = var->index(); | 1380 const int slot = var->index(); |
1381 const int depth = scope()->ContextChainLength(var->scope()); | 1381 const int depth = scope()->ContextChainLength(var->scope()); |
1382 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 1382 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { |
1383 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 1383 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
1384 __ mov(LoadGlobalViaContextDescriptor::NameRegister(), | |
1385 Operand(var->name())); | |
1386 LoadGlobalViaContextStub stub(isolate(), depth); | 1384 LoadGlobalViaContextStub stub(isolate(), depth); |
1387 __ CallStub(&stub); | 1385 __ CallStub(&stub); |
1388 } else { | 1386 } else { |
1389 __ Push(Smi::FromInt(slot)); | 1387 __ Push(Smi::FromInt(slot)); |
1390 __ Push(var->name()); | 1388 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); |
1391 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2); | |
1392 } | 1389 } |
1393 } else { | 1390 } else { |
1394 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1391 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1395 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); | 1392 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
1396 __ mov(LoadDescriptor::SlotRegister(), | 1393 __ mov(LoadDescriptor::SlotRegister(), |
1397 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); | 1394 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1398 CallLoadIC(typeof_mode); | 1395 CallLoadIC(typeof_mode); |
1399 } | 1396 } |
1400 } | 1397 } |
1401 | 1398 |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 CallStoreIC(); | 2708 CallStoreIC(); |
2712 | 2709 |
2713 } else if (var->IsGlobalSlot()) { | 2710 } else if (var->IsGlobalSlot()) { |
2714 // Global var, const, or let. | 2711 // Global var, const, or let. |
2715 DCHECK(var->index() > 0); | 2712 DCHECK(var->index() > 0); |
2716 DCHECK(var->IsStaticGlobalObjectProperty()); | 2713 DCHECK(var->IsStaticGlobalObjectProperty()); |
2717 const int slot = var->index(); | 2714 const int slot = var->index(); |
2718 const int depth = scope()->ContextChainLength(var->scope()); | 2715 const int depth = scope()->ContextChainLength(var->scope()); |
2719 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 2716 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { |
2720 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 2717 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
2721 __ mov(StoreGlobalViaContextDescriptor::NameRegister(), | |
2722 Operand(var->name())); | |
2723 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r3)); | 2718 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r3)); |
2724 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); | 2719 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); |
2725 __ CallStub(&stub); | 2720 __ CallStub(&stub); |
2726 } else { | 2721 } else { |
2727 __ Push(Smi::FromInt(slot)); | 2722 __ Push(Smi::FromInt(slot)); |
2728 __ Push(var->name()); | |
2729 __ push(r3); | 2723 __ push(r3); |
2730 __ CallRuntime(is_strict(language_mode()) | 2724 __ CallRuntime(is_strict(language_mode()) |
2731 ? Runtime::kStoreGlobalViaContext_Strict | 2725 ? Runtime::kStoreGlobalViaContext_Strict |
2732 : Runtime::kStoreGlobalViaContext_Sloppy, | 2726 : Runtime::kStoreGlobalViaContext_Sloppy, |
2733 3); | 2727 2); |
2734 } | 2728 } |
2735 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2729 } else if (var->mode() == LET && op != Token::INIT_LET) { |
2736 // Non-initializing assignment to let variable needs a write barrier. | 2730 // Non-initializing assignment to let variable needs a write barrier. |
2737 DCHECK(!var->IsLookupSlot()); | 2731 DCHECK(!var->IsLookupSlot()); |
2738 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2732 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2739 Label assign; | 2733 Label assign; |
2740 MemOperand location = VarOperand(var, r4); | 2734 MemOperand location = VarOperand(var, r4); |
2741 __ LoadP(r6, location); | 2735 __ LoadP(r6, location); |
2742 __ CompareRoot(r6, Heap::kTheHoleValueRootIndex); | 2736 __ CompareRoot(r6, Heap::kTheHoleValueRootIndex); |
2743 __ bne(&assign); | 2737 __ bne(&assign); |
(...skipping 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 return ON_STACK_REPLACEMENT; | 5417 return ON_STACK_REPLACEMENT; |
5424 } | 5418 } |
5425 | 5419 |
5426 DCHECK(interrupt_address == | 5420 DCHECK(interrupt_address == |
5427 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5421 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5428 return OSR_AFTER_STACK_CHECK; | 5422 return OSR_AFTER_STACK_CHECK; |
5429 } | 5423 } |
5430 } // namespace internal | 5424 } // namespace internal |
5431 } // namespace v8 | 5425 } // namespace v8 |
5432 #endif // V8_TARGET_ARCH_PPC | 5426 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |