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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 case VariableLocation::LOOKUP: { | 763 case VariableLocation::LOOKUP: { |
764 Comment cmnt(masm_, "[ VariableDeclaration"); | 764 Comment cmnt(masm_, "[ VariableDeclaration"); |
765 DCHECK_EQ(VAR, mode); | 765 DCHECK_EQ(VAR, mode); |
766 DCHECK(!hole_init); | 766 DCHECK(!hole_init); |
767 __ mov(r5, Operand(variable->name())); | 767 __ mov(r5, Operand(variable->name())); |
768 __ Push(r5); | 768 __ Push(r5); |
769 __ CallRuntime(Runtime::kDeclareEvalVar); | 769 __ CallRuntime(Runtime::kDeclareEvalVar); |
770 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 770 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
771 break; | 771 break; |
772 } | 772 } |
| 773 |
| 774 case VariableLocation::MODULE: |
| 775 UNREACHABLE(); |
773 } | 776 } |
774 } | 777 } |
775 | 778 |
776 | 779 |
777 void FullCodeGenerator::VisitFunctionDeclaration( | 780 void FullCodeGenerator::VisitFunctionDeclaration( |
778 FunctionDeclaration* declaration) { | 781 FunctionDeclaration* declaration) { |
779 VariableProxy* proxy = declaration->proxy(); | 782 VariableProxy* proxy = declaration->proxy(); |
780 Variable* variable = proxy->var(); | 783 Variable* variable = proxy->var(); |
781 switch (variable->location()) { | 784 switch (variable->location()) { |
782 case VariableLocation::GLOBAL: | 785 case VariableLocation::GLOBAL: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 case VariableLocation::LOOKUP: { | 821 case VariableLocation::LOOKUP: { |
819 Comment cmnt(masm_, "[ FunctionDeclaration"); | 822 Comment cmnt(masm_, "[ FunctionDeclaration"); |
820 __ mov(r5, Operand(variable->name())); | 823 __ mov(r5, Operand(variable->name())); |
821 PushOperand(r5); | 824 PushOperand(r5); |
822 // Push initial value for function declaration. | 825 // Push initial value for function declaration. |
823 VisitForStackValue(declaration->fun()); | 826 VisitForStackValue(declaration->fun()); |
824 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 827 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
825 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 828 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
826 break; | 829 break; |
827 } | 830 } |
| 831 |
| 832 case VariableLocation::MODULE: |
| 833 UNREACHABLE(); |
828 } | 834 } |
829 } | 835 } |
830 | 836 |
831 | 837 |
832 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 838 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
833 // Call the runtime to declare the globals. | 839 // Call the runtime to declare the globals. |
834 __ mov(r4, Operand(pairs)); | 840 __ mov(r4, Operand(pairs)); |
835 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); | 841 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); |
836 __ EmitLoadTypeFeedbackVector(r5); | 842 __ EmitLoadTypeFeedbackVector(r5); |
837 __ Push(r4, r3, r5); | 843 __ Push(r4, r3, r5); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1320 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
1315 __ bind(&slow); | 1321 __ bind(&slow); |
1316 __ Push(var->name()); | 1322 __ Push(var->name()); |
1317 Runtime::FunctionId function_id = | 1323 Runtime::FunctionId function_id = |
1318 typeof_mode == NOT_INSIDE_TYPEOF | 1324 typeof_mode == NOT_INSIDE_TYPEOF |
1319 ? Runtime::kLoadLookupSlot | 1325 ? Runtime::kLoadLookupSlot |
1320 : Runtime::kLoadLookupSlotInsideTypeof; | 1326 : Runtime::kLoadLookupSlotInsideTypeof; |
1321 __ CallRuntime(function_id); | 1327 __ CallRuntime(function_id); |
1322 __ bind(&done); | 1328 __ bind(&done); |
1323 context()->Plug(r3); | 1329 context()->Plug(r3); |
| 1330 break; |
1324 } | 1331 } |
| 1332 |
| 1333 case VariableLocation::MODULE: |
| 1334 UNREACHABLE(); |
1325 } | 1335 } |
1326 } | 1336 } |
1327 | 1337 |
1328 | 1338 |
1329 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1339 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1330 Expression* expression = (property == NULL) ? NULL : property->value(); | 1340 Expression* expression = (property == NULL) ? NULL : property->value(); |
1331 if (expression == NULL) { | 1341 if (expression == NULL) { |
1332 __ LoadRoot(r4, Heap::kNullValueRootIndex); | 1342 __ LoadRoot(r4, Heap::kNullValueRootIndex); |
1333 PushOperand(r4); | 1343 PushOperand(r4); |
1334 } else { | 1344 } else { |
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3767 | 3777 |
3768 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3778 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3769 | 3779 |
3770 DCHECK(interrupt_address == | 3780 DCHECK(interrupt_address == |
3771 isolate->builtins()->OnStackReplacement()->entry()); | 3781 isolate->builtins()->OnStackReplacement()->entry()); |
3772 return ON_STACK_REPLACEMENT; | 3782 return ON_STACK_REPLACEMENT; |
3773 } | 3783 } |
3774 } // namespace internal | 3784 } // namespace internal |
3775 } // namespace v8 | 3785 } // namespace v8 |
3776 #endif // V8_TARGET_ARCH_PPC | 3786 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |