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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 2170433002: Revert of [turbofan] Introduce TruncateTaggedToBit operator for ToBoolean truncation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/representation-change.cc ('k') | src/compiler/simplified-operator.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/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 case IrOpcode::kSelect: 1205 case IrOpcode::kSelect:
1206 return VisitSelect(node, truncation, lowering); 1206 return VisitSelect(node, truncation, lowering);
1207 case IrOpcode::kPhi: 1207 case IrOpcode::kPhi:
1208 return VisitPhi(node, truncation, lowering); 1208 return VisitPhi(node, truncation, lowering);
1209 case IrOpcode::kCall: 1209 case IrOpcode::kCall:
1210 return VisitCall(node, lowering); 1210 return VisitCall(node, lowering);
1211 1211
1212 //------------------------------------------------------------------ 1212 //------------------------------------------------------------------
1213 // JavaScript operators. 1213 // JavaScript operators.
1214 //------------------------------------------------------------------ 1214 //------------------------------------------------------------------
1215 case IrOpcode::kJSToBoolean: {
1216 if (truncation.TruncatesToBool()) {
1217 ProcessInput(node, 0, UseInfo::Bool());
1218 ProcessInput(node, 1, UseInfo::None());
1219 SetOutput(node, MachineRepresentation::kBit);
1220 if (lower()) DeferReplacement(node, node->InputAt(0));
1221 } else {
1222 VisitInputs(node);
1223 SetOutput(node, MachineRepresentation::kTagged);
1224 }
1225 return;
1226 }
1227 case IrOpcode::kJSToNumber: { 1215 case IrOpcode::kJSToNumber: {
1228 VisitInputs(node); 1216 VisitInputs(node);
1229 // TODO(bmeurer): Optimize somewhat based on input type? 1217 // TODO(bmeurer): Optimize somewhat based on input type?
1230 if (truncation.TruncatesToWord32()) { 1218 if (truncation.TruncatesToWord32()) {
1231 SetOutput(node, MachineRepresentation::kWord32); 1219 SetOutput(node, MachineRepresentation::kWord32);
1232 if (lower()) lowering->DoJSToNumberTruncatesToWord32(node, this); 1220 if (lower()) lowering->DoJSToNumberTruncatesToWord32(node, this);
1233 } else if (truncation.TruncatesToFloat64()) { 1221 } else if (truncation.TruncatesToFloat64()) {
1234 SetOutput(node, MachineRepresentation::kFloat64); 1222 SetOutput(node, MachineRepresentation::kFloat64);
1235 if (lower()) lowering->DoJSToNumberTruncatesToFloat64(node, this); 1223 if (lower()) lowering->DoJSToNumberTruncatesToFloat64(node, this);
1236 } else { 1224 } else {
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
3385 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3373 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3386 Operator::kNoProperties); 3374 Operator::kNoProperties);
3387 to_number_operator_.set(common()->Call(desc)); 3375 to_number_operator_.set(common()->Call(desc));
3388 } 3376 }
3389 return to_number_operator_.get(); 3377 return to_number_operator_.get();
3390 } 3378 }
3391 3379
3392 } // namespace compiler 3380 } // namespace compiler
3393 } // namespace internal 3381 } // namespace internal
3394 } // namespace v8 3382 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698