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 #include "src/arm/lithium-codegen-arm.h" | 9 #include "src/arm/lithium-codegen-arm.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 return MarkAsCall(DefineFixed(result, r0), instr); | 1085 return MarkAsCall(DefineFixed(result, r0), instr); |
1086 } | 1086 } |
1087 | 1087 |
1088 | 1088 |
1089 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1089 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1090 HCallWithDescriptor* instr) { | 1090 HCallWithDescriptor* instr) { |
1091 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1091 CallInterfaceDescriptor descriptor = instr->descriptor(); |
1092 | 1092 |
1093 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1093 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1094 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1094 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 1095 // Target |
1095 ops.Add(target, zone()); | 1096 ops.Add(target, zone()); |
1096 for (int i = 1; i < instr->OperandCount(); i++) { | 1097 // Context |
1097 LOperand* op = | 1098 LOperand* op = UseFixed(instr->OperandAt(1), cp); |
1098 UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); | 1099 ops.Add(op, zone()); |
| 1100 // Other register parameters |
| 1101 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; |
| 1102 i < instr->OperandCount(); i++) { |
| 1103 op = |
| 1104 UseFixed(instr->OperandAt(i), |
| 1105 descriptor.GetRegisterParameter( |
| 1106 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
1099 ops.Add(op, zone()); | 1107 ops.Add(op, zone()); |
1100 } | 1108 } |
1101 | 1109 |
1102 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1110 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1103 descriptor, ops, zone()); | 1111 descriptor, ops, zone()); |
1104 return MarkAsCall(DefineFixed(result, r0), instr); | 1112 return MarkAsCall(DefineFixed(result, r0), instr); |
1105 } | 1113 } |
1106 | 1114 |
1107 | 1115 |
1108 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1116 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2502 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
2495 LParameter* result = new(zone()) LParameter; | 2503 LParameter* result = new(zone()) LParameter; |
2496 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2504 if (instr->kind() == HParameter::STACK_PARAMETER) { |
2497 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2505 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
2498 return DefineAsSpilled(result, spill_index); | 2506 return DefineAsSpilled(result, spill_index); |
2499 } else { | 2507 } else { |
2500 DCHECK(info()->IsStub()); | 2508 DCHECK(info()->IsStub()); |
2501 CallInterfaceDescriptor descriptor = | 2509 CallInterfaceDescriptor descriptor = |
2502 info()->code_stub()->GetCallInterfaceDescriptor(); | 2510 info()->code_stub()->GetCallInterfaceDescriptor(); |
2503 int index = static_cast<int>(instr->index()); | 2511 int index = static_cast<int>(instr->index()); |
2504 Register reg = descriptor.GetEnvironmentParameterRegister(index); | 2512 Register reg = descriptor.GetRegisterParameter(index); |
2505 return DefineFixed(result, reg); | 2513 return DefineFixed(result, reg); |
2506 } | 2514 } |
2507 } | 2515 } |
2508 | 2516 |
2509 | 2517 |
2510 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2518 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
2511 // Use an index that corresponds to the location in the unoptimized frame, | 2519 // Use an index that corresponds to the location in the unoptimized frame, |
2512 // which the optimized frame will subsume. | 2520 // which the optimized frame will subsume. |
2513 int env_index = instr->index(); | 2521 int env_index = instr->index(); |
2514 int spill_index = 0; | 2522 int spill_index = 0; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 HAllocateBlockContext* instr) { | 2690 HAllocateBlockContext* instr) { |
2683 LOperand* context = UseFixed(instr->context(), cp); | 2691 LOperand* context = UseFixed(instr->context(), cp); |
2684 LOperand* function = UseRegisterAtStart(instr->function()); | 2692 LOperand* function = UseRegisterAtStart(instr->function()); |
2685 LAllocateBlockContext* result = | 2693 LAllocateBlockContext* result = |
2686 new(zone()) LAllocateBlockContext(context, function); | 2694 new(zone()) LAllocateBlockContext(context, function); |
2687 return MarkAsCall(DefineFixed(result, cp), instr); | 2695 return MarkAsCall(DefineFixed(result, cp), instr); |
2688 } | 2696 } |
2689 | 2697 |
2690 } // namespace internal | 2698 } // namespace internal |
2691 } // namespace v8 | 2699 } // namespace v8 |
OLD | NEW |