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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // No write barrier since the_hole_value is in old space. | 796 // No write barrier since the_hole_value is in old space. |
797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
798 } | 798 } |
799 break; | 799 break; |
800 | 800 |
801 case VariableLocation::LOOKUP: { | 801 case VariableLocation::LOOKUP: { |
802 Comment cmnt(masm_, "[ VariableDeclaration"); | 802 Comment cmnt(masm_, "[ VariableDeclaration"); |
803 __ mov(r2, Operand(variable->name())); | 803 __ mov(r2, Operand(variable->name())); |
804 // Declaration nodes are always introduced in one of four modes. | 804 // Declaration nodes are always introduced in one of four modes. |
805 DCHECK(IsDeclaredVariableMode(mode)); | 805 DCHECK(IsDeclaredVariableMode(mode)); |
806 // Push initial value, if any. | 806 DCHECK(!hole_init); |
807 // Note: For variables we must not push an initial value (such as | 807 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. |
808 // 'undefined') because we may have a (legal) redeclaration and we | |
809 // must not destroy the current value. | |
810 if (hole_init) { | |
811 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | |
812 } else { | |
813 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. | |
814 } | |
815 __ Push(r2, r0); | 808 __ Push(r2, r0); |
816 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 809 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
817 __ CallRuntime(Runtime::kDeclareLookupSlot); | 810 __ CallRuntime(Runtime::kDeclareLookupSlot); |
818 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 811 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
819 break; | 812 break; |
820 } | 813 } |
821 } | 814 } |
822 } | 815 } |
823 | 816 |
824 | 817 |
(...skipping 3058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3883 DCHECK(interrupt_address == | 3876 DCHECK(interrupt_address == |
3884 isolate->builtins()->OnStackReplacement()->entry()); | 3877 isolate->builtins()->OnStackReplacement()->entry()); |
3885 return ON_STACK_REPLACEMENT; | 3878 return ON_STACK_REPLACEMENT; |
3886 } | 3879 } |
3887 | 3880 |
3888 | 3881 |
3889 } // namespace internal | 3882 } // namespace internal |
3890 } // namespace v8 | 3883 } // namespace v8 |
3891 | 3884 |
3892 #endif // V8_TARGET_ARCH_ARM | 3885 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |