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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 __ b(done); | 1349 __ b(done); |
1350 } | 1350 } |
1351 } | 1351 } |
1352 | 1352 |
1353 | 1353 |
1354 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 1354 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
1355 TypeofMode typeof_mode) { | 1355 TypeofMode typeof_mode) { |
1356 Variable* var = proxy->var(); | 1356 Variable* var = proxy->var(); |
1357 DCHECK(var->IsUnallocatedOrGlobalSlot() || | 1357 DCHECK(var->IsUnallocatedOrGlobalSlot() || |
1358 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 1358 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
1359 if (var->IsGlobalSlot()) { | 1359 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1360 DCHECK(var->index() > 0); | 1360 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
1361 DCHECK(var->IsStaticGlobalObjectProperty()); | 1361 __ mov(LoadDescriptor::SlotRegister(), |
1362 const int slot = var->index(); | 1362 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1363 const int depth = scope()->ContextChainLength(var->scope()); | 1363 CallLoadIC(typeof_mode); |
1364 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | |
1365 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
1366 LoadGlobalViaContextStub stub(isolate(), depth); | |
1367 __ CallStub(&stub); | |
1368 } else { | |
1369 __ Push(Smi::FromInt(slot)); | |
1370 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
1371 } | |
1372 } else { | |
1373 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | |
1374 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); | |
1375 __ mov(LoadDescriptor::SlotRegister(), | |
1376 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); | |
1377 CallLoadIC(typeof_mode); | |
1378 } | |
1379 } | 1364 } |
1380 | 1365 |
1381 | 1366 |
1382 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1367 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
1383 TypeofMode typeof_mode) { | 1368 TypeofMode typeof_mode) { |
1384 // Record position before possible IC call. | 1369 // Record position before possible IC call. |
1385 SetExpressionPosition(proxy); | 1370 SetExpressionPosition(proxy); |
1386 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); | 1371 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
1387 Variable* var = proxy->var(); | 1372 Variable* var = proxy->var(); |
1388 | 1373 |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 | 2593 |
2609 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2594 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
2610 FeedbackVectorSlot slot) { | 2595 FeedbackVectorSlot slot) { |
2611 if (var->IsUnallocated()) { | 2596 if (var->IsUnallocated()) { |
2612 // Global var, const, or let. | 2597 // Global var, const, or let. |
2613 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2598 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
2614 __ LoadP(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2599 __ LoadP(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
2615 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2600 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
2616 CallStoreIC(); | 2601 CallStoreIC(); |
2617 | 2602 |
2618 } else if (var->IsGlobalSlot()) { | |
2619 // Global var, const, or let. | |
2620 DCHECK(var->index() > 0); | |
2621 DCHECK(var->IsStaticGlobalObjectProperty()); | |
2622 const int slot = var->index(); | |
2623 const int depth = scope()->ContextChainLength(var->scope()); | |
2624 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | |
2625 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | |
2626 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r3)); | |
2627 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); | |
2628 __ CallStub(&stub); | |
2629 } else { | |
2630 __ Push(Smi::FromInt(slot)); | |
2631 __ push(r3); | |
2632 __ CallRuntime(is_strict(language_mode()) | |
2633 ? Runtime::kStoreGlobalViaContext_Strict | |
2634 : Runtime::kStoreGlobalViaContext_Sloppy, | |
2635 2); | |
2636 } | |
2637 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2603 } else if (var->mode() == LET && op != Token::INIT_LET) { |
2638 // Non-initializing assignment to let variable needs a write barrier. | 2604 // Non-initializing assignment to let variable needs a write barrier. |
2639 DCHECK(!var->IsLookupSlot()); | 2605 DCHECK(!var->IsLookupSlot()); |
2640 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2606 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2641 Label assign; | 2607 Label assign; |
2642 MemOperand location = VarOperand(var, r4); | 2608 MemOperand location = VarOperand(var, r4); |
2643 __ LoadP(r6, location); | 2609 __ LoadP(r6, location); |
2644 __ CompareRoot(r6, Heap::kTheHoleValueRootIndex); | 2610 __ CompareRoot(r6, Heap::kTheHoleValueRootIndex); |
2645 __ bne(&assign); | 2611 __ bne(&assign); |
2646 __ mov(r6, Operand(var->name())); | 2612 __ mov(r6, Operand(var->name())); |
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5176 return ON_STACK_REPLACEMENT; | 5142 return ON_STACK_REPLACEMENT; |
5177 } | 5143 } |
5178 | 5144 |
5179 DCHECK(interrupt_address == | 5145 DCHECK(interrupt_address == |
5180 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5146 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5181 return OSR_AFTER_STACK_CHECK; | 5147 return OSR_AFTER_STACK_CHECK; |
5182 } | 5148 } |
5183 } // namespace internal | 5149 } // namespace internal |
5184 } // namespace v8 | 5150 } // namespace v8 |
5185 #endif // V8_TARGET_ARCH_PPC | 5151 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |