| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 738 } |
| 739 | 739 |
| 740 | 740 |
| 741 void FullCodeGenerator::VisitVariableDeclaration( | 741 void FullCodeGenerator::VisitVariableDeclaration( |
| 742 VariableDeclaration* declaration) { | 742 VariableDeclaration* declaration) { |
| 743 VariableProxy* proxy = declaration->proxy(); | 743 VariableProxy* proxy = declaration->proxy(); |
| 744 Variable* variable = proxy->var(); | 744 Variable* variable = proxy->var(); |
| 745 switch (variable->location()) { | 745 switch (variable->location()) { |
| 746 case VariableLocation::UNALLOCATED: { | 746 case VariableLocation::UNALLOCATED: { |
| 747 DCHECK(!variable->binding_needs_init()); | 747 DCHECK(!variable->binding_needs_init()); |
| 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()); |
| 751 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 752 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 752 break; | 753 break; |
| 753 } | 754 } |
| 754 case VariableLocation::PARAMETER: | 755 case VariableLocation::PARAMETER: |
| 755 case VariableLocation::LOCAL: | 756 case VariableLocation::LOCAL: |
| 756 if (variable->binding_needs_init()) { | 757 if (variable->binding_needs_init()) { |
| 757 Comment cmnt(masm_, "[ VariableDeclaration"); | 758 Comment cmnt(masm_, "[ VariableDeclaration"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 786 } | 787 } |
| 787 } | 788 } |
| 788 | 789 |
| 789 | 790 |
| 790 void FullCodeGenerator::VisitFunctionDeclaration( | 791 void FullCodeGenerator::VisitFunctionDeclaration( |
| 791 FunctionDeclaration* declaration) { | 792 FunctionDeclaration* declaration) { |
| 792 VariableProxy* proxy = declaration->proxy(); | 793 VariableProxy* proxy = declaration->proxy(); |
| 793 Variable* variable = proxy->var(); | 794 Variable* variable = proxy->var(); |
| 794 switch (variable->location()) { | 795 switch (variable->location()) { |
| 795 case VariableLocation::UNALLOCATED: { | 796 case VariableLocation::UNALLOCATED: { |
| 797 globals_->Add(variable->name(), zone()); |
| 796 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 798 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 797 DCHECK(!slot.IsInvalid()); | 799 DCHECK(!slot.IsInvalid()); |
| 798 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 800 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 799 Handle<SharedFunctionInfo> function = | 801 Handle<SharedFunctionInfo> function = |
| 800 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 802 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 801 // Check for stack-overflow exception. | 803 // Check for stack-overflow exception. |
| 802 if (function.is_null()) return SetStackOverflow(); | 804 if (function.is_null()) return SetStackOverflow(); |
| 803 globals_->Add(function, zone()); | 805 globals_->Add(function, zone()); |
| 804 break; | 806 break; |
| 805 } | 807 } |
| (...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 DCHECK_EQ( | 3515 DCHECK_EQ( |
| 3514 isolate->builtins()->OnStackReplacement()->entry(), | 3516 isolate->builtins()->OnStackReplacement()->entry(), |
| 3515 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3517 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3516 return ON_STACK_REPLACEMENT; | 3518 return ON_STACK_REPLACEMENT; |
| 3517 } | 3519 } |
| 3518 | 3520 |
| 3519 } // namespace internal | 3521 } // namespace internal |
| 3520 } // namespace v8 | 3522 } // namespace v8 |
| 3521 | 3523 |
| 3522 #endif // V8_TARGET_ARCH_X64 | 3524 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |