| 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_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 return MarkAsCall(DefineFixed(result, rax), instr); | 1106 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 | 1109 |
| 1110 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1110 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
| 1111 HCallWithDescriptor* instr) { | 1111 HCallWithDescriptor* instr) { |
| 1112 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1112 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 1113 | 1113 |
| 1114 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1114 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
| 1115 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1115 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 1116 // Target |
| 1116 ops.Add(target, zone()); | 1117 ops.Add(target, zone()); |
| 1117 for (int i = 1; i < instr->OperandCount(); i++) { | 1118 // Context |
| 1118 LOperand* op = | 1119 LOperand* op = UseFixed(instr->OperandAt(1), rsi); |
| 1119 UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); | 1120 ops.Add(op, zone()); |
| 1121 // Other register parameters |
| 1122 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; |
| 1123 i < instr->OperandCount(); i++) { |
| 1124 op = |
| 1125 UseFixed(instr->OperandAt(i), |
| 1126 descriptor.GetRegisterParameter( |
| 1127 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1120 ops.Add(op, zone()); | 1128 ops.Add(op, zone()); |
| 1121 } | 1129 } |
| 1122 | 1130 |
| 1123 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1131 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
| 1124 descriptor, ops, zone()); | 1132 descriptor, ops, zone()); |
| 1125 return MarkAsCall(DefineFixed(result, rax), instr); | 1133 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1126 } | 1134 } |
| 1127 | 1135 |
| 1128 | 1136 |
| 1129 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1137 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2524 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
| 2517 LParameter* result = new(zone()) LParameter; | 2525 LParameter* result = new(zone()) LParameter; |
| 2518 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2526 if (instr->kind() == HParameter::STACK_PARAMETER) { |
| 2519 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2527 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
| 2520 return DefineAsSpilled(result, spill_index); | 2528 return DefineAsSpilled(result, spill_index); |
| 2521 } else { | 2529 } else { |
| 2522 DCHECK(info()->IsStub()); | 2530 DCHECK(info()->IsStub()); |
| 2523 CallInterfaceDescriptor descriptor = | 2531 CallInterfaceDescriptor descriptor = |
| 2524 info()->code_stub()->GetCallInterfaceDescriptor(); | 2532 info()->code_stub()->GetCallInterfaceDescriptor(); |
| 2525 int index = static_cast<int>(instr->index()); | 2533 int index = static_cast<int>(instr->index()); |
| 2526 Register reg = descriptor.GetEnvironmentParameterRegister(index); | 2534 Register reg = descriptor.GetRegisterParameter(index); |
| 2527 return DefineFixed(result, reg); | 2535 return DefineFixed(result, reg); |
| 2528 } | 2536 } |
| 2529 } | 2537 } |
| 2530 | 2538 |
| 2531 | 2539 |
| 2532 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2540 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2533 // Use an index that corresponds to the location in the unoptimized frame, | 2541 // Use an index that corresponds to the location in the unoptimized frame, |
| 2534 // which the optimized frame will subsume. | 2542 // which the optimized frame will subsume. |
| 2535 int env_index = instr->index(); | 2543 int env_index = instr->index(); |
| 2536 int spill_index = 0; | 2544 int spill_index = 0; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2717 LAllocateBlockContext* result = | 2725 LAllocateBlockContext* result = |
| 2718 new(zone()) LAllocateBlockContext(context, function); | 2726 new(zone()) LAllocateBlockContext(context, function); |
| 2719 return MarkAsCall(DefineFixed(result, rsi), instr); | 2727 return MarkAsCall(DefineFixed(result, rsi), instr); |
| 2720 } | 2728 } |
| 2721 | 2729 |
| 2722 | 2730 |
| 2723 } // namespace internal | 2731 } // namespace internal |
| 2724 } // namespace v8 | 2732 } // namespace v8 |
| 2725 | 2733 |
| 2726 #endif // V8_TARGET_ARCH_X64 | 2734 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |