| 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/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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 VariableProxy* proxy = declaration->proxy(); | 699 VariableProxy* proxy = declaration->proxy(); |
| 700 Variable* variable = proxy->var(); | 700 Variable* variable = proxy->var(); |
| 701 switch (variable->location()) { | 701 switch (variable->location()) { |
| 702 case VariableLocation::UNALLOCATED: { | 702 case VariableLocation::UNALLOCATED: { |
| 703 DCHECK(!variable->binding_needs_init()); | 703 DCHECK(!variable->binding_needs_init()); |
| 704 globals_->Add(variable->name(), zone()); | 704 globals_->Add(variable->name(), zone()); |
| 705 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 705 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 706 DCHECK(!slot.IsInvalid()); | 706 DCHECK(!slot.IsInvalid()); |
| 707 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 707 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 708 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 708 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 709 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 709 break; | 710 break; |
| 710 } | 711 } |
| 711 case VariableLocation::PARAMETER: | 712 case VariableLocation::PARAMETER: |
| 712 case VariableLocation::LOCAL: | 713 case VariableLocation::LOCAL: |
| 713 if (variable->binding_needs_init()) { | 714 if (variable->binding_needs_init()) { |
| 714 Comment cmnt(masm_, "[ VariableDeclaration"); | 715 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 715 __ mov(StackOperand(variable), | 716 __ mov(StackOperand(variable), |
| 716 Immediate(isolate()->factory()->the_hole_value())); | 717 Immediate(isolate()->factory()->the_hole_value())); |
| 717 } | 718 } |
| 718 break; | 719 break; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 737 void FullCodeGenerator::VisitFunctionDeclaration( | 738 void FullCodeGenerator::VisitFunctionDeclaration( |
| 738 FunctionDeclaration* declaration) { | 739 FunctionDeclaration* declaration) { |
| 739 VariableProxy* proxy = declaration->proxy(); | 740 VariableProxy* proxy = declaration->proxy(); |
| 740 Variable* variable = proxy->var(); | 741 Variable* variable = proxy->var(); |
| 741 switch (variable->location()) { | 742 switch (variable->location()) { |
| 742 case VariableLocation::UNALLOCATED: { | 743 case VariableLocation::UNALLOCATED: { |
| 743 globals_->Add(variable->name(), zone()); | 744 globals_->Add(variable->name(), zone()); |
| 744 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 745 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 745 DCHECK(!slot.IsInvalid()); | 746 DCHECK(!slot.IsInvalid()); |
| 746 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 747 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 748 |
| 749 // We need the slot where the literals array lives, too. |
| 750 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 751 DCHECK(!slot.IsInvalid()); |
| 752 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 753 |
| 747 Handle<SharedFunctionInfo> function = | 754 Handle<SharedFunctionInfo> function = |
| 748 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 755 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 749 // Check for stack-overflow exception. | 756 // Check for stack-overflow exception. |
| 750 if (function.is_null()) return SetStackOverflow(); | 757 if (function.is_null()) return SetStackOverflow(); |
| 751 globals_->Add(function, zone()); | 758 globals_->Add(function, zone()); |
| 752 break; | 759 break; |
| 753 } | 760 } |
| 754 | 761 |
| 755 case VariableLocation::PARAMETER: | 762 case VariableLocation::PARAMETER: |
| 756 case VariableLocation::LOCAL: { | 763 case VariableLocation::LOCAL: { |
| (...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 isolate->builtins()->OnStackReplacement()->entry(), | 2772 isolate->builtins()->OnStackReplacement()->entry(), |
| 2766 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2773 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 2767 return ON_STACK_REPLACEMENT; | 2774 return ON_STACK_REPLACEMENT; |
| 2768 } | 2775 } |
| 2769 | 2776 |
| 2770 | 2777 |
| 2771 } // namespace internal | 2778 } // namespace internal |
| 2772 } // namespace v8 | 2779 } // namespace v8 |
| 2773 | 2780 |
| 2774 #endif // V8_TARGET_ARCH_X87 | 2781 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |