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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 // No write barrier since the_hole_value is in old space. | 758 // No write barrier since the_hole_value is in old space. |
759 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 759 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
760 } | 760 } |
761 break; | 761 break; |
762 | 762 |
763 case VariableLocation::LOOKUP: { | 763 case VariableLocation::LOOKUP: { |
764 Comment cmnt(masm_, "[ VariableDeclaration"); | 764 Comment cmnt(masm_, "[ VariableDeclaration"); |
765 __ mov(r5, Operand(variable->name())); | 765 __ mov(r5, Operand(variable->name())); |
766 // Declaration nodes are always introduced in one of four modes. | 766 // Declaration nodes are always introduced in one of four modes. |
767 DCHECK(IsDeclaredVariableMode(mode)); | 767 DCHECK(IsDeclaredVariableMode(mode)); |
768 // Push initial value, if any. | 768 DCHECK(!hole_init); |
769 // Note: For variables we must not push an initial value (such as | 769 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. |
770 // 'undefined') because we may have a (legal) redeclaration and we | |
771 // must not destroy the current value. | |
772 if (hole_init) { | |
773 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | |
774 } else { | |
775 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. | |
776 } | |
777 __ Push(r5, r3); | 770 __ Push(r5, r3); |
778 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 771 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
779 __ CallRuntime(Runtime::kDeclareLookupSlot); | 772 __ CallRuntime(Runtime::kDeclareLookupSlot); |
780 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 773 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
781 break; | 774 break; |
782 } | 775 } |
783 } | 776 } |
784 } | 777 } |
785 | 778 |
786 | 779 |
(...skipping 3017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3804 | 3797 |
3805 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3798 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3806 | 3799 |
3807 DCHECK(interrupt_address == | 3800 DCHECK(interrupt_address == |
3808 isolate->builtins()->OnStackReplacement()->entry()); | 3801 isolate->builtins()->OnStackReplacement()->entry()); |
3809 return ON_STACK_REPLACEMENT; | 3802 return ON_STACK_REPLACEMENT; |
3810 } | 3803 } |
3811 } // namespace internal | 3804 } // namespace internal |
3812 } // namespace v8 | 3805 } // namespace v8 |
3813 #endif // V8_TARGET_ARCH_PPC | 3806 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |