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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 724 } |
725 | 725 |
726 | 726 |
727 void FullCodeGenerator::VisitVariableDeclaration( | 727 void FullCodeGenerator::VisitVariableDeclaration( |
728 VariableDeclaration* declaration) { | 728 VariableDeclaration* declaration) { |
729 VariableProxy* proxy = declaration->proxy(); | 729 VariableProxy* proxy = declaration->proxy(); |
730 Variable* variable = proxy->var(); | 730 Variable* variable = proxy->var(); |
731 switch (variable->location()) { | 731 switch (variable->location()) { |
732 case VariableLocation::UNALLOCATED: { | 732 case VariableLocation::UNALLOCATED: { |
733 DCHECK(!variable->binding_needs_init()); | 733 DCHECK(!variable->binding_needs_init()); |
| 734 globals_->Add(variable->name(), zone()); |
734 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 735 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
735 DCHECK(!slot.IsInvalid()); | 736 DCHECK(!slot.IsInvalid()); |
736 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 737 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
737 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 738 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
738 break; | 739 break; |
739 } | 740 } |
740 case VariableLocation::PARAMETER: | 741 case VariableLocation::PARAMETER: |
741 case VariableLocation::LOCAL: | 742 case VariableLocation::LOCAL: |
742 if (variable->binding_needs_init()) { | 743 if (variable->binding_needs_init()) { |
743 Comment cmnt(masm_, "[ VariableDeclaration"); | 744 Comment cmnt(masm_, "[ VariableDeclaration"); |
(...skipping 28 matching lines...) Expand all Loading... |
772 } | 773 } |
773 } | 774 } |
774 | 775 |
775 | 776 |
776 void FullCodeGenerator::VisitFunctionDeclaration( | 777 void FullCodeGenerator::VisitFunctionDeclaration( |
777 FunctionDeclaration* declaration) { | 778 FunctionDeclaration* declaration) { |
778 VariableProxy* proxy = declaration->proxy(); | 779 VariableProxy* proxy = declaration->proxy(); |
779 Variable* variable = proxy->var(); | 780 Variable* variable = proxy->var(); |
780 switch (variable->location()) { | 781 switch (variable->location()) { |
781 case VariableLocation::UNALLOCATED: { | 782 case VariableLocation::UNALLOCATED: { |
| 783 globals_->Add(variable->name(), zone()); |
782 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 784 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
783 DCHECK(!slot.IsInvalid()); | 785 DCHECK(!slot.IsInvalid()); |
784 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 786 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
785 Handle<SharedFunctionInfo> function = | 787 Handle<SharedFunctionInfo> function = |
786 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 788 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
787 // Check for stack-overflow exception. | 789 // Check for stack-overflow exception. |
788 if (function.is_null()) return SetStackOverflow(); | 790 if (function.is_null()) return SetStackOverflow(); |
789 globals_->Add(function, zone()); | 791 globals_->Add(function, zone()); |
790 break; | 792 break; |
791 } | 793 } |
(...skipping 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3525 isolate->builtins()->OnStackReplacement()->entry(), | 3527 isolate->builtins()->OnStackReplacement()->entry(), |
3526 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3528 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3527 return ON_STACK_REPLACEMENT; | 3529 return ON_STACK_REPLACEMENT; |
3528 } | 3530 } |
3529 | 3531 |
3530 | 3532 |
3531 } // namespace internal | 3533 } // namespace internal |
3532 } // namespace v8 | 3534 } // namespace v8 |
3533 | 3535 |
3534 #endif // V8_TARGET_ARCH_IA32 | 3536 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |