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