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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 case VariableLocation::LOOKUP: { | 790 case VariableLocation::LOOKUP: { |
791 Comment cmnt(masm_, "[ VariableDeclaration"); | 791 Comment cmnt(masm_, "[ VariableDeclaration"); |
792 DCHECK_EQ(VAR, variable->mode()); | 792 DCHECK_EQ(VAR, variable->mode()); |
793 DCHECK(!variable->binding_needs_init()); | 793 DCHECK(!variable->binding_needs_init()); |
794 __ li(a2, Operand(variable->name())); | 794 __ li(a2, Operand(variable->name())); |
795 __ Push(a2); | 795 __ Push(a2); |
796 __ CallRuntime(Runtime::kDeclareEvalVar); | 796 __ CallRuntime(Runtime::kDeclareEvalVar); |
797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
798 break; | 798 break; |
799 } | 799 } |
| 800 |
| 801 case VariableLocation::MODULE: |
| 802 UNREACHABLE(); |
800 } | 803 } |
801 } | 804 } |
802 | 805 |
803 | 806 |
804 void FullCodeGenerator::VisitFunctionDeclaration( | 807 void FullCodeGenerator::VisitFunctionDeclaration( |
805 FunctionDeclaration* declaration) { | 808 FunctionDeclaration* declaration) { |
806 VariableProxy* proxy = declaration->proxy(); | 809 VariableProxy* proxy = declaration->proxy(); |
807 Variable* variable = proxy->var(); | 810 Variable* variable = proxy->var(); |
808 switch (variable->location()) { | 811 switch (variable->location()) { |
809 case VariableLocation::GLOBAL: | 812 case VariableLocation::GLOBAL: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 case VariableLocation::LOOKUP: { | 852 case VariableLocation::LOOKUP: { |
850 Comment cmnt(masm_, "[ FunctionDeclaration"); | 853 Comment cmnt(masm_, "[ FunctionDeclaration"); |
851 __ li(a2, Operand(variable->name())); | 854 __ li(a2, Operand(variable->name())); |
852 PushOperand(a2); | 855 PushOperand(a2); |
853 // Push initial value for function declaration. | 856 // Push initial value for function declaration. |
854 VisitForStackValue(declaration->fun()); | 857 VisitForStackValue(declaration->fun()); |
855 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 858 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
856 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 859 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
857 break; | 860 break; |
858 } | 861 } |
| 862 |
| 863 case VariableLocation::MODULE: |
| 864 UNREACHABLE(); |
859 } | 865 } |
860 } | 866 } |
861 | 867 |
862 | 868 |
863 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 869 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
864 // Call the runtime to declare the globals. | 870 // Call the runtime to declare the globals. |
865 __ li(a1, Operand(pairs)); | 871 __ li(a1, Operand(pairs)); |
866 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 872 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
867 __ EmitLoadTypeFeedbackVector(a2); | 873 __ EmitLoadTypeFeedbackVector(a2); |
868 __ Push(a1, a0, a2); | 874 __ Push(a1, a0, a2); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1346 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
1341 __ bind(&slow); | 1347 __ bind(&slow); |
1342 __ Push(var->name()); | 1348 __ Push(var->name()); |
1343 Runtime::FunctionId function_id = | 1349 Runtime::FunctionId function_id = |
1344 typeof_mode == NOT_INSIDE_TYPEOF | 1350 typeof_mode == NOT_INSIDE_TYPEOF |
1345 ? Runtime::kLoadLookupSlot | 1351 ? Runtime::kLoadLookupSlot |
1346 : Runtime::kLoadLookupSlotInsideTypeof; | 1352 : Runtime::kLoadLookupSlotInsideTypeof; |
1347 __ CallRuntime(function_id); | 1353 __ CallRuntime(function_id); |
1348 __ bind(&done); | 1354 __ bind(&done); |
1349 context()->Plug(v0); | 1355 context()->Plug(v0); |
| 1356 break; |
1350 } | 1357 } |
| 1358 |
| 1359 case VariableLocation::MODULE: |
| 1360 UNREACHABLE(); |
1351 } | 1361 } |
1352 } | 1362 } |
1353 | 1363 |
1354 | 1364 |
1355 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1365 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1356 Expression* expression = (property == NULL) ? NULL : property->value(); | 1366 Expression* expression = (property == NULL) ? NULL : property->value(); |
1357 if (expression == NULL) { | 1367 if (expression == NULL) { |
1358 __ LoadRoot(a1, Heap::kNullValueRootIndex); | 1368 __ LoadRoot(a1, Heap::kNullValueRootIndex); |
1359 PushOperand(a1); | 1369 PushOperand(a1); |
1360 } else { | 1370 } else { |
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3775 reinterpret_cast<uint64_t>( | 3785 reinterpret_cast<uint64_t>( |
3776 isolate->builtins()->OnStackReplacement()->entry())); | 3786 isolate->builtins()->OnStackReplacement()->entry())); |
3777 return ON_STACK_REPLACEMENT; | 3787 return ON_STACK_REPLACEMENT; |
3778 } | 3788 } |
3779 | 3789 |
3780 | 3790 |
3781 } // namespace internal | 3791 } // namespace internal |
3782 } // namespace v8 | 3792 } // namespace v8 |
3783 | 3793 |
3784 #endif // V8_TARGET_ARCH_MIPS64 | 3794 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |