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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 case VariableLocation::LOOKUP: { | 795 case VariableLocation::LOOKUP: { |
796 Comment cmnt(masm_, "[ VariableDeclaration"); | 796 Comment cmnt(masm_, "[ VariableDeclaration"); |
797 DCHECK_EQ(VAR, mode); | 797 DCHECK_EQ(VAR, mode); |
798 DCHECK(!hole_init); | 798 DCHECK(!hole_init); |
799 __ li(a2, Operand(variable->name())); | 799 __ li(a2, Operand(variable->name())); |
800 __ Push(a2); | 800 __ Push(a2); |
801 __ CallRuntime(Runtime::kDeclareEvalVar); | 801 __ CallRuntime(Runtime::kDeclareEvalVar); |
802 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 802 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
803 break; | 803 break; |
804 } | 804 } |
| 805 |
| 806 case VariableLocation::MODULE: |
| 807 UNREACHABLE(); |
805 } | 808 } |
806 } | 809 } |
807 | 810 |
808 | 811 |
809 void FullCodeGenerator::VisitFunctionDeclaration( | 812 void FullCodeGenerator::VisitFunctionDeclaration( |
810 FunctionDeclaration* declaration) { | 813 FunctionDeclaration* declaration) { |
811 VariableProxy* proxy = declaration->proxy(); | 814 VariableProxy* proxy = declaration->proxy(); |
812 Variable* variable = proxy->var(); | 815 Variable* variable = proxy->var(); |
813 switch (variable->location()) { | 816 switch (variable->location()) { |
814 case VariableLocation::GLOBAL: | 817 case VariableLocation::GLOBAL: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 case VariableLocation::LOOKUP: { | 857 case VariableLocation::LOOKUP: { |
855 Comment cmnt(masm_, "[ FunctionDeclaration"); | 858 Comment cmnt(masm_, "[ FunctionDeclaration"); |
856 __ li(a2, Operand(variable->name())); | 859 __ li(a2, Operand(variable->name())); |
857 PushOperand(a2); | 860 PushOperand(a2); |
858 // Push initial value for function declaration. | 861 // Push initial value for function declaration. |
859 VisitForStackValue(declaration->fun()); | 862 VisitForStackValue(declaration->fun()); |
860 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 863 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
861 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 864 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
862 break; | 865 break; |
863 } | 866 } |
| 867 |
| 868 case VariableLocation::MODULE: |
| 869 UNREACHABLE(); |
864 } | 870 } |
865 } | 871 } |
866 | 872 |
867 | 873 |
868 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 874 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
869 // Call the runtime to declare the globals. | 875 // Call the runtime to declare the globals. |
870 __ li(a1, Operand(pairs)); | 876 __ li(a1, Operand(pairs)); |
871 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 877 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
872 __ EmitLoadTypeFeedbackVector(a2); | 878 __ EmitLoadTypeFeedbackVector(a2); |
873 __ Push(a1, a0, a2); | 879 __ Push(a1, a0, a2); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1351 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
1346 __ bind(&slow); | 1352 __ bind(&slow); |
1347 __ Push(var->name()); | 1353 __ Push(var->name()); |
1348 Runtime::FunctionId function_id = | 1354 Runtime::FunctionId function_id = |
1349 typeof_mode == NOT_INSIDE_TYPEOF | 1355 typeof_mode == NOT_INSIDE_TYPEOF |
1350 ? Runtime::kLoadLookupSlot | 1356 ? Runtime::kLoadLookupSlot |
1351 : Runtime::kLoadLookupSlotInsideTypeof; | 1357 : Runtime::kLoadLookupSlotInsideTypeof; |
1352 __ CallRuntime(function_id); | 1358 __ CallRuntime(function_id); |
1353 __ bind(&done); | 1359 __ bind(&done); |
1354 context()->Plug(v0); | 1360 context()->Plug(v0); |
| 1361 break; |
1355 } | 1362 } |
| 1363 |
| 1364 case VariableLocation::MODULE: |
| 1365 UNREACHABLE(); |
1356 } | 1366 } |
1357 } | 1367 } |
1358 | 1368 |
1359 | 1369 |
1360 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1370 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1361 Expression* expression = (property == NULL) ? NULL : property->value(); | 1371 Expression* expression = (property == NULL) ? NULL : property->value(); |
1362 if (expression == NULL) { | 1372 if (expression == NULL) { |
1363 __ LoadRoot(a1, Heap::kNullValueRootIndex); | 1373 __ LoadRoot(a1, Heap::kNullValueRootIndex); |
1364 PushOperand(a1); | 1374 PushOperand(a1); |
1365 } else { | 1375 } else { |
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3780 reinterpret_cast<uint32_t>( | 3790 reinterpret_cast<uint32_t>( |
3781 isolate->builtins()->OnStackReplacement()->entry())); | 3791 isolate->builtins()->OnStackReplacement()->entry())); |
3782 return ON_STACK_REPLACEMENT; | 3792 return ON_STACK_REPLACEMENT; |
3783 } | 3793 } |
3784 | 3794 |
3785 | 3795 |
3786 } // namespace internal | 3796 } // namespace internal |
3787 } // namespace v8 | 3797 } // namespace v8 |
3788 | 3798 |
3789 #endif // V8_TARGET_ARCH_MIPS | 3799 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |