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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 case VariableLocation::LOOKUP: { | 800 case VariableLocation::LOOKUP: { |
801 Comment cmnt(masm_, "[ VariableDeclaration"); | 801 Comment cmnt(masm_, "[ VariableDeclaration"); |
802 DCHECK_EQ(VAR, mode); | 802 DCHECK_EQ(VAR, mode); |
803 DCHECK(!hole_init); | 803 DCHECK(!hole_init); |
804 __ mov(r2, Operand(variable->name())); | 804 __ mov(r2, Operand(variable->name())); |
805 __ Push(r2); | 805 __ Push(r2); |
806 __ CallRuntime(Runtime::kDeclareEvalVar); | 806 __ CallRuntime(Runtime::kDeclareEvalVar); |
807 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 807 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
808 break; | 808 break; |
809 } | 809 } |
| 810 |
| 811 case VariableLocation::MODULE: |
| 812 UNREACHABLE(); |
810 } | 813 } |
811 } | 814 } |
812 | 815 |
813 | 816 |
814 void FullCodeGenerator::VisitFunctionDeclaration( | 817 void FullCodeGenerator::VisitFunctionDeclaration( |
815 FunctionDeclaration* declaration) { | 818 FunctionDeclaration* declaration) { |
816 VariableProxy* proxy = declaration->proxy(); | 819 VariableProxy* proxy = declaration->proxy(); |
817 Variable* variable = proxy->var(); | 820 Variable* variable = proxy->var(); |
818 switch (variable->location()) { | 821 switch (variable->location()) { |
819 case VariableLocation::GLOBAL: | 822 case VariableLocation::GLOBAL: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 case VariableLocation::LOOKUP: { | 862 case VariableLocation::LOOKUP: { |
860 Comment cmnt(masm_, "[ FunctionDeclaration"); | 863 Comment cmnt(masm_, "[ FunctionDeclaration"); |
861 __ mov(r2, Operand(variable->name())); | 864 __ mov(r2, Operand(variable->name())); |
862 PushOperand(r2); | 865 PushOperand(r2); |
863 // Push initial value for function declaration. | 866 // Push initial value for function declaration. |
864 VisitForStackValue(declaration->fun()); | 867 VisitForStackValue(declaration->fun()); |
865 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 868 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
866 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 869 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
867 break; | 870 break; |
868 } | 871 } |
| 872 |
| 873 case VariableLocation::MODULE: |
| 874 UNREACHABLE(); |
869 } | 875 } |
870 } | 876 } |
871 | 877 |
872 | 878 |
873 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 879 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
874 // Call the runtime to declare the globals. | 880 // Call the runtime to declare the globals. |
875 __ mov(r1, Operand(pairs)); | 881 __ mov(r1, Operand(pairs)); |
876 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 882 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
877 __ EmitLoadTypeFeedbackVector(r2); | 883 __ EmitLoadTypeFeedbackVector(r2); |
878 __ Push(r1, r0, r2); | 884 __ Push(r1, r0, r2); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1355 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
1350 __ bind(&slow); | 1356 __ bind(&slow); |
1351 __ Push(var->name()); | 1357 __ Push(var->name()); |
1352 Runtime::FunctionId function_id = | 1358 Runtime::FunctionId function_id = |
1353 typeof_mode == NOT_INSIDE_TYPEOF | 1359 typeof_mode == NOT_INSIDE_TYPEOF |
1354 ? Runtime::kLoadLookupSlot | 1360 ? Runtime::kLoadLookupSlot |
1355 : Runtime::kLoadLookupSlotInsideTypeof; | 1361 : Runtime::kLoadLookupSlotInsideTypeof; |
1356 __ CallRuntime(function_id); | 1362 __ CallRuntime(function_id); |
1357 __ bind(&done); | 1363 __ bind(&done); |
1358 context()->Plug(r0); | 1364 context()->Plug(r0); |
| 1365 break; |
1359 } | 1366 } |
| 1367 |
| 1368 case VariableLocation::MODULE: |
| 1369 UNREACHABLE(); |
1360 } | 1370 } |
1361 } | 1371 } |
1362 | 1372 |
1363 | 1373 |
1364 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1374 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1365 Expression* expression = (property == NULL) ? NULL : property->value(); | 1375 Expression* expression = (property == NULL) ? NULL : property->value(); |
1366 if (expression == NULL) { | 1376 if (expression == NULL) { |
1367 __ LoadRoot(r1, Heap::kNullValueRootIndex); | 1377 __ LoadRoot(r1, Heap::kNullValueRootIndex); |
1368 PushOperand(r1); | 1378 PushOperand(r1); |
1369 } else { | 1379 } else { |
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3840 DCHECK(interrupt_address == | 3850 DCHECK(interrupt_address == |
3841 isolate->builtins()->OnStackReplacement()->entry()); | 3851 isolate->builtins()->OnStackReplacement()->entry()); |
3842 return ON_STACK_REPLACEMENT; | 3852 return ON_STACK_REPLACEMENT; |
3843 } | 3853 } |
3844 | 3854 |
3845 | 3855 |
3846 } // namespace internal | 3856 } // namespace internal |
3847 } // namespace v8 | 3857 } // namespace v8 |
3848 | 3858 |
3849 #endif // V8_TARGET_ARCH_ARM | 3859 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |