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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 __ li(a2, Operand(variable->name())); | 800 __ li(a2, Operand(variable->name())); |
801 // Declaration nodes are always introduced in one of four modes. | 801 // Declaration nodes are always introduced in one of four modes. |
802 DCHECK(IsDeclaredVariableMode(mode)); | 802 DCHECK(IsDeclaredVariableMode(mode)); |
803 // Push initial value, if any. | 803 DCHECK(!hole_init); |
804 // Note: For variables we must not push an initial value (such as | 804 DCHECK(Smi::FromInt(0) == 0); |
805 // 'undefined') because we may have a (legal) redeclaration and we | 805 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. |
806 // must not destroy the current value. | |
807 if (hole_init) { | |
808 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); | |
809 } else { | |
810 DCHECK(Smi::FromInt(0) == 0); | |
811 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. | |
812 } | |
813 __ Push(a2, a0); | 806 __ Push(a2, a0); |
814 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 807 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
815 __ CallRuntime(Runtime::kDeclareLookupSlot); | 808 __ CallRuntime(Runtime::kDeclareLookupSlot); |
816 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 809 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
817 break; | 810 break; |
818 } | 811 } |
819 } | 812 } |
820 } | 813 } |
821 | 814 |
822 | 815 |
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3828 reinterpret_cast<uint32_t>( | 3821 reinterpret_cast<uint32_t>( |
3829 isolate->builtins()->OnStackReplacement()->entry())); | 3822 isolate->builtins()->OnStackReplacement()->entry())); |
3830 return ON_STACK_REPLACEMENT; | 3823 return ON_STACK_REPLACEMENT; |
3831 } | 3824 } |
3832 | 3825 |
3833 | 3826 |
3834 } // namespace internal | 3827 } // namespace internal |
3835 } // namespace v8 | 3828 } // namespace v8 |
3836 | 3829 |
3837 #endif // V8_TARGET_ARCH_MIPS | 3830 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |