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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 __ Check(not_equal, kDeclarationInCatchContext); | 703 __ Check(not_equal, kDeclarationInCatchContext); |
704 } | 704 } |
705 } | 705 } |
706 | 706 |
707 | 707 |
708 void FullCodeGenerator::VisitVariableDeclaration( | 708 void FullCodeGenerator::VisitVariableDeclaration( |
709 VariableDeclaration* declaration) { | 709 VariableDeclaration* declaration) { |
710 VariableProxy* proxy = declaration->proxy(); | 710 VariableProxy* proxy = declaration->proxy(); |
711 Variable* variable = proxy->var(); | 711 Variable* variable = proxy->var(); |
712 switch (variable->location()) { | 712 switch (variable->location()) { |
713 case VariableLocation::GLOBAL: | |
714 case VariableLocation::UNALLOCATED: { | 713 case VariableLocation::UNALLOCATED: { |
715 DCHECK(!variable->binding_needs_init()); | 714 DCHECK(!variable->binding_needs_init()); |
716 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 715 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
717 DCHECK(!slot.IsInvalid()); | 716 DCHECK(!slot.IsInvalid()); |
718 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 717 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
719 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 718 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
720 break; | 719 break; |
721 } | 720 } |
722 case VariableLocation::PARAMETER: | 721 case VariableLocation::PARAMETER: |
723 case VariableLocation::LOCAL: | 722 case VariableLocation::LOCAL: |
(...skipping 28 matching lines...) Expand all Loading... |
752 case VariableLocation::MODULE: | 751 case VariableLocation::MODULE: |
753 UNREACHABLE(); | 752 UNREACHABLE(); |
754 } | 753 } |
755 } | 754 } |
756 | 755 |
757 void FullCodeGenerator::VisitFunctionDeclaration( | 756 void FullCodeGenerator::VisitFunctionDeclaration( |
758 FunctionDeclaration* declaration) { | 757 FunctionDeclaration* declaration) { |
759 VariableProxy* proxy = declaration->proxy(); | 758 VariableProxy* proxy = declaration->proxy(); |
760 Variable* variable = proxy->var(); | 759 Variable* variable = proxy->var(); |
761 switch (variable->location()) { | 760 switch (variable->location()) { |
762 case VariableLocation::GLOBAL: | |
763 case VariableLocation::UNALLOCATED: { | 761 case VariableLocation::UNALLOCATED: { |
764 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 762 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
765 DCHECK(!slot.IsInvalid()); | 763 DCHECK(!slot.IsInvalid()); |
766 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 764 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
767 Handle<SharedFunctionInfo> function = | 765 Handle<SharedFunctionInfo> function = |
768 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 766 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
769 // Check for stack-overflow exception. | 767 // Check for stack-overflow exception. |
770 if (function.is_null()) return SetStackOverflow(); | 768 if (function.is_null()) return SetStackOverflow(); |
771 globals_->Add(function, zone()); | 769 globals_->Add(function, zone()); |
772 break; | 770 break; |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 | 1192 |
1195 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1193 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
1196 TypeofMode typeof_mode) { | 1194 TypeofMode typeof_mode) { |
1197 SetExpressionPosition(proxy); | 1195 SetExpressionPosition(proxy); |
1198 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1196 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
1199 Variable* var = proxy->var(); | 1197 Variable* var = proxy->var(); |
1200 | 1198 |
1201 // Three cases: global variables, lookup variables, and all other types of | 1199 // Three cases: global variables, lookup variables, and all other types of |
1202 // variables. | 1200 // variables. |
1203 switch (var->location()) { | 1201 switch (var->location()) { |
1204 case VariableLocation::GLOBAL: | |
1205 case VariableLocation::UNALLOCATED: { | 1202 case VariableLocation::UNALLOCATED: { |
1206 Comment cmnt(masm_, "[ Global variable"); | 1203 Comment cmnt(masm_, "[ Global variable"); |
1207 EmitGlobalVariableLoad(proxy, typeof_mode); | 1204 EmitGlobalVariableLoad(proxy, typeof_mode); |
1208 context()->Plug(eax); | 1205 context()->Plug(eax); |
1209 break; | 1206 break; |
1210 } | 1207 } |
1211 | 1208 |
1212 case VariableLocation::PARAMETER: | 1209 case VariableLocation::PARAMETER: |
1213 case VariableLocation::LOCAL: | 1210 case VariableLocation::LOCAL: |
1214 case VariableLocation::CONTEXT: { | 1211 case VariableLocation::CONTEXT: { |
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3634 isolate->builtins()->OnStackReplacement()->entry(), | 3631 isolate->builtins()->OnStackReplacement()->entry(), |
3635 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3632 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3636 return ON_STACK_REPLACEMENT; | 3633 return ON_STACK_REPLACEMENT; |
3637 } | 3634 } |
3638 | 3635 |
3639 | 3636 |
3640 } // namespace internal | 3637 } // namespace internal |
3641 } // namespace v8 | 3638 } // namespace v8 |
3642 | 3639 |
3643 #endif // V8_TARGET_ARCH_X87 | 3640 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |