| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 EmitDebugCheckDeclarationContext(variable); | 740 EmitDebugCheckDeclarationContext(variable); |
| 741 __ mov(ContextOperand(esi, variable->index()), | 741 __ mov(ContextOperand(esi, variable->index()), |
| 742 Immediate(isolate()->factory()->the_hole_value())); | 742 Immediate(isolate()->factory()->the_hole_value())); |
| 743 // No write barrier since the hole value is in old space. | 743 // No write barrier since the hole value is in old space. |
| 744 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 744 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 745 } | 745 } |
| 746 break; | 746 break; |
| 747 | 747 |
| 748 case VariableLocation::LOOKUP: { | 748 case VariableLocation::LOOKUP: { |
| 749 Comment cmnt(masm_, "[ VariableDeclaration"); | 749 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 750 DCHECK_EQ(VAR, mode); |
| 751 DCHECK(!hole_init); |
| 750 __ push(Immediate(variable->name())); | 752 __ push(Immediate(variable->name())); |
| 751 // VariableDeclaration nodes are always introduced in one of four modes. | 753 __ CallRuntime(Runtime::kDeclareEvalVar); |
| 752 DCHECK(IsDeclaredVariableMode(mode)); | |
| 753 DCHECK(!hole_init); | |
| 754 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. | |
| 755 __ push( | |
| 756 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); | |
| 757 __ CallRuntime(Runtime::kDeclareLookupSlot); | |
| 758 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 754 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 759 break; | 755 break; |
| 760 } | 756 } |
| 761 } | 757 } |
| 762 } | 758 } |
| 763 | 759 |
| 764 | 760 |
| 765 void FullCodeGenerator::VisitFunctionDeclaration( | 761 void FullCodeGenerator::VisitFunctionDeclaration( |
| 766 FunctionDeclaration* declaration) { | 762 FunctionDeclaration* declaration) { |
| 767 VariableProxy* proxy = declaration->proxy(); | 763 VariableProxy* proxy = declaration->proxy(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 EMIT_REMEMBERED_SET, | 796 EMIT_REMEMBERED_SET, |
| 801 OMIT_SMI_CHECK); | 797 OMIT_SMI_CHECK); |
| 802 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 798 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 803 break; | 799 break; |
| 804 } | 800 } |
| 805 | 801 |
| 806 case VariableLocation::LOOKUP: { | 802 case VariableLocation::LOOKUP: { |
| 807 Comment cmnt(masm_, "[ FunctionDeclaration"); | 803 Comment cmnt(masm_, "[ FunctionDeclaration"); |
| 808 PushOperand(variable->name()); | 804 PushOperand(variable->name()); |
| 809 VisitForStackValue(declaration->fun()); | 805 VisitForStackValue(declaration->fun()); |
| 810 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 806 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
| 811 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | |
| 812 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 807 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 813 break; | 808 break; |
| 814 } | 809 } |
| 815 } | 810 } |
| 816 } | 811 } |
| 817 | 812 |
| 818 | 813 |
| 819 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 814 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
| 820 // Call the runtime to declare the globals. | 815 // Call the runtime to declare the globals. |
| 821 __ Push(pairs); | 816 __ Push(pairs); |
| (...skipping 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3710 isolate->builtins()->OnStackReplacement()->entry(), | 3705 isolate->builtins()->OnStackReplacement()->entry(), |
| 3711 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3706 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3712 return ON_STACK_REPLACEMENT; | 3707 return ON_STACK_REPLACEMENT; |
| 3713 } | 3708 } |
| 3714 | 3709 |
| 3715 | 3710 |
| 3716 } // namespace internal | 3711 } // namespace internal |
| 3717 } // namespace v8 | 3712 } // namespace v8 |
| 3718 | 3713 |
| 3719 #endif // V8_TARGET_ARCH_IA32 | 3714 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |