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/ia32/lithium-ia32.h" | 5 #include "src/crankshaft/ia32/lithium-ia32.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 | 1029 |
1030 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1030 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
1031 LOperand* context = UseFixed(instr->context(), esi); | 1031 LOperand* context = UseFixed(instr->context(), esi); |
1032 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); | 1032 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); |
1033 } | 1033 } |
1034 | 1034 |
1035 | 1035 |
1036 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1036 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1037 HCallWithDescriptor* instr) { | 1037 HCallWithDescriptor* instr) { |
1038 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1038 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 1039 DCHECK_EQ(descriptor.GetParameterCount() + |
| 1040 LCallWithDescriptor::kImplicitRegisterParameterCount, |
| 1041 instr->OperandCount()); |
| 1042 |
1039 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1043 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1040 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1044 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
1041 // Target | 1045 // Target |
1042 ops.Add(target, zone()); | 1046 ops.Add(target, zone()); |
1043 // Context | 1047 // Context |
1044 LOperand* op = UseFixed(instr->OperandAt(1), esi); | 1048 LOperand* op = UseFixed(instr->OperandAt(1), esi); |
1045 ops.Add(op, zone()); | 1049 ops.Add(op, zone()); |
1046 // Other register parameters | 1050 // Load register parameters. |
1047 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; | 1051 int i = 0; |
1048 i < instr->OperandCount(); i++) { | 1052 for (; i < descriptor.GetRegisterParameterCount(); i++) { |
1049 op = | 1053 op = UseFixed(instr->OperandAt( |
1050 UseFixed(instr->OperandAt(i), | 1054 i + LCallWithDescriptor::kImplicitRegisterParameterCount), |
1051 descriptor.GetRegisterParameter( | 1055 descriptor.GetRegisterParameter(i)); |
1052 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | |
1053 ops.Add(op, zone()); | 1056 ops.Add(op, zone()); |
1054 } | 1057 } |
| 1058 // Push stack parameters. |
| 1059 for (; i < descriptor.GetParameterCount(); i++) { |
| 1060 op = UseAny(instr->OperandAt( |
| 1061 i + LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1062 AddInstruction(new (zone()) LPushArgument(op), instr); |
| 1063 } |
1055 | 1064 |
1056 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1065 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1057 descriptor, ops, zone()); | 1066 descriptor, ops, zone()); |
1058 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1067 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
1059 result->MarkAsSyntacticTailCall(); | 1068 result->MarkAsSyntacticTailCall(); |
1060 } | 1069 } |
1061 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1070 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1062 } | 1071 } |
1063 | 1072 |
1064 | 1073 |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 LOperand* index = UseTempRegister(instr->index()); | 2520 LOperand* index = UseTempRegister(instr->index()); |
2512 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2521 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2513 LInstruction* result = DefineSameAsFirst(load); | 2522 LInstruction* result = DefineSameAsFirst(load); |
2514 return AssignPointerMap(result); | 2523 return AssignPointerMap(result); |
2515 } | 2524 } |
2516 | 2525 |
2517 } // namespace internal | 2526 } // namespace internal |
2518 } // namespace v8 | 2527 } // namespace v8 |
2519 | 2528 |
2520 #endif // V8_TARGET_ARCH_IA32 | 2529 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |