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

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

Issue 2096403002: [turbofan] Introduce simplified operator NumberAbs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: This time fix the compile error for realz Created 4 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/simplified-operator.cc ('k') | src/compiler/typer.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/simplified-operator-reducer.h" 5 #include "src/compiler/simplified-operator-reducer.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 switch (DecideObjectIsSmi(input)) { 150 switch (DecideObjectIsSmi(input)) {
151 case Decision::kTrue: 151 case Decision::kTrue:
152 return ReplaceBoolean(true); 152 return ReplaceBoolean(true);
153 case Decision::kFalse: 153 case Decision::kFalse:
154 return ReplaceBoolean(false); 154 return ReplaceBoolean(false);
155 case Decision::kUnknown: 155 case Decision::kUnknown:
156 break; 156 break;
157 } 157 }
158 break; 158 break;
159 } 159 }
160 case IrOpcode::kNumberAbs: {
161 NumberMatcher m(node->InputAt(0));
162 if (m.HasValue()) return ReplaceNumber(std::fabs(m.Value()));
163 break;
164 }
160 case IrOpcode::kNumberCeil: 165 case IrOpcode::kNumberCeil:
161 case IrOpcode::kNumberFloor: 166 case IrOpcode::kNumberFloor:
162 case IrOpcode::kNumberRound: 167 case IrOpcode::kNumberRound:
163 case IrOpcode::kNumberTrunc: { 168 case IrOpcode::kNumberTrunc: {
164 Node* const input = NodeProperties::GetValueInput(node, 0); 169 Node* const input = NodeProperties::GetValueInput(node, 0);
165 Type* const input_type = NodeProperties::GetType(input); 170 Type* const input_type = NodeProperties::GetType(input);
166 if (input_type->Is(type_cache_.kIntegerOrMinusZeroOrNaN)) { 171 if (input_type->Is(type_cache_.kIntegerOrMinusZeroOrNaN)) {
167 return Replace(input); 172 return Replace(input);
168 } 173 }
169 break; 174 break;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 Graph* SimplifiedOperatorReducer::graph() const { return jsgraph()->graph(); } 244 Graph* SimplifiedOperatorReducer::graph() const { return jsgraph()->graph(); }
240 245
241 246
242 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { 247 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
243 return jsgraph()->machine(); 248 return jsgraph()->machine();
244 } 249 }
245 250
246 } // namespace compiler 251 } // namespace compiler
247 } // namespace internal 252 } // namespace internal
248 } // namespace v8 253 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698