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

Side by Side Diff: src/compiler/common-operator-reducer.cc

Issue 2683203002: Revert of [compiler] Pass deoptimization_kind through DeoptimizeParameters and FlagsContinuation (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/effect-control-linearizer.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 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/common-operator-reducer.h" 5 #include "src/compiler/common-operator-reducer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 UNREACHABLE(); 119 UNREACHABLE();
120 } 120 }
121 } 121 }
122 return Replace(dead()); 122 return Replace(dead());
123 } 123 }
124 124
125 Reduction CommonOperatorReducer::ReduceDeoptimizeConditional(Node* node) { 125 Reduction CommonOperatorReducer::ReduceDeoptimizeConditional(Node* node) {
126 DCHECK(node->opcode() == IrOpcode::kDeoptimizeIf || 126 DCHECK(node->opcode() == IrOpcode::kDeoptimizeIf ||
127 node->opcode() == IrOpcode::kDeoptimizeUnless); 127 node->opcode() == IrOpcode::kDeoptimizeUnless);
128 bool condition_is_true = node->opcode() == IrOpcode::kDeoptimizeUnless; 128 bool condition_is_true = node->opcode() == IrOpcode::kDeoptimizeUnless;
129 DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); 129 DeoptimizeReason reason = DeoptimizeReasonOf(node->op());
130 Node* condition = NodeProperties::GetValueInput(node, 0); 130 Node* condition = NodeProperties::GetValueInput(node, 0);
131 Node* frame_state = NodeProperties::GetValueInput(node, 1); 131 Node* frame_state = NodeProperties::GetValueInput(node, 1);
132 Node* effect = NodeProperties::GetEffectInput(node); 132 Node* effect = NodeProperties::GetEffectInput(node);
133 Node* control = NodeProperties::GetControlInput(node); 133 Node* control = NodeProperties::GetControlInput(node);
134 // Swap DeoptimizeIf/DeoptimizeUnless on {node} if {cond} is a BooleaNot 134 // Swap DeoptimizeIf/DeoptimizeUnless on {node} if {cond} is a BooleaNot
135 // and use the input to BooleanNot as new condition for {node}. Note we 135 // and use the input to BooleanNot as new condition for {node}. Note we
136 // assume that {cond} was already properly optimized before we get here 136 // assume that {cond} was already properly optimized before we get here
137 // (as guaranteed by the graph reduction logic). 137 // (as guaranteed by the graph reduction logic).
138 if (condition->opcode() == IrOpcode::kBooleanNot) { 138 if (condition->opcode() == IrOpcode::kBooleanNot) {
139 NodeProperties::ReplaceValueInput(node, condition->InputAt(0), 0); 139 NodeProperties::ReplaceValueInput(node, condition->InputAt(0), 0);
140 NodeProperties::ChangeOp( 140 NodeProperties::ChangeOp(node, condition_is_true
141 node, condition_is_true 141 ? common()->DeoptimizeIf(reason)
142 ? common()->DeoptimizeIf(p.kind(), p.reason()) 142 : common()->DeoptimizeUnless(reason));
143 : common()->DeoptimizeUnless(p.kind(), p.reason()));
144 return Changed(node); 143 return Changed(node);
145 } 144 }
146 Decision const decision = DecideCondition(condition); 145 Decision const decision = DecideCondition(condition);
147 if (decision == Decision::kUnknown) return NoChange(); 146 if (decision == Decision::kUnknown) return NoChange();
148 if (condition_is_true == (decision == Decision::kTrue)) { 147 if (condition_is_true == (decision == Decision::kTrue)) {
149 ReplaceWithValue(node, dead(), effect, control); 148 ReplaceWithValue(node, dead(), effect, control);
150 } else { 149 } else {
151 control = graph()->NewNode(common()->Deoptimize(p.kind(), p.reason()), 150 control =
152 frame_state, effect, control); 151 graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager, reason),
152 frame_state, effect, control);
153 // TODO(bmeurer): This should be on the AdvancedReducer somehow. 153 // TODO(bmeurer): This should be on the AdvancedReducer somehow.
154 NodeProperties::MergeControlToEnd(graph(), common(), control); 154 NodeProperties::MergeControlToEnd(graph(), common(), control);
155 Revisit(graph()->end()); 155 Revisit(graph()->end());
156 } 156 }
157 return Replace(dead()); 157 return Replace(dead());
158 } 158 }
159 159
160 Reduction CommonOperatorReducer::ReduceMerge(Node* node) { 160 Reduction CommonOperatorReducer::ReduceMerge(Node* node) {
161 DCHECK_EQ(IrOpcode::kMerge, node->opcode()); 161 DCHECK_EQ(IrOpcode::kMerge, node->opcode());
162 // 162 //
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 node->ReplaceInput(0, a); 427 node->ReplaceInput(0, a);
428 node->ReplaceInput(1, b); 428 node->ReplaceInput(1, b);
429 node->TrimInputCount(2); 429 node->TrimInputCount(2);
430 NodeProperties::ChangeOp(node, op); 430 NodeProperties::ChangeOp(node, op);
431 return Changed(node); 431 return Changed(node);
432 } 432 }
433 433
434 } // namespace compiler 434 } // namespace compiler
435 } // namespace internal 435 } // namespace internal
436 } // namespace v8 436 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/effect-control-linearizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698