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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 // No write barrier since the_hole_value is in old space. | 792 // No write barrier since the_hole_value is in old space. |
793 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 793 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
794 } | 794 } |
795 break; | 795 break; |
796 | 796 |
797 case VariableLocation::LOOKUP: { | 797 case VariableLocation::LOOKUP: { |
798 Comment cmnt(masm_, "[ VariableDeclaration"); | 798 Comment cmnt(masm_, "[ VariableDeclaration"); |
799 __ li(a2, Operand(variable->name())); | 799 __ li(a2, Operand(variable->name())); |
800 // Declaration nodes are always introduced in one of four modes. | 800 // Declaration nodes are always introduced in one of four modes. |
801 DCHECK(IsDeclaredVariableMode(mode)); | 801 DCHECK(IsDeclaredVariableMode(mode)); |
802 // Push initial value, if any. | 802 DCHECK(!hole_init); |
803 // Note: For variables we must not push an initial value (such as | 803 DCHECK(Smi::FromInt(0) == 0); |
804 // 'undefined') because we may have a (legal) redeclaration and we | 804 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. |
805 // must not destroy the current value. | |
806 if (hole_init) { | |
807 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); | |
808 } else { | |
809 DCHECK(Smi::FromInt(0) == 0); | |
810 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. | |
811 } | |
812 __ Push(a2, a0); | 805 __ Push(a2, a0); |
813 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 806 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
814 __ CallRuntime(Runtime::kDeclareLookupSlot); | 807 __ CallRuntime(Runtime::kDeclareLookupSlot); |
815 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 808 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
816 break; | 809 break; |
817 } | 810 } |
818 } | 811 } |
819 } | 812 } |
820 | 813 |
821 | 814 |
(...skipping 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3835 reinterpret_cast<uint64_t>( | 3828 reinterpret_cast<uint64_t>( |
3836 isolate->builtins()->OnStackReplacement()->entry())); | 3829 isolate->builtins()->OnStackReplacement()->entry())); |
3837 return ON_STACK_REPLACEMENT; | 3830 return ON_STACK_REPLACEMENT; |
3838 } | 3831 } |
3839 | 3832 |
3840 | 3833 |
3841 } // namespace internal | 3834 } // namespace internal |
3842 } // namespace v8 | 3835 } // namespace v8 |
3843 | 3836 |
3844 #endif // V8_TARGET_ARCH_MIPS64 | 3837 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |