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

Unified Diff: src/compiler/representation-change.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 5b2dd5299cc9d781ee1abcffe1697a6c7d023a88..c8a00338e2440b3ed6861dbfecddff788921e627 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -482,30 +482,18 @@
switch (node->opcode()) {
case IrOpcode::kHeapConstant: {
Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node);
- return jsgraph()->Int32Constant(value->BooleanValue() ? 1 : 0);
+ DCHECK(value.is_identical_to(factory()->true_value()) ||
+ value.is_identical_to(factory()->false_value()));
+ return jsgraph()->Int32Constant(
+ value.is_identical_to(factory()->true_value()) ? 1 : 0);
}
default:
break;
}
// Select the correct X -> Bit operator.
const Operator* op;
- if (IsWord(output_rep)) {
- return jsgraph()->graph()->NewNode(machine()->Word32Equal(), node,
- jsgraph()->Int32Constant(0));
- } else if (output_rep == MachineRepresentation::kFloat32) {
- node = jsgraph()->graph()->NewNode(machine()->Float32Abs(), node);
- return jsgraph()->graph()->NewNode(machine()->Float32LessThan(),
- jsgraph()->Float32Constant(0.0), node);
- } else if (output_rep == MachineRepresentation::kFloat64) {
- node = jsgraph()->graph()->NewNode(machine()->Float64Abs(), node);
- return jsgraph()->graph()->NewNode(machine()->Float64LessThan(),
- jsgraph()->Float64Constant(0.0), node);
- } else if (output_rep == MachineRepresentation::kTagged) {
- if (output_type->Is(Type::Boolean())) {
- op = simplified()->ChangeTaggedToBit();
- } else {
- op = simplified()->TruncateTaggedToBit();
- }
+ if (output_rep == MachineRepresentation::kTagged) {
+ op = simplified()->ChangeTaggedToBit();
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kBit);
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698