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

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

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 years, 5 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/js-operator.h ('k') | src/compiler/linkage.h » ('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 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 12 matching lines...) Expand all
23 return !(lhs == rhs); 23 return !(lhs == rhs);
24 } 24 }
25 25
26 26
27 size_t hash_value(VectorSlotPair const& p) { 27 size_t hash_value(VectorSlotPair const& p) {
28 return base::hash_combine(p.slot(), p.vector()); 28 return base::hash_combine(p.slot(), p.vector());
29 } 29 }
30 30
31 31
32 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { 32 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) {
33 return os << p.arity() << ", " << p.flags() << ", " << p.language_mode(); 33 os << p.arity() << ", " << p.flags() << ", " << p.language_mode();
34 if (p.AllowTailCalls()) {
35 os << ", ALLOW_TAIL_CALLS";
36 }
37 return os;
34 } 38 }
35 39
36 40
37 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) { 41 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) {
38 DCHECK_EQ(IrOpcode::kJSCallFunction, op->opcode()); 42 DCHECK_EQ(IrOpcode::kJSCallFunction, op->opcode());
39 return OpParameter<CallFunctionParameters>(op); 43 return OpParameter<CallFunctionParameters>(op);
40 } 44 }
41 45
42 46
43 bool operator==(CallRuntimeParameters const& lhs, 47 bool operator==(CallRuntimeParameters const& lhs,
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 case STRONG_BIT: \ 467 case STRONG_BIT: \
464 break; /* %*!%^$#@ */ \ 468 break; /* %*!%^$#@ */ \
465 } \ 469 } \
466 UNREACHABLE(); \ 470 UNREACHABLE(); \
467 return nullptr; \ 471 return nullptr; \
468 } 472 }
469 CACHED_OP_LIST_WITH_LANGUAGE_MODE(CACHED_WITH_LANGUAGE_MODE) 473 CACHED_OP_LIST_WITH_LANGUAGE_MODE(CACHED_WITH_LANGUAGE_MODE)
470 #undef CACHED_WITH_LANGUAGE_MODE 474 #undef CACHED_WITH_LANGUAGE_MODE
471 475
472 476
473 const Operator* JSOperatorBuilder::CallFunction( 477 const Operator* JSOperatorBuilder::CallFunction(size_t arity,
474 size_t arity, CallFunctionFlags flags, LanguageMode language_mode, 478 CallFunctionFlags flags,
475 VectorSlotPair const& feedback) { 479 LanguageMode language_mode,
476 CallFunctionParameters parameters(arity, flags, language_mode, feedback); 480 VectorSlotPair const& feedback,
481 TailCallMode tail_call_mode) {
482 CallFunctionParameters parameters(arity, flags, language_mode, feedback,
483 tail_call_mode);
477 return new (zone()) Operator1<CallFunctionParameters>( // -- 484 return new (zone()) Operator1<CallFunctionParameters>( // --
478 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode 485 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode
479 "JSCallFunction", // name 486 "JSCallFunction", // name
480 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs 487 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs
481 parameters); // parameter 488 parameters); // parameter
482 } 489 }
483 490
484 491
485 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id, 492 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id,
486 size_t arity) { 493 size_t arity) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 return new (zone()) Operator1<Unique<String>>( // -- 672 return new (zone()) Operator1<Unique<String>>( // --
666 IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode 673 IrOpcode::kJSCreateCatchContext, Operator::kNoProperties, // opcode
667 "JSCreateCatchContext", // name 674 "JSCreateCatchContext", // name
668 2, 1, 1, 1, 1, 2, // counts 675 2, 1, 1, 1, 1, 2, // counts
669 name); // parameter 676 name); // parameter
670 } 677 }
671 678
672 } // namespace compiler 679 } // namespace compiler
673 } // namespace internal 680 } // namespace internal
674 } // namespace v8 681 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698