| 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 #include "src/crankshaft/arm64/lithium-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-arm64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" | 9 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 return AssignEnvironment( | 956 return AssignEnvironment( |
| 957 new(zone()) LBranch(UseRegister(value), temp1, temp2)); | 957 new(zone()) LBranch(UseRegister(value), temp1, temp2)); |
| 958 } | 958 } |
| 959 } | 959 } |
| 960 } | 960 } |
| 961 | 961 |
| 962 | 962 |
| 963 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 963 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
| 964 HCallWithDescriptor* instr) { | 964 HCallWithDescriptor* instr) { |
| 965 CallInterfaceDescriptor descriptor = instr->descriptor(); | 965 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 966 DCHECK_EQ(descriptor.GetParameterCount() + |
| 967 LCallWithDescriptor::kImplicitRegisterParameterCount, |
| 968 instr->OperandCount()); |
| 966 | 969 |
| 967 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 970 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
| 968 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 971 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 969 // Target | 972 // Target |
| 970 ops.Add(target, zone()); | 973 ops.Add(target, zone()); |
| 971 // Context | 974 // Context |
| 972 LOperand* op = UseFixed(instr->OperandAt(1), cp); | 975 LOperand* op = UseFixed(instr->OperandAt(1), cp); |
| 973 ops.Add(op, zone()); | 976 ops.Add(op, zone()); |
| 974 // Other register parameters | 977 // Load register parameters. |
| 975 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; | 978 int i = 0; |
| 976 i < instr->OperandCount(); i++) { | 979 for (; i < descriptor.GetRegisterParameterCount(); i++) { |
| 977 op = | 980 op = UseFixed(instr->OperandAt( |
| 978 UseFixed(instr->OperandAt(i), | 981 i + LCallWithDescriptor::kImplicitRegisterParameterCount), |
| 979 descriptor.GetRegisterParameter( | 982 descriptor.GetRegisterParameter(i)); |
| 980 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | |
| 981 ops.Add(op, zone()); | 983 ops.Add(op, zone()); |
| 982 } | 984 } |
| 985 // Push stack parameters. |
| 986 if (i < descriptor.GetParameterCount()) { |
| 987 int argc = descriptor.GetParameterCount() - i; |
| 988 AddInstruction(new (zone()) LPreparePushArguments(argc), instr); |
| 989 LPushArguments* push_args = new (zone()) LPushArguments(zone()); |
| 990 for (; i < descriptor.GetParameterCount(); i++) { |
| 991 if (push_args->ShouldSplitPush()) { |
| 992 AddInstruction(push_args, instr); |
| 993 push_args = new (zone()) LPushArguments(zone()); |
| 994 } |
| 995 op = UseRegisterAtStart(instr->OperandAt( |
| 996 i + LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 997 push_args->AddArgument(op); |
| 998 } |
| 999 AddInstruction(push_args, instr); |
| 1000 } |
| 983 | 1001 |
| 984 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(descriptor, | 1002 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(descriptor, |
| 985 ops, | 1003 ops, |
| 986 zone()); | 1004 zone()); |
| 987 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1005 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
| 988 result->MarkAsSyntacticTailCall(); | 1006 result->MarkAsSyntacticTailCall(); |
| 989 } | 1007 } |
| 990 return MarkAsCall(DefineFixed(result, x0), instr); | 1008 return MarkAsCall(DefineFixed(result, x0), instr); |
| 991 } | 1009 } |
| 992 | 1010 |
| (...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 | 2550 |
| 2533 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2551 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 2534 LOperand* receiver = UseRegister(instr->receiver()); | 2552 LOperand* receiver = UseRegister(instr->receiver()); |
| 2535 LOperand* function = UseRegister(instr->function()); | 2553 LOperand* function = UseRegister(instr->function()); |
| 2536 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 2554 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
| 2537 return AssignEnvironment(DefineAsRegister(result)); | 2555 return AssignEnvironment(DefineAsRegister(result)); |
| 2538 } | 2556 } |
| 2539 | 2557 |
| 2540 } // namespace internal | 2558 } // namespace internal |
| 2541 } // namespace v8 | 2559 } // namespace v8 |
| OLD | NEW |