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

Side by Side Diff: src/compiler/js-operator.cc

Issue 1259203002: [turbofan] Implement tail calls with differing stack parameter counts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bugs in frameless tail calls Created 5 years, 4 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
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/js-operator.h" 5 #include "src/compiler/js-operator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/lazy-instance.h" 9 #include "src/base/lazy-instance.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return !(lhs == rhs); 55 return !(lhs == rhs);
56 } 56 }
57 57
58 58
59 size_t hash_value(CallRuntimeParameters const& p) { 59 size_t hash_value(CallRuntimeParameters const& p) {
60 return base::hash_combine(p.id(), p.arity()); 60 return base::hash_combine(p.id(), p.arity());
61 } 61 }
62 62
63 63
64 std::ostream& operator<<(std::ostream& os, CallRuntimeParameters const& p) { 64 std::ostream& operator<<(std::ostream& os, CallRuntimeParameters const& p) {
65 return os << p.id() << ", " << p.arity(); 65 return os << p.id() << ", " << p.arity() << ", "
66 << ((p.mode() == ALLOW_TAIL_CALLS) ? "ALLOW_TAIL_CALLS"
67 : "NO_TAIL_CALLS");
66 } 68 }
67 69
68 70
69 const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op) { 71 const CallRuntimeParameters& CallRuntimeParametersOf(const Operator* op) {
70 DCHECK_EQ(IrOpcode::kJSCallRuntime, op->opcode()); 72 DCHECK_EQ(IrOpcode::kJSCallRuntime, op->opcode());
71 return OpParameter<CallRuntimeParameters>(op); 73 return OpParameter<CallRuntimeParameters>(op);
72 } 74 }
73 75
74 76
75 ContextAccess::ContextAccess(size_t depth, size_t index, bool immutable) 77 ContextAccess::ContextAccess(size_t depth, size_t index, bool immutable)
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 tail_call_mode); 533 tail_call_mode);
532 return new (zone()) Operator1<CallFunctionParameters>( // -- 534 return new (zone()) Operator1<CallFunctionParameters>( // --
533 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode 535 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode
534 "JSCallFunction", // name 536 "JSCallFunction", // name
535 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs 537 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs
536 parameters); // parameter 538 parameters); // parameter
537 } 539 }
538 540
539 541
540 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id, 542 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id,
541 size_t arity) { 543 size_t arity,
542 CallRuntimeParameters parameters(id, arity); 544 TailCallMode mode) {
545 CallRuntimeParameters parameters(id, arity, mode);
543 const Runtime::Function* f = Runtime::FunctionForId(parameters.id()); 546 const Runtime::Function* f = Runtime::FunctionForId(parameters.id());
544 DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity())); 547 DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity()));
545 return new (zone()) Operator1<CallRuntimeParameters>( // -- 548 return new (zone()) Operator1<CallRuntimeParameters>( // --
546 IrOpcode::kJSCallRuntime, Operator::kNoProperties, // opcode 549 IrOpcode::kJSCallRuntime, Operator::kNoProperties, // opcode
547 "JSCallRuntime", // name 550 "JSCallRuntime", // name
548 parameters.arity(), 1, 1, f->result_size, 1, 2, // inputs/outputs 551 parameters.arity(), 1, 1, f->result_size, 1, 2, // inputs/outputs
549 parameters); // parameter 552 parameters); // parameter
550 } 553 }
551 554
552 555
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 return new (zone()) Operator1<Unique<String>>( // -- 725 return new (zone()) Operator1<Unique<String>>( // --
723 IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode 726 IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode
724 "JSCreateCatchContext", // name 727 "JSCreateCatchContext", // name
725 2, 1, 1, 1, 1, 2, // counts 728 2, 1, 1, 1, 1, 2, // counts
726 name); // parameter 729 name); // parameter
727 } 730 }
728 731
729 } // namespace compiler 732 } // namespace compiler
730 } // namespace internal 733 } // namespace internal
731 } // namespace v8 734 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698