| 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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 VariableProxy* proxy = declaration->proxy(); | 702 VariableProxy* proxy = declaration->proxy(); |
| 703 Variable* variable = proxy->var(); | 703 Variable* variable = proxy->var(); |
| 704 switch (variable->location()) { | 704 switch (variable->location()) { |
| 705 case VariableLocation::UNALLOCATED: { | 705 case VariableLocation::UNALLOCATED: { |
| 706 DCHECK(!variable->binding_needs_init()); | 706 DCHECK(!variable->binding_needs_init()); |
| 707 globals_->Add(variable->name(), zone()); | 707 globals_->Add(variable->name(), zone()); |
| 708 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 708 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 709 DCHECK(!slot.IsInvalid()); | 709 DCHECK(!slot.IsInvalid()); |
| 710 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 710 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 711 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 711 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 712 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 712 break; | 713 break; |
| 713 } | 714 } |
| 714 case VariableLocation::PARAMETER: | 715 case VariableLocation::PARAMETER: |
| 715 case VariableLocation::LOCAL: | 716 case VariableLocation::LOCAL: |
| 716 if (variable->binding_needs_init()) { | 717 if (variable->binding_needs_init()) { |
| 717 Comment cmnt(masm_, "[ VariableDeclaration"); | 718 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 718 __ mov(StackOperand(variable), | 719 __ mov(StackOperand(variable), |
| 719 Immediate(isolate()->factory()->the_hole_value())); | 720 Immediate(isolate()->factory()->the_hole_value())); |
| 720 } | 721 } |
| 721 break; | 722 break; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 741 void FullCodeGenerator::VisitFunctionDeclaration( | 742 void FullCodeGenerator::VisitFunctionDeclaration( |
| 742 FunctionDeclaration* declaration) { | 743 FunctionDeclaration* declaration) { |
| 743 VariableProxy* proxy = declaration->proxy(); | 744 VariableProxy* proxy = declaration->proxy(); |
| 744 Variable* variable = proxy->var(); | 745 Variable* variable = proxy->var(); |
| 745 switch (variable->location()) { | 746 switch (variable->location()) { |
| 746 case VariableLocation::UNALLOCATED: { | 747 case VariableLocation::UNALLOCATED: { |
| 747 globals_->Add(variable->name(), zone()); | 748 globals_->Add(variable->name(), zone()); |
| 748 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 749 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 749 DCHECK(!slot.IsInvalid()); | 750 DCHECK(!slot.IsInvalid()); |
| 750 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 751 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 752 |
| 753 // We need the slot where the literals array lives, too. |
| 754 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 755 DCHECK(!slot.IsInvalid()); |
| 756 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 757 |
| 751 Handle<SharedFunctionInfo> function = | 758 Handle<SharedFunctionInfo> function = |
| 752 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 759 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 753 // Check for stack-overflow exception. | 760 // Check for stack-overflow exception. |
| 754 if (function.is_null()) return SetStackOverflow(); | 761 if (function.is_null()) return SetStackOverflow(); |
| 755 globals_->Add(function, zone()); | 762 globals_->Add(function, zone()); |
| 756 break; | 763 break; |
| 757 } | 764 } |
| 758 | 765 |
| 759 case VariableLocation::PARAMETER: | 766 case VariableLocation::PARAMETER: |
| 760 case VariableLocation::LOCAL: { | 767 case VariableLocation::LOCAL: { |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2773 isolate->builtins()->OnStackReplacement()->entry(), | 2780 isolate->builtins()->OnStackReplacement()->entry(), |
| 2774 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2781 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 2775 return ON_STACK_REPLACEMENT; | 2782 return ON_STACK_REPLACEMENT; |
| 2776 } | 2783 } |
| 2777 | 2784 |
| 2778 | 2785 |
| 2779 } // namespace internal | 2786 } // namespace internal |
| 2780 } // namespace v8 | 2787 } // namespace v8 |
| 2781 | 2788 |
| 2782 #endif // V8_TARGET_ARCH_IA32 | 2789 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |