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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 | 1126 |
1127 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1127 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1128 } | 1128 } |
1129 | 1129 |
1130 | 1130 |
1131 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1131 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1132 HCallWithDescriptor* instr) { | 1132 HCallWithDescriptor* instr) { |
1133 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1133 CallInterfaceDescriptor descriptor = instr->descriptor(); |
1134 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1134 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1135 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1135 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 1136 // Target |
1136 ops.Add(target, zone()); | 1137 ops.Add(target, zone()); |
1137 for (int i = 1; i < instr->OperandCount(); i++) { | 1138 // Context |
1138 LOperand* op = | 1139 LOperand* op = UseFixed(instr->OperandAt(1), esi); |
1139 UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); | 1140 ops.Add(op, zone()); |
| 1141 // Other register parameters |
| 1142 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; |
| 1143 i < instr->OperandCount(); i++) { |
| 1144 op = |
| 1145 UseFixed(instr->OperandAt(i), |
| 1146 descriptor.GetRegisterParameter( |
| 1147 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
1140 ops.Add(op, zone()); | 1148 ops.Add(op, zone()); |
1141 } | 1149 } |
1142 | 1150 |
1143 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1151 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1144 descriptor, ops, zone()); | 1152 descriptor, ops, zone()); |
1145 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1153 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1146 } | 1154 } |
1147 | 1155 |
1148 | 1156 |
1149 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1157 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2548 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
2541 LParameter* result = new(zone()) LParameter; | 2549 LParameter* result = new(zone()) LParameter; |
2542 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2550 if (instr->kind() == HParameter::STACK_PARAMETER) { |
2543 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2551 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
2544 return DefineAsSpilled(result, spill_index); | 2552 return DefineAsSpilled(result, spill_index); |
2545 } else { | 2553 } else { |
2546 DCHECK(info()->IsStub()); | 2554 DCHECK(info()->IsStub()); |
2547 CallInterfaceDescriptor descriptor = | 2555 CallInterfaceDescriptor descriptor = |
2548 info()->code_stub()->GetCallInterfaceDescriptor(); | 2556 info()->code_stub()->GetCallInterfaceDescriptor(); |
2549 int index = static_cast<int>(instr->index()); | 2557 int index = static_cast<int>(instr->index()); |
2550 Register reg = descriptor.GetEnvironmentParameterRegister(index); | 2558 Register reg = descriptor.GetRegisterParameter(index); |
2551 return DefineFixed(result, reg); | 2559 return DefineFixed(result, reg); |
2552 } | 2560 } |
2553 } | 2561 } |
2554 | 2562 |
2555 | 2563 |
2556 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2564 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
2557 // Use an index that corresponds to the location in the unoptimized frame, | 2565 // Use an index that corresponds to the location in the unoptimized frame, |
2558 // which the optimized frame will subsume. | 2566 // which the optimized frame will subsume. |
2559 int env_index = instr->index(); | 2567 int env_index = instr->index(); |
2560 int spill_index = 0; | 2568 int spill_index = 0; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2745 LAllocateBlockContext* result = | 2753 LAllocateBlockContext* result = |
2746 new(zone()) LAllocateBlockContext(context, function); | 2754 new(zone()) LAllocateBlockContext(context, function); |
2747 return MarkAsCall(DefineFixed(result, esi), instr); | 2755 return MarkAsCall(DefineFixed(result, esi), instr); |
2748 } | 2756 } |
2749 | 2757 |
2750 | 2758 |
2751 } // namespace internal | 2759 } // namespace internal |
2752 } // namespace v8 | 2760 } // namespace v8 |
2753 | 2761 |
2754 #endif // V8_TARGET_ARCH_IA32 | 2762 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |