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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/ia32/lithium-codegen-ia32.h" | 10 #include "src/ia32/lithium-codegen-ia32.h" |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 LOperand* function = UseFixed(instr->function(), edi); | 1118 LOperand* function = UseFixed(instr->function(), edi); |
1119 | 1119 |
1120 LCallJSFunction* result = new(zone()) LCallJSFunction(function); | 1120 LCallJSFunction* result = new(zone()) LCallJSFunction(function); |
1121 | 1121 |
1122 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1122 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1123 } | 1123 } |
1124 | 1124 |
1125 | 1125 |
1126 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1126 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1127 HCallWithDescriptor* instr) { | 1127 HCallWithDescriptor* instr) { |
1128 const CallInterfaceDescriptor* descriptor = instr->descriptor(); | 1128 const InterfaceDescriptor* descriptor = instr->descriptor(); |
| 1129 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 1130 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
| 1131 ops.Add(target, zone()); |
1129 | 1132 |
1130 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1133 if (descriptor->needs_context_register()) { |
1131 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1134 LOperand* context = UseFixed(instr->context(), esi); |
1132 ops.Add(target, zone()); | 1135 ops.Add(context, zone()); |
1133 for (int i = 1; i < instr->OperandCount(); i++) { | 1136 } |
| 1137 |
| 1138 int first_descriptor_index = instr->FirstDescriptorOperandIndex(); |
| 1139 for (int i = first_descriptor_index; i < instr->OperandCount(); i++) { |
1134 LOperand* op = UseFixed(instr->OperandAt(i), | 1140 LOperand* op = UseFixed(instr->OperandAt(i), |
1135 descriptor->GetParameterRegister(i - 1)); | 1141 descriptor->GetParameterRegister(i - first_descriptor_index)); |
1136 ops.Add(op, zone()); | 1142 ops.Add(op, zone()); |
1137 } | 1143 } |
1138 | 1144 |
1139 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1145 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1140 descriptor, ops, zone()); | 1146 descriptor, ops, zone()); |
1141 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1147 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1142 } | 1148 } |
1143 | 1149 |
1144 | 1150 |
1145 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1151 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 LOperand* function = UseRegisterAtStart(instr->function()); | 2675 LOperand* function = UseRegisterAtStart(instr->function()); |
2670 LAllocateBlockContext* result = | 2676 LAllocateBlockContext* result = |
2671 new(zone()) LAllocateBlockContext(context, function); | 2677 new(zone()) LAllocateBlockContext(context, function); |
2672 return MarkAsCall(DefineFixed(result, esi), instr); | 2678 return MarkAsCall(DefineFixed(result, esi), instr); |
2673 } | 2679 } |
2674 | 2680 |
2675 | 2681 |
2676 } } // namespace v8::internal | 2682 } } // namespace v8::internal |
2677 | 2683 |
2678 #endif // V8_TARGET_ARCH_IA32 | 2684 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |