| 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 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 __ mr(r6, result_register()); | 2739 __ mr(r6, result_register()); |
| 2740 int offset = Context::SlotOffset(var->index()); | 2740 int offset = Context::SlotOffset(var->index()); |
| 2741 __ RecordWriteContextSlot(r4, offset, r6, r5, kLRHasBeenSaved, | 2741 __ RecordWriteContextSlot(r4, offset, r6, r5, kLRHasBeenSaved, |
| 2742 kDontSaveFPRegs); | 2742 kDontSaveFPRegs); |
| 2743 } | 2743 } |
| 2744 } | 2744 } |
| 2745 | 2745 |
| 2746 | 2746 |
| 2747 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2747 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
| 2748 FeedbackVectorICSlot slot) { | 2748 FeedbackVectorICSlot slot) { |
| 2749 if (var->IsUnallocated()) { | 2749 if (var->IsUnallocatedOrGlobalSlot()) { |
| 2750 // Global var, const, or let. | 2750 // Global var, const, or let. |
| 2751 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2751 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
| 2752 __ LoadP(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2752 __ LoadP(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 2753 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2753 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 2754 CallStoreIC(); | 2754 CallStoreIC(); |
| 2755 | 2755 |
| 2756 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2756 } else if (var->mode() == LET && op != Token::INIT_LET) { |
| 2757 // Non-initializing assignment to let variable needs a write barrier. | 2757 // Non-initializing assignment to let variable needs a write barrier. |
| 2758 DCHECK(!var->IsLookupSlot()); | 2758 DCHECK(!var->IsLookupSlot()); |
| 2759 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2759 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| (...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4839 __ LoadSmiLiteral(r4, Smi::FromInt(language_mode())); | 4839 __ LoadSmiLiteral(r4, Smi::FromInt(language_mode())); |
| 4840 __ push(r4); | 4840 __ push(r4); |
| 4841 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4841 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 4842 context()->Plug(r3); | 4842 context()->Plug(r3); |
| 4843 } else if (proxy != NULL) { | 4843 } else if (proxy != NULL) { |
| 4844 Variable* var = proxy->var(); | 4844 Variable* var = proxy->var(); |
| 4845 // Delete of an unqualified identifier is disallowed in strict mode but | 4845 // Delete of an unqualified identifier is disallowed in strict mode but |
| 4846 // "delete this" is allowed. | 4846 // "delete this" is allowed. |
| 4847 bool is_this = var->HasThisName(isolate()); | 4847 bool is_this = var->HasThisName(isolate()); |
| 4848 DCHECK(is_sloppy(language_mode()) || is_this); | 4848 DCHECK(is_sloppy(language_mode()) || is_this); |
| 4849 if (var->IsUnallocated()) { | 4849 if (var->IsUnallocatedOrGlobalSlot()) { |
| 4850 __ LoadP(r5, GlobalObjectOperand()); | 4850 __ LoadP(r5, GlobalObjectOperand()); |
| 4851 __ mov(r4, Operand(var->name())); | 4851 __ mov(r4, Operand(var->name())); |
| 4852 __ LoadSmiLiteral(r3, Smi::FromInt(SLOPPY)); | 4852 __ LoadSmiLiteral(r3, Smi::FromInt(SLOPPY)); |
| 4853 __ Push(r5, r4, r3); | 4853 __ Push(r5, r4, r3); |
| 4854 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4854 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 4855 context()->Plug(r3); | 4855 context()->Plug(r3); |
| 4856 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4856 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
| 4857 // Result of deleting non-global, non-dynamic variables is false. | 4857 // Result of deleting non-global, non-dynamic variables is false. |
| 4858 // The subexpression does not have side effects. | 4858 // The subexpression does not have side effects. |
| 4859 context()->Plug(is_this); | 4859 context()->Plug(is_this); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5195 break; | 5195 break; |
| 5196 } | 5196 } |
| 5197 } | 5197 } |
| 5198 } | 5198 } |
| 5199 | 5199 |
| 5200 | 5200 |
| 5201 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 5201 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
| 5202 DCHECK(!context()->IsEffect()); | 5202 DCHECK(!context()->IsEffect()); |
| 5203 DCHECK(!context()->IsTest()); | 5203 DCHECK(!context()->IsTest()); |
| 5204 VariableProxy* proxy = expr->AsVariableProxy(); | 5204 VariableProxy* proxy = expr->AsVariableProxy(); |
| 5205 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 5205 if (proxy != NULL && proxy->var()->IsUnallocatedOrGlobalSlot()) { |
| 5206 Comment cmnt(masm_, "[ Global variable"); | 5206 Comment cmnt(masm_, "[ Global variable"); |
| 5207 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 5207 __ LoadP(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 5208 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); | 5208 __ mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
| 5209 __ mov(LoadDescriptor::SlotRegister(), | 5209 __ mov(LoadDescriptor::SlotRegister(), |
| 5210 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); | 5210 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
| 5211 // Use a regular load, not a contextual load, to avoid a reference | 5211 // Use a regular load, not a contextual load, to avoid a reference |
| 5212 // error. | 5212 // error. |
| 5213 CallLoadIC(NOT_CONTEXTUAL); | 5213 CallLoadIC(NOT_CONTEXTUAL); |
| 5214 PrepareForBailout(expr, TOS_REG); | 5214 PrepareForBailout(expr, TOS_REG); |
| 5215 context()->Plug(r3); | 5215 context()->Plug(r3); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5595 return ON_STACK_REPLACEMENT; | 5595 return ON_STACK_REPLACEMENT; |
| 5596 } | 5596 } |
| 5597 | 5597 |
| 5598 DCHECK(interrupt_address == | 5598 DCHECK(interrupt_address == |
| 5599 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5599 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5600 return OSR_AFTER_STACK_CHECK; | 5600 return OSR_AFTER_STACK_CHECK; |
| 5601 } | 5601 } |
| 5602 } // namespace internal | 5602 } // namespace internal |
| 5603 } // namespace v8 | 5603 } // namespace v8 |
| 5604 #endif // V8_TARGET_ARCH_PPC | 5604 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |