Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/crankshaft/x87/lithium-x87.cc

Issue 2353303002: [crankshaft] HCallWithDescriptor is now able to pass arguments on the stack. (Closed)
Patch Set: arm64 fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/crankshaft/x87/lithium-x87.h" 5 #include "src/crankshaft/x87/lithium-x87.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_X87 9 #if V8_TARGET_ARCH_X87
10 10
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 1046
1047 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { 1047 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
1048 LOperand* context = UseFixed(instr->context(), esi); 1048 LOperand* context = UseFixed(instr->context(), esi);
1049 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); 1049 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);
1050 } 1050 }
1051 1051
1052 1052
1053 LInstruction* LChunkBuilder::DoCallWithDescriptor( 1053 LInstruction* LChunkBuilder::DoCallWithDescriptor(
1054 HCallWithDescriptor* instr) { 1054 HCallWithDescriptor* instr) {
1055 CallInterfaceDescriptor descriptor = instr->descriptor(); 1055 CallInterfaceDescriptor descriptor = instr->descriptor();
1056 DCHECK_EQ(descriptor.GetParameterCount() +
1057 LCallWithDescriptor::kImplicitRegisterParameterCount,
1058 instr->OperandCount());
1059
1056 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); 1060 LOperand* target = UseRegisterOrConstantAtStart(instr->target());
1057 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); 1061 ZoneList<LOperand*> ops(instr->OperandCount(), zone());
1058 // Target 1062 // Target
1059 ops.Add(target, zone()); 1063 ops.Add(target, zone());
1060 // Context 1064 // Context
1061 LOperand* op = UseFixed(instr->OperandAt(1), esi); 1065 LOperand* op = UseFixed(instr->OperandAt(1), esi);
1062 ops.Add(op, zone()); 1066 ops.Add(op, zone());
1063 // Other register parameters 1067 // Load register parameters.
1064 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; 1068 int i = 0;
1065 i < instr->OperandCount(); i++) { 1069 for (; i < descriptor.GetRegisterParameterCount(); i++) {
1066 op = 1070 op = UseFixed(instr->OperandAt(
1067 UseFixed(instr->OperandAt(i), 1071 i + LCallWithDescriptor::kImplicitRegisterParameterCount),
1068 descriptor.GetRegisterParameter( 1072 descriptor.GetRegisterParameter(i));
1069 i - LCallWithDescriptor::kImplicitRegisterParameterCount));
1070 ops.Add(op, zone()); 1073 ops.Add(op, zone());
1071 } 1074 }
1075 // Push stack parameters.
1076 for (; i < descriptor.GetParameterCount(); i++) {
1077 op = UseAny(instr->OperandAt(
1078 i + LCallWithDescriptor::kImplicitRegisterParameterCount));
1079 AddInstruction(new (zone()) LPushArgument(op), instr);
1080 }
1072 1081
1073 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( 1082 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
1074 descriptor, ops, zone()); 1083 descriptor, ops, zone());
1075 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { 1084 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) {
1076 result->MarkAsSyntacticTailCall(); 1085 result->MarkAsSyntacticTailCall();
1077 } 1086 }
1078 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1087 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1079 } 1088 }
1080 1089
1081 1090
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 LOperand* index = UseTempRegister(instr->index()); 2522 LOperand* index = UseTempRegister(instr->index());
2514 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2523 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2515 LInstruction* result = DefineSameAsFirst(load); 2524 LInstruction* result = DefineSameAsFirst(load);
2516 return AssignPointerMap(result); 2525 return AssignPointerMap(result);
2517 } 2526 }
2518 2527
2519 } // namespace internal 2528 } // namespace internal
2520 } // namespace v8 2529 } // namespace v8
2521 2530
2522 #endif // V8_TARGET_ARCH_X87 2531 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698