| 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // If it was not possible to allocate the variable at compile time, we | 757 // If it was not possible to allocate the variable at compile time, we |
| 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 switch (variable->location()) { | 764 switch (variable->location()) { |
| 765 case VariableLocation::GLOBAL: | 765 case VariableLocation::GLOBAL: |
| 766 case VariableLocation::UNALLOCATED: | 766 case VariableLocation::UNALLOCATED: |
| 767 DCHECK(!variable->binding_needs_init()); |
| 767 globals_->Add(variable->name(), zone()); | 768 globals_->Add(variable->name(), zone()); |
| 768 globals_->Add(variable->binding_needs_init() | 769 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 769 ? isolate()->factory()->the_hole_value() | |
| 770 : isolate()->factory()->undefined_value(), | |
| 771 zone()); | |
| 772 break; | 770 break; |
| 773 | 771 |
| 774 case VariableLocation::PARAMETER: | 772 case VariableLocation::PARAMETER: |
| 775 case VariableLocation::LOCAL: | 773 case VariableLocation::LOCAL: |
| 776 if (hole_init) { | 774 if (hole_init) { |
| 777 Comment cmnt(masm_, "[ VariableDeclaration"); | 775 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 778 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); | 776 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); |
| 779 __ sd(a4, StackOperand(variable)); | 777 __ sd(a4, StackOperand(variable)); |
| 780 } | 778 } |
| 781 break; | 779 break; |
| (...skipping 3170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3952 reinterpret_cast<uint64_t>( | 3950 reinterpret_cast<uint64_t>( |
| 3953 isolate->builtins()->OnStackReplacement()->entry())); | 3951 isolate->builtins()->OnStackReplacement()->entry())); |
| 3954 return ON_STACK_REPLACEMENT; | 3952 return ON_STACK_REPLACEMENT; |
| 3955 } | 3953 } |
| 3956 | 3954 |
| 3957 | 3955 |
| 3958 } // namespace internal | 3956 } // namespace internal |
| 3959 } // namespace v8 | 3957 } // namespace v8 |
| 3960 | 3958 |
| 3961 #endif // V8_TARGET_ARCH_MIPS64 | 3959 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |