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 #include "src/crankshaft/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 | 1017 |
1018 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1018 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
1019 LOperand* context = UseFixed(instr->context(), rsi); | 1019 LOperand* context = UseFixed(instr->context(), rsi); |
1020 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); | 1020 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); |
1021 } | 1021 } |
1022 | 1022 |
1023 | 1023 |
1024 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1024 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1025 HCallWithDescriptor* instr) { | 1025 HCallWithDescriptor* instr) { |
1026 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1026 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 1027 DCHECK_EQ(descriptor.GetParameterCount() + |
| 1028 LCallWithDescriptor::kImplicitRegisterParameterCount, |
| 1029 instr->OperandCount()); |
1027 | 1030 |
1028 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1031 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1029 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1032 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
1030 // Target | 1033 // Target |
1031 ops.Add(target, zone()); | 1034 ops.Add(target, zone()); |
1032 // Context | 1035 // Context |
1033 LOperand* op = UseFixed(instr->OperandAt(1), rsi); | 1036 LOperand* op = UseFixed(instr->OperandAt(1), rsi); |
1034 ops.Add(op, zone()); | 1037 ops.Add(op, zone()); |
1035 // Other register parameters | 1038 // Load register parameters. |
1036 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; | 1039 int i = 0; |
1037 i < instr->OperandCount(); i++) { | 1040 for (; i < descriptor.GetRegisterParameterCount(); i++) { |
1038 op = | 1041 op = UseFixed(instr->OperandAt( |
1039 UseFixed(instr->OperandAt(i), | 1042 i + LCallWithDescriptor::kImplicitRegisterParameterCount), |
1040 descriptor.GetRegisterParameter( | 1043 descriptor.GetRegisterParameter(i)); |
1041 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | |
1042 ops.Add(op, zone()); | 1044 ops.Add(op, zone()); |
1043 } | 1045 } |
| 1046 // Push stack parameters. |
| 1047 for (; i < descriptor.GetParameterCount(); i++) { |
| 1048 op = UseAny(instr->OperandAt( |
| 1049 i + LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1050 AddInstruction(new (zone()) LPushArgument(op), instr); |
| 1051 } |
1044 | 1052 |
1045 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1053 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1046 descriptor, ops, zone()); | 1054 descriptor, ops, zone()); |
1047 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1055 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
1048 result->MarkAsSyntacticTailCall(); | 1056 result->MarkAsSyntacticTailCall(); |
1049 } | 1057 } |
1050 return MarkAsCall(DefineFixed(result, rax), instr); | 1058 return MarkAsCall(DefineFixed(result, rax), instr); |
1051 } | 1059 } |
1052 | 1060 |
1053 | 1061 |
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 LOperand* index = UseTempRegister(instr->index()); | 2525 LOperand* index = UseTempRegister(instr->index()); |
2518 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2526 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2519 LInstruction* result = DefineSameAsFirst(load); | 2527 LInstruction* result = DefineSameAsFirst(load); |
2520 return AssignPointerMap(result); | 2528 return AssignPointerMap(result); |
2521 } | 2529 } |
2522 | 2530 |
2523 } // namespace internal | 2531 } // namespace internal |
2524 } // namespace v8 | 2532 } // namespace v8 |
2525 | 2533 |
2526 #endif // V8_TARGET_ARCH_X64 | 2534 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |