| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 __ CompareRoot(r3, Heap::kCatchContextMapRootIndex); | 696 __ CompareRoot(r3, Heap::kCatchContextMapRootIndex); |
| 697 __ Check(ne, kDeclarationInCatchContext); | 697 __ Check(ne, kDeclarationInCatchContext); |
| 698 } | 698 } |
| 699 } | 699 } |
| 700 | 700 |
| 701 void FullCodeGenerator::VisitVariableDeclaration( | 701 void FullCodeGenerator::VisitVariableDeclaration( |
| 702 VariableDeclaration* declaration) { | 702 VariableDeclaration* declaration) { |
| 703 VariableProxy* proxy = declaration->proxy(); | 703 VariableProxy* proxy = declaration->proxy(); |
| 704 Variable* variable = proxy->var(); | 704 Variable* variable = proxy->var(); |
| 705 switch (variable->location()) { | 705 switch (variable->location()) { |
| 706 case VariableLocation::GLOBAL: | |
| 707 case VariableLocation::UNALLOCATED: { | 706 case VariableLocation::UNALLOCATED: { |
| 708 DCHECK(!variable->binding_needs_init()); | 707 DCHECK(!variable->binding_needs_init()); |
| 709 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 708 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 710 DCHECK(!slot.IsInvalid()); | 709 DCHECK(!slot.IsInvalid()); |
| 711 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 710 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 712 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 711 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 713 break; | 712 break; |
| 714 } | 713 } |
| 715 case VariableLocation::PARAMETER: | 714 case VariableLocation::PARAMETER: |
| 716 case VariableLocation::LOCAL: | 715 case VariableLocation::LOCAL: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 746 case VariableLocation::MODULE: | 745 case VariableLocation::MODULE: |
| 747 UNREACHABLE(); | 746 UNREACHABLE(); |
| 748 } | 747 } |
| 749 } | 748 } |
| 750 | 749 |
| 751 void FullCodeGenerator::VisitFunctionDeclaration( | 750 void FullCodeGenerator::VisitFunctionDeclaration( |
| 752 FunctionDeclaration* declaration) { | 751 FunctionDeclaration* declaration) { |
| 753 VariableProxy* proxy = declaration->proxy(); | 752 VariableProxy* proxy = declaration->proxy(); |
| 754 Variable* variable = proxy->var(); | 753 Variable* variable = proxy->var(); |
| 755 switch (variable->location()) { | 754 switch (variable->location()) { |
| 756 case VariableLocation::GLOBAL: | |
| 757 case VariableLocation::UNALLOCATED: { | 755 case VariableLocation::UNALLOCATED: { |
| 758 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 756 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 759 DCHECK(!slot.IsInvalid()); | 757 DCHECK(!slot.IsInvalid()); |
| 760 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 758 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 761 Handle<SharedFunctionInfo> function = | 759 Handle<SharedFunctionInfo> function = |
| 762 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 760 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 763 // Check for stack-overflow exception. | 761 // Check for stack-overflow exception. |
| 764 if (function.is_null()) return SetStackOverflow(); | 762 if (function.is_null()) return SetStackOverflow(); |
| 765 globals_->Add(function, zone()); | 763 globals_->Add(function, zone()); |
| 766 break; | 764 break; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1205 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1208 TypeofMode typeof_mode) { | 1206 TypeofMode typeof_mode) { |
| 1209 // Record position before possible IC call. | 1207 // Record position before possible IC call. |
| 1210 SetExpressionPosition(proxy); | 1208 SetExpressionPosition(proxy); |
| 1211 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1209 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
| 1212 Variable* var = proxy->var(); | 1210 Variable* var = proxy->var(); |
| 1213 | 1211 |
| 1214 // Three cases: global variables, lookup variables, and all other types of | 1212 // Three cases: global variables, lookup variables, and all other types of |
| 1215 // variables. | 1213 // variables. |
| 1216 switch (var->location()) { | 1214 switch (var->location()) { |
| 1217 case VariableLocation::GLOBAL: | |
| 1218 case VariableLocation::UNALLOCATED: { | 1215 case VariableLocation::UNALLOCATED: { |
| 1219 Comment cmnt(masm_, "[ Global variable"); | 1216 Comment cmnt(masm_, "[ Global variable"); |
| 1220 EmitGlobalVariableLoad(proxy, typeof_mode); | 1217 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1221 context()->Plug(r2); | 1218 context()->Plug(r2); |
| 1222 break; | 1219 break; |
| 1223 } | 1220 } |
| 1224 | 1221 |
| 1225 case VariableLocation::PARAMETER: | 1222 case VariableLocation::PARAMETER: |
| 1226 case VariableLocation::LOCAL: | 1223 case VariableLocation::LOCAL: |
| 1227 case VariableLocation::CONTEXT: { | 1224 case VariableLocation::CONTEXT: { |
| (...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3646 DCHECK(kOSRBranchInstruction == br_instr); | 3643 DCHECK(kOSRBranchInstruction == br_instr); |
| 3647 | 3644 |
| 3648 DCHECK(interrupt_address == | 3645 DCHECK(interrupt_address == |
| 3649 isolate->builtins()->OnStackReplacement()->entry()); | 3646 isolate->builtins()->OnStackReplacement()->entry()); |
| 3650 return ON_STACK_REPLACEMENT; | 3647 return ON_STACK_REPLACEMENT; |
| 3651 } | 3648 } |
| 3652 | 3649 |
| 3653 } // namespace internal | 3650 } // namespace internal |
| 3654 } // namespace v8 | 3651 } // namespace v8 |
| 3655 #endif // V8_TARGET_ARCH_S390 | 3652 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |