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 "src/crankshaft/ppc/lithium-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-ppc.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/lithium-inl.h" | 10 #include "src/crankshaft/lithium-inl.h" |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1005 |
1006 | 1006 |
1007 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1007 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
1008 LOperand* context = UseFixed(instr->context(), cp); | 1008 LOperand* context = UseFixed(instr->context(), cp); |
1009 return MarkAsCall(new (zone()) LDeclareGlobals(context), instr); | 1009 return MarkAsCall(new (zone()) LDeclareGlobals(context), instr); |
1010 } | 1010 } |
1011 | 1011 |
1012 | 1012 |
1013 LInstruction* LChunkBuilder::DoCallWithDescriptor(HCallWithDescriptor* instr) { | 1013 LInstruction* LChunkBuilder::DoCallWithDescriptor(HCallWithDescriptor* instr) { |
1014 CallInterfaceDescriptor descriptor = instr->descriptor(); | 1014 CallInterfaceDescriptor descriptor = instr->descriptor(); |
| 1015 DCHECK_EQ(descriptor.GetParameterCount() + |
| 1016 LCallWithDescriptor::kImplicitRegisterParameterCount, |
| 1017 instr->OperandCount()); |
1015 | 1018 |
1016 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1019 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1017 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1020 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
1018 // Target | 1021 // Target |
1019 ops.Add(target, zone()); | 1022 ops.Add(target, zone()); |
1020 // Context | 1023 // Context |
1021 LOperand* op = UseFixed(instr->OperandAt(1), cp); | 1024 LOperand* op = UseFixed(instr->OperandAt(1), cp); |
1022 ops.Add(op, zone()); | 1025 ops.Add(op, zone()); |
1023 // Other register parameters | 1026 // Load register parameters. |
1024 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; | 1027 int i = 0; |
1025 i < instr->OperandCount(); i++) { | 1028 for (; i < descriptor.GetRegisterParameterCount(); i++) { |
1026 op = | 1029 op = UseFixed(instr->OperandAt( |
1027 UseFixed(instr->OperandAt(i), | 1030 i + LCallWithDescriptor::kImplicitRegisterParameterCount), |
1028 descriptor.GetRegisterParameter( | 1031 descriptor.GetRegisterParameter(i)); |
1029 i - LCallWithDescriptor::kImplicitRegisterParameterCount)); | |
1030 ops.Add(op, zone()); | 1032 ops.Add(op, zone()); |
1031 } | 1033 } |
| 1034 // Push stack parameters. |
| 1035 for (; i < descriptor.GetParameterCount(); i++) { |
| 1036 op = UseAny(instr->OperandAt( |
| 1037 i + LCallWithDescriptor::kImplicitRegisterParameterCount)); |
| 1038 AddInstruction(new (zone()) LPushArgument(op), instr); |
| 1039 } |
1032 | 1040 |
1033 LCallWithDescriptor* result = | 1041 LCallWithDescriptor* result = |
1034 new (zone()) LCallWithDescriptor(descriptor, ops, zone()); | 1042 new (zone()) LCallWithDescriptor(descriptor, ops, zone()); |
1035 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { | 1043 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { |
1036 result->MarkAsSyntacticTailCall(); | 1044 result->MarkAsSyntacticTailCall(); |
1037 } | 1045 } |
1038 return MarkAsCall(DefineFixed(result, r3), instr); | 1046 return MarkAsCall(DefineFixed(result, r3), instr); |
1039 } | 1047 } |
1040 | 1048 |
1041 | 1049 |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2414 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2422 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2415 LOperand* object = UseRegister(instr->object()); | 2423 LOperand* object = UseRegister(instr->object()); |
2416 LOperand* index = UseTempRegister(instr->index()); | 2424 LOperand* index = UseTempRegister(instr->index()); |
2417 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); | 2425 LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index); |
2418 LInstruction* result = DefineSameAsFirst(load); | 2426 LInstruction* result = DefineSameAsFirst(load); |
2419 return AssignPointerMap(result); | 2427 return AssignPointerMap(result); |
2420 } | 2428 } |
2421 | 2429 |
2422 } // namespace internal | 2430 } // namespace internal |
2423 } // namespace v8 | 2431 } // namespace v8 |
OLD | NEW |