| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
| 10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 | 1091 |
| 1092 return MarkAsCall(DefineFixed(result, r3), instr); | 1092 return MarkAsCall(DefineFixed(result, r3), instr); |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 | 1095 |
| 1096 LInstruction* LChunkBuilder::DoCallWithDescriptor(HCallWithDescriptor* instr) { | 1096 LInstruction* LChunkBuilder::DoCallWithDescriptor(HCallWithDescriptor* instr) { |
| 1097 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1097 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 1098 | 1098 |
| 1099 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1099 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
| 1100 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1100 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
| 1101 // Target |
| 1101 ops.Add(target, zone()); | 1102 ops.Add(target, zone()); |
| 1102 for (int i = 1; i < instr->OperandCount(); i++) { | 1103 // Context |
| 1103 LOperand* op = | 1104 LOperand* op = UseFixed(instr->OperandAt(1), cp); |
| 1104 UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); | 1105 ops.Add(op, zone()); |
| 1106 // Other register parameters |
| 1107 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; |
| 1108 i < instr->OperandCount(); i++) { |
| 1109 op = |
| 1110 UseFixed(instr->OperandAt(i), |
| 1111 descriptor.GetRegisterParameter( |
| 1112 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1105 ops.Add(op, zone()); | 1113 ops.Add(op, zone()); |
| 1106 } | 1114 } |
| 1107 | 1115 |
| 1108 LCallWithDescriptor* result = | 1116 LCallWithDescriptor* result = |
| 1109 new (zone()) LCallWithDescriptor(descriptor, ops, zone()); | 1117 new (zone()) LCallWithDescriptor(descriptor, ops, zone()); |
| 1110 return MarkAsCall(DefineFixed(result, r3), instr); | 1118 return MarkAsCall(DefineFixed(result, r3), instr); |
| 1111 } | 1119 } |
| 1112 | 1120 |
| 1113 | 1121 |
| 1114 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1122 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2452 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
| 2445 LParameter* result = new (zone()) LParameter; | 2453 LParameter* result = new (zone()) LParameter; |
| 2446 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2454 if (instr->kind() == HParameter::STACK_PARAMETER) { |
| 2447 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2455 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
| 2448 return DefineAsSpilled(result, spill_index); | 2456 return DefineAsSpilled(result, spill_index); |
| 2449 } else { | 2457 } else { |
| 2450 DCHECK(info()->IsStub()); | 2458 DCHECK(info()->IsStub()); |
| 2451 CallInterfaceDescriptor descriptor = | 2459 CallInterfaceDescriptor descriptor = |
| 2452 info()->code_stub()->GetCallInterfaceDescriptor(); | 2460 info()->code_stub()->GetCallInterfaceDescriptor(); |
| 2453 int index = static_cast<int>(instr->index()); | 2461 int index = static_cast<int>(instr->index()); |
| 2454 Register reg = descriptor.GetEnvironmentParameterRegister(index); | 2462 Register reg = descriptor.GetRegisterParameter(index); |
| 2455 return DefineFixed(result, reg); | 2463 return DefineFixed(result, reg); |
| 2456 } | 2464 } |
| 2457 } | 2465 } |
| 2458 | 2466 |
| 2459 | 2467 |
| 2460 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2468 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2461 // Use an index that corresponds to the location in the unoptimized frame, | 2469 // Use an index that corresponds to the location in the unoptimized frame, |
| 2462 // which the optimized frame will subsume. | 2470 // which the optimized frame will subsume. |
| 2463 int env_index = instr->index(); | 2471 int env_index = instr->index(); |
| 2464 int spill_index = 0; | 2472 int spill_index = 0; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2638 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
| 2631 HAllocateBlockContext* instr) { | 2639 HAllocateBlockContext* instr) { |
| 2632 LOperand* context = UseFixed(instr->context(), cp); | 2640 LOperand* context = UseFixed(instr->context(), cp); |
| 2633 LOperand* function = UseRegisterAtStart(instr->function()); | 2641 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2634 LAllocateBlockContext* result = | 2642 LAllocateBlockContext* result = |
| 2635 new (zone()) LAllocateBlockContext(context, function); | 2643 new (zone()) LAllocateBlockContext(context, function); |
| 2636 return MarkAsCall(DefineFixed(result, cp), instr); | 2644 return MarkAsCall(DefineFixed(result, cp), instr); |
| 2637 } | 2645 } |
| 2638 } // namespace internal | 2646 } // namespace internal |
| 2639 } // namespace v8 | 2647 } // namespace v8 |
| OLD | NEW |