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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 case VariableLocation::LOOKUP: { | 739 case VariableLocation::LOOKUP: { |
740 Comment cmnt(masm_, "[ VariableDeclaration"); | 740 Comment cmnt(masm_, "[ VariableDeclaration"); |
741 DCHECK_EQ(VAR, mode); | 741 DCHECK_EQ(VAR, mode); |
742 DCHECK(!hole_init); | 742 DCHECK(!hole_init); |
743 __ mov(r4, Operand(variable->name())); | 743 __ mov(r4, Operand(variable->name())); |
744 __ Push(r4); | 744 __ Push(r4); |
745 __ CallRuntime(Runtime::kDeclareEvalVar); | 745 __ CallRuntime(Runtime::kDeclareEvalVar); |
746 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 746 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
747 break; | 747 break; |
748 } | 748 } |
| 749 |
| 750 case VariableLocation::MODULE: |
| 751 UNREACHABLE(); |
749 } | 752 } |
750 } | 753 } |
751 | 754 |
752 void FullCodeGenerator::VisitFunctionDeclaration( | 755 void FullCodeGenerator::VisitFunctionDeclaration( |
753 FunctionDeclaration* declaration) { | 756 FunctionDeclaration* declaration) { |
754 VariableProxy* proxy = declaration->proxy(); | 757 VariableProxy* proxy = declaration->proxy(); |
755 Variable* variable = proxy->var(); | 758 Variable* variable = proxy->var(); |
756 switch (variable->location()) { | 759 switch (variable->location()) { |
757 case VariableLocation::GLOBAL: | 760 case VariableLocation::GLOBAL: |
758 case VariableLocation::UNALLOCATED: { | 761 case VariableLocation::UNALLOCATED: { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 case VariableLocation::LOOKUP: { | 795 case VariableLocation::LOOKUP: { |
793 Comment cmnt(masm_, "[ FunctionDeclaration"); | 796 Comment cmnt(masm_, "[ FunctionDeclaration"); |
794 __ mov(r4, Operand(variable->name())); | 797 __ mov(r4, Operand(variable->name())); |
795 PushOperand(r4); | 798 PushOperand(r4); |
796 // Push initial value for function declaration. | 799 // Push initial value for function declaration. |
797 VisitForStackValue(declaration->fun()); | 800 VisitForStackValue(declaration->fun()); |
798 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 801 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
799 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 802 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
800 break; | 803 break; |
801 } | 804 } |
| 805 |
| 806 case VariableLocation::MODULE: |
| 807 UNREACHABLE(); |
802 } | 808 } |
803 } | 809 } |
804 | 810 |
805 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 811 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
806 // Call the runtime to declare the globals. | 812 // Call the runtime to declare the globals. |
807 __ mov(r3, Operand(pairs)); | 813 __ mov(r3, Operand(pairs)); |
808 __ LoadSmiLiteral(r2, Smi::FromInt(DeclareGlobalsFlags())); | 814 __ LoadSmiLiteral(r2, Smi::FromInt(DeclareGlobalsFlags())); |
809 __ EmitLoadTypeFeedbackVector(r4); | 815 __ EmitLoadTypeFeedbackVector(r4); |
810 __ Push(r3, r2, r4); | 816 __ Push(r3, r2, r4); |
811 __ CallRuntime(Runtime::kDeclareGlobals); | 817 __ CallRuntime(Runtime::kDeclareGlobals); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); | 1282 EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done); |
1277 __ bind(&slow); | 1283 __ bind(&slow); |
1278 __ Push(var->name()); | 1284 __ Push(var->name()); |
1279 Runtime::FunctionId function_id = | 1285 Runtime::FunctionId function_id = |
1280 typeof_mode == NOT_INSIDE_TYPEOF | 1286 typeof_mode == NOT_INSIDE_TYPEOF |
1281 ? Runtime::kLoadLookupSlot | 1287 ? Runtime::kLoadLookupSlot |
1282 : Runtime::kLoadLookupSlotInsideTypeof; | 1288 : Runtime::kLoadLookupSlotInsideTypeof; |
1283 __ CallRuntime(function_id); | 1289 __ CallRuntime(function_id); |
1284 __ bind(&done); | 1290 __ bind(&done); |
1285 context()->Plug(r2); | 1291 context()->Plug(r2); |
| 1292 break; |
1286 } | 1293 } |
| 1294 |
| 1295 case VariableLocation::MODULE: |
| 1296 UNREACHABLE(); |
1287 } | 1297 } |
1288 } | 1298 } |
1289 | 1299 |
1290 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1300 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1291 Expression* expression = (property == NULL) ? NULL : property->value(); | 1301 Expression* expression = (property == NULL) ? NULL : property->value(); |
1292 if (expression == NULL) { | 1302 if (expression == NULL) { |
1293 __ LoadRoot(r3, Heap::kNullValueRootIndex); | 1303 __ LoadRoot(r3, Heap::kNullValueRootIndex); |
1294 PushOperand(r3); | 1304 PushOperand(r3); |
1295 } else { | 1305 } else { |
1296 VisitForStackValue(expression); | 1306 VisitForStackValue(expression); |
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3679 DCHECK(kOSRBranchInstruction == br_instr); | 3689 DCHECK(kOSRBranchInstruction == br_instr); |
3680 | 3690 |
3681 DCHECK(interrupt_address == | 3691 DCHECK(interrupt_address == |
3682 isolate->builtins()->OnStackReplacement()->entry()); | 3692 isolate->builtins()->OnStackReplacement()->entry()); |
3683 return ON_STACK_REPLACEMENT; | 3693 return ON_STACK_REPLACEMENT; |
3684 } | 3694 } |
3685 | 3695 |
3686 } // namespace internal | 3696 } // namespace internal |
3687 } // namespace v8 | 3697 } // namespace v8 |
3688 #endif // V8_TARGET_ARCH_S390 | 3698 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |