| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 __ Check(ne, kDeclarationInCatchContext); | 754 __ Check(ne, kDeclarationInCatchContext); |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 | 757 |
| 758 | 758 |
| 759 void FullCodeGenerator::VisitVariableDeclaration( | 759 void FullCodeGenerator::VisitVariableDeclaration( |
| 760 VariableDeclaration* declaration) { | 760 VariableDeclaration* declaration) { |
| 761 VariableProxy* proxy = declaration->proxy(); | 761 VariableProxy* proxy = declaration->proxy(); |
| 762 Variable* variable = proxy->var(); | 762 Variable* variable = proxy->var(); |
| 763 switch (variable->location()) { | 763 switch (variable->location()) { |
| 764 case VariableLocation::GLOBAL: | |
| 765 case VariableLocation::UNALLOCATED: { | 764 case VariableLocation::UNALLOCATED: { |
| 766 DCHECK(!variable->binding_needs_init()); | 765 DCHECK(!variable->binding_needs_init()); |
| 767 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 766 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 768 DCHECK(!slot.IsInvalid()); | 767 DCHECK(!slot.IsInvalid()); |
| 769 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 768 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 770 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 769 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 771 break; | 770 break; |
| 772 } | 771 } |
| 773 case VariableLocation::PARAMETER: | 772 case VariableLocation::PARAMETER: |
| 774 case VariableLocation::LOCAL: | 773 case VariableLocation::LOCAL: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 805 UNREACHABLE(); | 804 UNREACHABLE(); |
| 806 } | 805 } |
| 807 } | 806 } |
| 808 | 807 |
| 809 | 808 |
| 810 void FullCodeGenerator::VisitFunctionDeclaration( | 809 void FullCodeGenerator::VisitFunctionDeclaration( |
| 811 FunctionDeclaration* declaration) { | 810 FunctionDeclaration* declaration) { |
| 812 VariableProxy* proxy = declaration->proxy(); | 811 VariableProxy* proxy = declaration->proxy(); |
| 813 Variable* variable = proxy->var(); | 812 Variable* variable = proxy->var(); |
| 814 switch (variable->location()) { | 813 switch (variable->location()) { |
| 815 case VariableLocation::GLOBAL: | |
| 816 case VariableLocation::UNALLOCATED: { | 814 case VariableLocation::UNALLOCATED: { |
| 817 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 815 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 818 DCHECK(!slot.IsInvalid()); | 816 DCHECK(!slot.IsInvalid()); |
| 819 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 817 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 820 Handle<SharedFunctionInfo> function = | 818 Handle<SharedFunctionInfo> function = |
| 821 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 819 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 822 // Check for stack overflow exception. | 820 // Check for stack overflow exception. |
| 823 if (function.is_null()) return SetStackOverflow(); | 821 if (function.is_null()) return SetStackOverflow(); |
| 824 globals_->Add(function, zone()); | 822 globals_->Add(function, zone()); |
| 825 break; | 823 break; |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1266 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1269 TypeofMode typeof_mode) { | 1267 TypeofMode typeof_mode) { |
| 1270 // Record position before possible IC call. | 1268 // Record position before possible IC call. |
| 1271 SetExpressionPosition(proxy); | 1269 SetExpressionPosition(proxy); |
| 1272 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1270 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
| 1273 Variable* var = proxy->var(); | 1271 Variable* var = proxy->var(); |
| 1274 | 1272 |
| 1275 // Three cases: global variables, lookup variables, and all other types of | 1273 // Three cases: global variables, lookup variables, and all other types of |
| 1276 // variables. | 1274 // variables. |
| 1277 switch (var->location()) { | 1275 switch (var->location()) { |
| 1278 case VariableLocation::GLOBAL: | |
| 1279 case VariableLocation::UNALLOCATED: { | 1276 case VariableLocation::UNALLOCATED: { |
| 1280 Comment cmnt(masm_, "Global variable"); | 1277 Comment cmnt(masm_, "Global variable"); |
| 1281 EmitGlobalVariableLoad(proxy, typeof_mode); | 1278 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1282 context()->Plug(x0); | 1279 context()->Plug(x0); |
| 1283 break; | 1280 break; |
| 1284 } | 1281 } |
| 1285 | 1282 |
| 1286 case VariableLocation::PARAMETER: | 1283 case VariableLocation::PARAMETER: |
| 1287 case VariableLocation::LOCAL: | 1284 case VariableLocation::LOCAL: |
| 1288 case VariableLocation::CONTEXT: { | 1285 case VariableLocation::CONTEXT: { |
| (...skipping 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3822 } | 3819 } |
| 3823 | 3820 |
| 3824 return INTERRUPT; | 3821 return INTERRUPT; |
| 3825 } | 3822 } |
| 3826 | 3823 |
| 3827 | 3824 |
| 3828 } // namespace internal | 3825 } // namespace internal |
| 3829 } // namespace v8 | 3826 } // namespace v8 |
| 3830 | 3827 |
| 3831 #endif // V8_TARGET_ARCH_ARM64 | 3828 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |