| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 // No write barrier since the hole value is in old space. | 741 // No write barrier since the hole value is in old space. |
| 742 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 742 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 743 } | 743 } |
| 744 break; | 744 break; |
| 745 | 745 |
| 746 case VariableLocation::LOOKUP: { | 746 case VariableLocation::LOOKUP: { |
| 747 Comment cmnt(masm_, "[ VariableDeclaration"); | 747 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 748 __ push(Immediate(variable->name())); | 748 __ push(Immediate(variable->name())); |
| 749 // VariableDeclaration nodes are always introduced in one of four modes. | 749 // VariableDeclaration nodes are always introduced in one of four modes. |
| 750 DCHECK(IsDeclaredVariableMode(mode)); | 750 DCHECK(IsDeclaredVariableMode(mode)); |
| 751 // Push initial value, if any. | 751 DCHECK(!hole_init); |
| 752 // Note: For variables we must not push an initial value (such as | 752 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. |
| 753 // 'undefined') because we may have a (legal) redeclaration and we | |
| 754 // must not destroy the current value. | |
| 755 if (hole_init) { | |
| 756 __ push(Immediate(isolate()->factory()->the_hole_value())); | |
| 757 } else { | |
| 758 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. | |
| 759 } | |
| 760 __ push( | 753 __ push( |
| 761 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); | 754 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); |
| 762 __ CallRuntime(Runtime::kDeclareLookupSlot); | 755 __ CallRuntime(Runtime::kDeclareLookupSlot); |
| 763 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 756 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 764 break; | 757 break; |
| 765 } | 758 } |
| 766 } | 759 } |
| 767 } | 760 } |
| 768 | 761 |
| 769 void FullCodeGenerator::VisitFunctionDeclaration( | 762 void FullCodeGenerator::VisitFunctionDeclaration( |
| (...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3698 isolate->builtins()->OnStackReplacement()->entry(), | 3691 isolate->builtins()->OnStackReplacement()->entry(), |
| 3699 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3692 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3700 return ON_STACK_REPLACEMENT; | 3693 return ON_STACK_REPLACEMENT; |
| 3701 } | 3694 } |
| 3702 | 3695 |
| 3703 | 3696 |
| 3704 } // namespace internal | 3697 } // namespace internal |
| 3705 } // namespace v8 | 3698 } // namespace v8 |
| 3706 | 3699 |
| 3707 #endif // V8_TARGET_ARCH_X87 | 3700 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |