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

Side by Side Diff: src/compiler/raw-machine-assembler.cc

Issue 2317823002: [turbofan] Add support for tail-calling a runtime function with 6 arguments. (Closed)
Patch Set: Created 4 years, 3 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/compiler/raw-machine-assembler.h ('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 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/compiler/raw-machine-assembler.h" 5 #include "src/compiler/raw-machine-assembler.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 #include "src/compiler/pipeline.h" 9 #include "src/compiler/pipeline.h"
10 #include "src/compiler/scheduler.h" 10 #include "src/compiler/scheduler.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 Node* arity = Int32Constant(kArity); 395 Node* arity = Int32Constant(kArity);
396 396
397 Node* nodes[] = {centry, arg1, arg2, arg3, arg4, arg5, ref, arity, context}; 397 Node* nodes[] = {centry, arg1, arg2, arg3, arg4, arg5, ref, arity, context};
398 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); 398 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
399 399
400 schedule()->AddTailCall(CurrentBlock(), tail_call); 400 schedule()->AddTailCall(CurrentBlock(), tail_call);
401 current_block_ = nullptr; 401 current_block_ = nullptr;
402 return tail_call; 402 return tail_call;
403 } 403 }
404 404
405 Node* RawMachineAssembler::TailCallRuntime6(Runtime::FunctionId function,
406 Node* arg1, Node* arg2, Node* arg3,
407 Node* arg4, Node* arg5, Node* arg6,
408 Node* context) {
409 const int kArity = 6;
410 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
411 zone(), function, kArity, Operator::kNoProperties,
412 CallDescriptor::kSupportsTailCalls);
413 int return_count = static_cast<int>(desc->ReturnCount());
414
415 Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
416 Node* ref = AddNode(
417 common()->ExternalConstant(ExternalReference(function, isolate())));
418 Node* arity = Int32Constant(kArity);
419
420 Node* nodes[] = {centry, arg1, arg2, arg3, arg4,
421 arg5, arg6, ref, arity, context};
422 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
423
424 schedule()->AddTailCall(CurrentBlock(), tail_call);
425 current_block_ = nullptr;
426 return tail_call;
427 }
428
405 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, 429 Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
406 Node* function) { 430 Node* function) {
407 MachineSignature::Builder builder(zone(), 1, 0); 431 MachineSignature::Builder builder(zone(), 1, 0);
408 builder.AddReturn(return_type); 432 builder.AddReturn(return_type);
409 const CallDescriptor* descriptor = 433 const CallDescriptor* descriptor =
410 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); 434 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
411 435
412 return AddNode(common()->Call(descriptor), function); 436 return AddNode(common()->Call(descriptor), function);
413 } 437 }
414 438
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // The raw machine assembler nodes do not have effect and control inputs, 544 // The raw machine assembler nodes do not have effect and control inputs,
521 // so we disable checking input counts here. 545 // so we disable checking input counts here.
522 return graph()->NewNodeUnchecked(op, input_count, inputs); 546 return graph()->NewNodeUnchecked(op, input_count, inputs);
523 } 547 }
524 548
525 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } 549 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); }
526 550
527 } // namespace compiler 551 } // namespace compiler
528 } // namespace internal 552 } // namespace internal
529 } // namespace v8 553 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698