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

Side by Side Diff: src/crankshaft/arm/lithium-arm.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/code-stubs-hydrogen.cc ('k') | src/crankshaft/arm64/lithium-arm64.cc » ('j') | 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/arm/lithium-arm.h" 5 #include "src/crankshaft/arm/lithium-arm.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/crankshaft/arm/lithium-codegen-arm.h" 9 #include "src/crankshaft/arm/lithium-codegen-arm.h"
10 #include "src/crankshaft/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 994
995 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { 995 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
996 LOperand* context = UseFixed(instr->context(), cp); 996 LOperand* context = UseFixed(instr->context(), cp);
997 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); 997 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);
998 } 998 }
999 999
1000 1000
1001 LInstruction* LChunkBuilder::DoCallWithDescriptor( 1001 LInstruction* LChunkBuilder::DoCallWithDescriptor(
1002 HCallWithDescriptor* instr) { 1002 HCallWithDescriptor* instr) {
1003 CallInterfaceDescriptor descriptor = instr->descriptor(); 1003 CallInterfaceDescriptor descriptor = instr->descriptor();
1004 DCHECK_EQ(descriptor.GetParameterCount() +
1005 LCallWithDescriptor::kImplicitRegisterParameterCount,
1006 instr->OperandCount());
1004 1007
1005 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); 1008 LOperand* target = UseRegisterOrConstantAtStart(instr->target());
1006 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); 1009 ZoneList<LOperand*> ops(instr->OperandCount(), zone());
1007 // Target 1010 // Target
1008 ops.Add(target, zone()); 1011 ops.Add(target, zone());
1009 // Context 1012 // Context
1010 LOperand* op = UseFixed(instr->OperandAt(1), cp); 1013 LOperand* op = UseFixed(instr->OperandAt(1), cp);
1011 ops.Add(op, zone()); 1014 ops.Add(op, zone());
1012 // Other register parameters 1015 // Load register parameters.
1013 for (int i = LCallWithDescriptor::kImplicitRegisterParameterCount; 1016 int i = 0;
1014 i < instr->OperandCount(); i++) { 1017 for (; i < descriptor.GetRegisterParameterCount(); i++) {
1015 op = 1018 op = UseFixed(instr->OperandAt(
1016 UseFixed(instr->OperandAt(i), 1019 i + LCallWithDescriptor::kImplicitRegisterParameterCount),
1017 descriptor.GetRegisterParameter( 1020 descriptor.GetRegisterParameter(i));
1018 i - LCallWithDescriptor::kImplicitRegisterParameterCount));
1019 ops.Add(op, zone()); 1021 ops.Add(op, zone());
1020 } 1022 }
1023 // Push stack parameters.
1024 for (; i < descriptor.GetParameterCount(); i++) {
1025 op = UseAny(instr->OperandAt(
1026 i + LCallWithDescriptor::kImplicitRegisterParameterCount));
1027 AddInstruction(new (zone()) LPushArgument(op), instr);
1028 }
1021 1029
1022 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( 1030 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
1023 descriptor, ops, zone()); 1031 descriptor, ops, zone());
1024 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) { 1032 if (instr->syntactic_tail_call_mode() == TailCallMode::kAllow) {
1025 result->MarkAsSyntacticTailCall(); 1033 result->MarkAsSyntacticTailCall();
1026 } 1034 }
1027 return MarkAsCall(DefineFixed(result, r0), instr); 1035 return MarkAsCall(DefineFixed(result, r0), instr);
1028 } 1036 }
1029 1037
1030 1038
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2453 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2446 LOperand* object = UseRegister(instr->object()); 2454 LOperand* object = UseRegister(instr->object());
2447 LOperand* index = UseTempRegister(instr->index()); 2455 LOperand* index = UseTempRegister(instr->index());
2448 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2456 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2449 LInstruction* result = DefineSameAsFirst(load); 2457 LInstruction* result = DefineSameAsFirst(load);
2450 return AssignPointerMap(result); 2458 return AssignPointerMap(result);
2451 } 2459 }
2452 2460
2453 } // namespace internal 2461 } // namespace internal
2454 } // namespace v8 2462 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698