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

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

Issue 928213003: Model exceptional edges from call nodes in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments by Benedikt Meurer. Created 5 years, 10 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 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/node-properties.h" 5 #include "src/compiler/node-properties.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/operator-properties.h" 8 #include "src/compiler/operator-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 146
147 // static 147 // static
148 void NodeProperties::RemoveNonValueInputs(Node* node) { 148 void NodeProperties::RemoveNonValueInputs(Node* node) {
149 node->TrimInputCount(node->op()->ValueInputCount()); 149 node->TrimInputCount(node->op()->ValueInputCount());
150 } 150 }
151 151
152 152
153 // static 153 // static
154 void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) { 154 void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) {
155 DCHECK(node->op()->ControlOutputCount() == 0); 155 // TODO(mstarzinger): Enable once call-sites are in the right order.
156 // DCHECK(node->op()->HasProperty(Operator::kNoThrow));
titzer 2015/02/17 10:32:52 Not a fan of these DCHECKS here. Node is the old
Michael Starzinger 2015/02/17 10:58:29 Done. Dropped it.
156 if (!effect && node->op()->EffectInputCount() > 0) { 157 if (!effect && node->op()->EffectInputCount() > 0) {
157 effect = NodeProperties::GetEffectInput(node); 158 effect = NodeProperties::GetEffectInput(node);
158 } 159 }
159 160
160 // Requires distinguishing between value and effect edges. 161 // Requires distinguishing between value, effect and control edges.
161 for (Edge edge : node->use_edges()) { 162 for (Edge edge : node->use_edges()) {
162 if (IsEffectEdge(edge)) { 163 if (IsControlEdge(edge)) {
164 DCHECK_EQ(IrOpcode::kIfSuccess, edge.from()->opcode());
165 Node* control = NodeProperties::GetControlInput(node);
166 edge.from()->ReplaceUses(control);
167 edge.UpdateTo(NULL);
168 } else if (IsEffectEdge(edge)) {
163 DCHECK_NOT_NULL(effect); 169 DCHECK_NOT_NULL(effect);
164 edge.UpdateTo(effect); 170 edge.UpdateTo(effect);
165 } else { 171 } else {
166 edge.UpdateTo(value); 172 edge.UpdateTo(value);
167 } 173 }
168 } 174 }
169 } 175 }
170 176
171 177
172 // static 178 // static
(...skipping 21 matching lines...) Expand all
194 // static 200 // static
195 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { 201 bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
196 if (num == 0) return false; 202 if (num == 0) return false;
197 int const index = edge.index(); 203 int const index = edge.index();
198 return first <= index && index < first + num; 204 return first <= index && index < first + num;
199 } 205 }
200 206
201 } // namespace compiler 207 } // namespace compiler
202 } // namespace internal 208 } // namespace internal
203 } // namespace v8 209 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698