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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 EmitDebugCheckDeclarationContext(variable); | 790 EmitDebugCheckDeclarationContext(variable); |
791 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 791 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
792 __ sw(at, ContextMemOperand(cp, variable->index())); | 792 __ sw(at, ContextMemOperand(cp, variable->index())); |
793 // No write barrier since the_hole_value is in old space. | 793 // No write barrier since the_hole_value is in old space. |
794 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 794 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
795 } | 795 } |
796 break; | 796 break; |
797 | 797 |
798 case VariableLocation::LOOKUP: { | 798 case VariableLocation::LOOKUP: { |
799 Comment cmnt(masm_, "[ VariableDeclaration"); | 799 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 800 DCHECK_EQ(VAR, mode); |
| 801 DCHECK(!hole_init); |
800 __ li(a2, Operand(variable->name())); | 802 __ li(a2, Operand(variable->name())); |
801 // Declaration nodes are always introduced in one of four modes. | 803 __ Push(a2); |
802 DCHECK(IsDeclaredVariableMode(mode)); | 804 __ CallRuntime(Runtime::kDeclareEvalVar); |
803 DCHECK(!hole_init); | |
804 DCHECK(Smi::FromInt(0) == 0); | |
805 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. | |
806 __ Push(a2, a0); | |
807 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | |
808 __ CallRuntime(Runtime::kDeclareLookupSlot); | |
809 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 805 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
810 break; | 806 break; |
811 } | 807 } |
812 } | 808 } |
813 } | 809 } |
814 | 810 |
815 | 811 |
816 void FullCodeGenerator::VisitFunctionDeclaration( | 812 void FullCodeGenerator::VisitFunctionDeclaration( |
817 FunctionDeclaration* declaration) { | 813 FunctionDeclaration* declaration) { |
818 VariableProxy* proxy = declaration->proxy(); | 814 VariableProxy* proxy = declaration->proxy(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 851 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
856 break; | 852 break; |
857 } | 853 } |
858 | 854 |
859 case VariableLocation::LOOKUP: { | 855 case VariableLocation::LOOKUP: { |
860 Comment cmnt(masm_, "[ FunctionDeclaration"); | 856 Comment cmnt(masm_, "[ FunctionDeclaration"); |
861 __ li(a2, Operand(variable->name())); | 857 __ li(a2, Operand(variable->name())); |
862 PushOperand(a2); | 858 PushOperand(a2); |
863 // Push initial value for function declaration. | 859 // Push initial value for function declaration. |
864 VisitForStackValue(declaration->fun()); | 860 VisitForStackValue(declaration->fun()); |
865 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 861 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
866 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | |
867 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 862 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
868 break; | 863 break; |
869 } | 864 } |
870 } | 865 } |
871 } | 866 } |
872 | 867 |
873 | 868 |
874 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 869 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
875 // Call the runtime to declare the globals. | 870 // Call the runtime to declare the globals. |
876 __ li(a1, Operand(pairs)); | 871 __ li(a1, Operand(pairs)); |
(...skipping 2943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3820 reinterpret_cast<uint32_t>( | 3815 reinterpret_cast<uint32_t>( |
3821 isolate->builtins()->OnStackReplacement()->entry())); | 3816 isolate->builtins()->OnStackReplacement()->entry())); |
3822 return ON_STACK_REPLACEMENT; | 3817 return ON_STACK_REPLACEMENT; |
3823 } | 3818 } |
3824 | 3819 |
3825 | 3820 |
3826 } // namespace internal | 3821 } // namespace internal |
3827 } // namespace v8 | 3822 } // namespace v8 |
3828 | 3823 |
3829 #endif // V8_TARGET_ARCH_MIPS | 3824 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |