| 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 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. |
| 807 // Note: For variables we must not push an initial value (such as | |
| 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); | 807 __ Push(r2, r0); |
| 816 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 808 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 817 __ CallRuntime(Runtime::kDeclareLookupSlot); | 809 __ CallRuntime(Runtime::kDeclareLookupSlot); |
| 818 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 810 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 819 break; | 811 break; |
| 820 } | 812 } |
| 821 } | 813 } |
| 822 } | 814 } |
| 823 | 815 |
| 824 | 816 |
| (...skipping 3058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3883 DCHECK(interrupt_address == | 3875 DCHECK(interrupt_address == |
| 3884 isolate->builtins()->OnStackReplacement()->entry()); | 3876 isolate->builtins()->OnStackReplacement()->entry()); |
| 3885 return ON_STACK_REPLACEMENT; | 3877 return ON_STACK_REPLACEMENT; |
| 3886 } | 3878 } |
| 3887 | 3879 |
| 3888 | 3880 |
| 3889 } // namespace internal | 3881 } // namespace internal |
| 3890 } // namespace v8 | 3882 } // namespace v8 |
| 3891 | 3883 |
| 3892 #endif // V8_TARGET_ARCH_ARM | 3884 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |