| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 // If it was not possible to allocate the variable at compile time, we | 723 // If it was not possible to allocate the variable at compile time, we |
| 724 // need to "declare" it at runtime to make sure it actually exists in the | 724 // need to "declare" it at runtime to make sure it actually exists in the |
| 725 // local context. | 725 // local context. |
| 726 VariableProxy* proxy = declaration->proxy(); | 726 VariableProxy* proxy = declaration->proxy(); |
| 727 VariableMode mode = declaration->mode(); | 727 VariableMode mode = declaration->mode(); |
| 728 Variable* variable = proxy->var(); | 728 Variable* variable = proxy->var(); |
| 729 bool hole_init = mode == LET || mode == CONST; | 729 bool hole_init = mode == LET || mode == CONST; |
| 730 switch (variable->location()) { | 730 switch (variable->location()) { |
| 731 case VariableLocation::GLOBAL: | 731 case VariableLocation::GLOBAL: |
| 732 case VariableLocation::UNALLOCATED: | 732 case VariableLocation::UNALLOCATED: |
| 733 DCHECK(!variable->binding_needs_init()); |
| 733 globals_->Add(variable->name(), zone()); | 734 globals_->Add(variable->name(), zone()); |
| 734 globals_->Add(variable->binding_needs_init() | 735 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 735 ? isolate()->factory()->the_hole_value() | |
| 736 : isolate()->factory()->undefined_value(), | |
| 737 zone()); | |
| 738 break; | 736 break; |
| 739 | 737 |
| 740 case VariableLocation::PARAMETER: | 738 case VariableLocation::PARAMETER: |
| 741 case VariableLocation::LOCAL: | 739 case VariableLocation::LOCAL: |
| 742 if (hole_init) { | 740 if (hole_init) { |
| 743 Comment cmnt(masm_, "[ VariableDeclaration"); | 741 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 744 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 742 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 745 __ StoreP(ip, StackOperand(variable)); | 743 __ StoreP(ip, StackOperand(variable)); |
| 746 } | 744 } |
| 747 break; | 745 break; |
| (...skipping 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3900 | 3898 |
| 3901 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3899 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3902 | 3900 |
| 3903 DCHECK(interrupt_address == | 3901 DCHECK(interrupt_address == |
| 3904 isolate->builtins()->OnStackReplacement()->entry()); | 3902 isolate->builtins()->OnStackReplacement()->entry()); |
| 3905 return ON_STACK_REPLACEMENT; | 3903 return ON_STACK_REPLACEMENT; |
| 3906 } | 3904 } |
| 3907 } // namespace internal | 3905 } // namespace internal |
| 3908 } // namespace v8 | 3906 } // namespace v8 |
| 3909 #endif // V8_TARGET_ARCH_PPC | 3907 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |