| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // need to "declare" it at runtime to make sure it actually exists in the | 758 // need to "declare" it at runtime to make sure it actually exists in the |
| 759 // local context. | 759 // local context. |
| 760 VariableProxy* proxy = declaration->proxy(); | 760 VariableProxy* proxy = declaration->proxy(); |
| 761 VariableMode mode = declaration->mode(); | 761 VariableMode mode = declaration->mode(); |
| 762 Variable* variable = proxy->var(); | 762 Variable* variable = proxy->var(); |
| 763 bool hole_init = mode == LET || mode == CONST; | 763 bool hole_init = mode == LET || mode == CONST; |
| 764 | 764 |
| 765 switch (variable->location()) { | 765 switch (variable->location()) { |
| 766 case VariableLocation::GLOBAL: | 766 case VariableLocation::GLOBAL: |
| 767 case VariableLocation::UNALLOCATED: | 767 case VariableLocation::UNALLOCATED: |
| 768 DCHECK(!variable->binding_needs_init()); |
| 768 globals_->Add(variable->name(), zone()); | 769 globals_->Add(variable->name(), zone()); |
| 769 globals_->Add(variable->binding_needs_init() | 770 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 770 ? isolate()->factory()->the_hole_value() | |
| 771 : isolate()->factory()->undefined_value(), | |
| 772 zone()); | |
| 773 break; | 771 break; |
| 774 | 772 |
| 775 case VariableLocation::PARAMETER: | 773 case VariableLocation::PARAMETER: |
| 776 case VariableLocation::LOCAL: | 774 case VariableLocation::LOCAL: |
| 777 if (hole_init) { | 775 if (hole_init) { |
| 778 Comment cmnt(masm_, "[ VariableDeclaration"); | 776 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 779 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 777 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
| 780 __ Str(x10, StackOperand(variable)); | 778 __ Str(x10, StackOperand(variable)); |
| 781 } | 779 } |
| 782 break; | 780 break; |
| (...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3991 } | 3989 } |
| 3992 | 3990 |
| 3993 return INTERRUPT; | 3991 return INTERRUPT; |
| 3994 } | 3992 } |
| 3995 | 3993 |
| 3996 | 3994 |
| 3997 } // namespace internal | 3995 } // namespace internal |
| 3998 } // namespace v8 | 3996 } // namespace v8 |
| 3999 | 3997 |
| 4000 #endif // V8_TARGET_ARCH_ARM64 | 3998 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |