| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 // No write barrier since the_hole_value is in old space. | 736 // No write barrier since the_hole_value is in old space. |
| 737 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 737 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 738 } | 738 } |
| 739 break; | 739 break; |
| 740 | 740 |
| 741 case VariableLocation::LOOKUP: { | 741 case VariableLocation::LOOKUP: { |
| 742 Comment cmnt(masm_, "[ VariableDeclaration"); | 742 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 743 __ mov(r4, Operand(variable->name())); | 743 __ mov(r4, Operand(variable->name())); |
| 744 // Declaration nodes are always introduced in one of four modes. | 744 // Declaration nodes are always introduced in one of four modes. |
| 745 DCHECK(IsDeclaredVariableMode(mode)); | 745 DCHECK(IsDeclaredVariableMode(mode)); |
| 746 // Push initial value, if any. | 746 DCHECK(!hole_init); |
| 747 // Note: For variables we must not push an initial value (such as | 747 __ LoadSmiLiteral(r2, Smi::FromInt(0)); // Indicates no initial value. |
| 748 // 'undefined') because we may have a (legal) redeclaration and we | |
| 749 // must not destroy the current value. | |
| 750 if (hole_init) { | |
| 751 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); | |
| 752 } else { | |
| 753 __ LoadSmiLiteral(r2, Smi::FromInt(0)); // Indicates no initial value. | |
| 754 } | |
| 755 __ Push(r4, r2); | 748 __ Push(r4, r2); |
| 756 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 749 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 757 __ CallRuntime(Runtime::kDeclareLookupSlot); | 750 __ CallRuntime(Runtime::kDeclareLookupSlot); |
| 758 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 751 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 759 break; | 752 break; |
| 760 } | 753 } |
| 761 } | 754 } |
| 762 } | 755 } |
| 763 | 756 |
| 764 void FullCodeGenerator::VisitFunctionDeclaration( | 757 void FullCodeGenerator::VisitFunctionDeclaration( |
| (...skipping 2950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3715 DCHECK(kOSRBranchInstruction == br_instr); | 3708 DCHECK(kOSRBranchInstruction == br_instr); |
| 3716 | 3709 |
| 3717 DCHECK(interrupt_address == | 3710 DCHECK(interrupt_address == |
| 3718 isolate->builtins()->OnStackReplacement()->entry()); | 3711 isolate->builtins()->OnStackReplacement()->entry()); |
| 3719 return ON_STACK_REPLACEMENT; | 3712 return ON_STACK_REPLACEMENT; |
| 3720 } | 3713 } |
| 3721 | 3714 |
| 3722 } // namespace internal | 3715 } // namespace internal |
| 3723 } // namespace v8 | 3716 } // namespace v8 |
| 3724 #endif // V8_TARGET_ARCH_S390 | 3717 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |