| 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 EmitDebugCheckDeclarationContext(variable); | 738 EmitDebugCheckDeclarationContext(variable); |
| 739 __ mov(ContextOperand(esi, variable->index()), | 739 __ mov(ContextOperand(esi, variable->index()), |
| 740 Immediate(isolate()->factory()->the_hole_value())); | 740 Immediate(isolate()->factory()->the_hole_value())); |
| 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 DCHECK_EQ(VAR, mode); |
| 749 DCHECK(!hole_init); |
| 748 __ push(Immediate(variable->name())); | 750 __ push(Immediate(variable->name())); |
| 749 // VariableDeclaration nodes are always introduced in one of four modes. | 751 __ CallRuntime(Runtime::kDeclareEvalVar); |
| 750 DCHECK(IsDeclaredVariableMode(mode)); | |
| 751 DCHECK(!hole_init); | |
| 752 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. | |
| 753 __ push( | |
| 754 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); | |
| 755 __ CallRuntime(Runtime::kDeclareLookupSlot); | |
| 756 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 752 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 757 break; | 753 break; |
| 758 } | 754 } |
| 759 } | 755 } |
| 760 } | 756 } |
| 761 | 757 |
| 762 void FullCodeGenerator::VisitFunctionDeclaration( | 758 void FullCodeGenerator::VisitFunctionDeclaration( |
| 763 FunctionDeclaration* declaration) { | 759 FunctionDeclaration* declaration) { |
| 764 VariableProxy* proxy = declaration->proxy(); | 760 VariableProxy* proxy = declaration->proxy(); |
| 765 Variable* variable = proxy->var(); | 761 Variable* variable = proxy->var(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 793 result_register(), ecx, kDontSaveFPRegs, | 789 result_register(), ecx, kDontSaveFPRegs, |
| 794 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 790 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 795 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 791 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 796 break; | 792 break; |
| 797 } | 793 } |
| 798 | 794 |
| 799 case VariableLocation::LOOKUP: { | 795 case VariableLocation::LOOKUP: { |
| 800 Comment cmnt(masm_, "[ FunctionDeclaration"); | 796 Comment cmnt(masm_, "[ FunctionDeclaration"); |
| 801 PushOperand(variable->name()); | 797 PushOperand(variable->name()); |
| 802 VisitForStackValue(declaration->fun()); | 798 VisitForStackValue(declaration->fun()); |
| 803 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 799 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
| 804 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | |
| 805 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 800 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 806 break; | 801 break; |
| 807 } | 802 } |
| 808 } | 803 } |
| 809 } | 804 } |
| 810 | 805 |
| 811 | 806 |
| 812 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 807 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
| 813 // Call the runtime to declare the globals. | 808 // Call the runtime to declare the globals. |
| 814 __ Push(pairs); | 809 __ Push(pairs); |
| (...skipping 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3690 isolate->builtins()->OnStackReplacement()->entry(), | 3685 isolate->builtins()->OnStackReplacement()->entry(), |
| 3691 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3686 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3692 return ON_STACK_REPLACEMENT; | 3687 return ON_STACK_REPLACEMENT; |
| 3693 } | 3688 } |
| 3694 | 3689 |
| 3695 | 3690 |
| 3696 } // namespace internal | 3691 } // namespace internal |
| 3697 } // namespace v8 | 3692 } // namespace v8 |
| 3698 | 3693 |
| 3699 #endif // V8_TARGET_ARCH_X87 | 3694 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |