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

Side by Side Diff: src/compiler/node-properties.cc

Issue 1108563002: Detect simple tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed index type Created 5 years, 7 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/node-properties.h ('k') | src/compiler/ppc/code-generator-ppc.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/operator-properties.h" 8 #include "src/compiler/operator-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 // static 113 // static
114 bool NodeProperties::IsControlEdge(Edge edge) { 114 bool NodeProperties::IsControlEdge(Edge edge) {
115 Node* const node = edge.from(); 115 Node* const node = edge.from();
116 return IsInputRange(edge, FirstControlIndex(node), 116 return IsInputRange(edge, FirstControlIndex(node),
117 node->op()->ControlInputCount()); 117 node->op()->ControlInputCount());
118 } 118 }
119 119
120 120
121 // static 121 // static
122 bool NodeProperties::IsExceptionalCall(Node* node) {
123 for (Node* const use : node->uses()) {
124 if (use->opcode() == IrOpcode::kIfException) return true;
125 }
126 return false;
127 }
128
129
130 // static
122 void NodeProperties::ReplaceContextInput(Node* node, Node* context) { 131 void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
123 node->ReplaceInput(FirstContextIndex(node), context); 132 node->ReplaceInput(FirstContextIndex(node), context);
124 } 133 }
125 134
126 135
127 // static 136 // static
128 void NodeProperties::ReplaceControlInput(Node* node, Node* control) { 137 void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
129 node->ReplaceInput(FirstControlIndex(node), control); 138 node->ReplaceInput(FirstControlIndex(node), control);
130 } 139 }
131 140
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // static 279 // static
271 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { 280 bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
272 if (num == 0) return false; 281 if (num == 0) return false;
273 int const index = edge.index(); 282 int const index = edge.index();
274 return first <= index && index < first + num; 283 return first <= index && index < first + num;
275 } 284 }
276 285
277 } // namespace compiler 286 } // namespace compiler
278 } // namespace internal 287 } // namespace internal
279 } // namespace v8 288 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/ppc/code-generator-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698