| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 __ Check(ne, kDeclarationInCatchContext); | 758 __ Check(ne, kDeclarationInCatchContext); |
| 759 } | 759 } |
| 760 } | 760 } |
| 761 | 761 |
| 762 | 762 |
| 763 void FullCodeGenerator::VisitVariableDeclaration( | 763 void FullCodeGenerator::VisitVariableDeclaration( |
| 764 VariableDeclaration* declaration) { | 764 VariableDeclaration* declaration) { |
| 765 VariableProxy* proxy = declaration->proxy(); | 765 VariableProxy* proxy = declaration->proxy(); |
| 766 Variable* variable = proxy->var(); | 766 Variable* variable = proxy->var(); |
| 767 switch (variable->location()) { | 767 switch (variable->location()) { |
| 768 case VariableLocation::GLOBAL: | |
| 769 case VariableLocation::UNALLOCATED: { | 768 case VariableLocation::UNALLOCATED: { |
| 770 DCHECK(!variable->binding_needs_init()); | 769 DCHECK(!variable->binding_needs_init()); |
| 771 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 770 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 772 DCHECK(!slot.IsInvalid()); | 771 DCHECK(!slot.IsInvalid()); |
| 773 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 772 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 774 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 773 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 775 break; | 774 break; |
| 776 } | 775 } |
| 777 case VariableLocation::PARAMETER: | 776 case VariableLocation::PARAMETER: |
| 778 case VariableLocation::LOCAL: | 777 case VariableLocation::LOCAL: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 809 UNREACHABLE(); | 808 UNREACHABLE(); |
| 810 } | 809 } |
| 811 } | 810 } |
| 812 | 811 |
| 813 | 812 |
| 814 void FullCodeGenerator::VisitFunctionDeclaration( | 813 void FullCodeGenerator::VisitFunctionDeclaration( |
| 815 FunctionDeclaration* declaration) { | 814 FunctionDeclaration* declaration) { |
| 816 VariableProxy* proxy = declaration->proxy(); | 815 VariableProxy* proxy = declaration->proxy(); |
| 817 Variable* variable = proxy->var(); | 816 Variable* variable = proxy->var(); |
| 818 switch (variable->location()) { | 817 switch (variable->location()) { |
| 819 case VariableLocation::GLOBAL: | |
| 820 case VariableLocation::UNALLOCATED: { | 818 case VariableLocation::UNALLOCATED: { |
| 821 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 819 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 822 DCHECK(!slot.IsInvalid()); | 820 DCHECK(!slot.IsInvalid()); |
| 823 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 821 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 824 Handle<SharedFunctionInfo> function = | 822 Handle<SharedFunctionInfo> function = |
| 825 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 823 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 826 // Check for stack-overflow exception. | 824 // Check for stack-overflow exception. |
| 827 if (function.is_null()) return SetStackOverflow(); | 825 if (function.is_null()) return SetStackOverflow(); |
| 828 globals_->Add(function, zone()); | 826 globals_->Add(function, zone()); |
| 829 break; | 827 break; |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1279 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1282 TypeofMode typeof_mode) { | 1280 TypeofMode typeof_mode) { |
| 1283 // Record position before possible IC call. | 1281 // Record position before possible IC call. |
| 1284 SetExpressionPosition(proxy); | 1282 SetExpressionPosition(proxy); |
| 1285 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1283 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
| 1286 Variable* var = proxy->var(); | 1284 Variable* var = proxy->var(); |
| 1287 | 1285 |
| 1288 // Three cases: global variables, lookup variables, and all other types of | 1286 // Three cases: global variables, lookup variables, and all other types of |
| 1289 // variables. | 1287 // variables. |
| 1290 switch (var->location()) { | 1288 switch (var->location()) { |
| 1291 case VariableLocation::GLOBAL: | |
| 1292 case VariableLocation::UNALLOCATED: { | 1289 case VariableLocation::UNALLOCATED: { |
| 1293 Comment cmnt(masm_, "[ Global variable"); | 1290 Comment cmnt(masm_, "[ Global variable"); |
| 1294 EmitGlobalVariableLoad(proxy, typeof_mode); | 1291 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1295 context()->Plug(r0); | 1292 context()->Plug(r0); |
| 1296 break; | 1293 break; |
| 1297 } | 1294 } |
| 1298 | 1295 |
| 1299 case VariableLocation::PARAMETER: | 1296 case VariableLocation::PARAMETER: |
| 1300 case VariableLocation::LOCAL: | 1297 case VariableLocation::LOCAL: |
| 1301 case VariableLocation::CONTEXT: { | 1298 case VariableLocation::CONTEXT: { |
| (...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3812 DCHECK(interrupt_address == | 3809 DCHECK(interrupt_address == |
| 3813 isolate->builtins()->OnStackReplacement()->entry()); | 3810 isolate->builtins()->OnStackReplacement()->entry()); |
| 3814 return ON_STACK_REPLACEMENT; | 3811 return ON_STACK_REPLACEMENT; |
| 3815 } | 3812 } |
| 3816 | 3813 |
| 3817 | 3814 |
| 3818 } // namespace internal | 3815 } // namespace internal |
| 3819 } // namespace v8 | 3816 } // namespace v8 |
| 3820 | 3817 |
| 3821 #endif // V8_TARGET_ARCH_ARM | 3818 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |