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

Unified Diff: src/compiler/representation-change.cc

Issue 2183373002: [turbofan] Remove dead code from representation changer. (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') | no next file » | 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 0c19a12f1b854ec6844f69d2f0b9892c0cb1db24..5e900ed4ea76ccc7affa7c77bb9b134a45b3d14c 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -542,78 +542,6 @@ Node* RepresentationChanger::GetWord64RepresentationFor(
MachineRepresentation::kWord64);
}
-Node* RepresentationChanger::GetCheckedWord32RepresentationFor(
- Node* node, MachineRepresentation output_rep, Type* output_type,
- Node* use_node, Truncation truncation, TypeCheckKind check) {
- // TODO(jarin) Eagerly fold constants (or insert hard deopt if the constant
- // does not pass the check).
-
- // If the input is already Signed32 in Word32 representation, we do not
- // have to do anything. (We could fold this into the big if below, but
- // it feels nicer to have the shortcut return first).
- if (output_rep == MachineRepresentation::kWord32 ||
- output_type->Is(Type::Signed32())) {
- return node;
- }
-
- // Select the correct X -> Word32 operator.
- const Operator* op = nullptr;
- if (output_rep == MachineRepresentation::kNone) {
- // We should only use kNone representation if the type is empty.
- CHECK(!output_type->IsInhabited());
- op = machine()->ImpossibleToWord32();
- } else if (output_rep == MachineRepresentation::kWord32) {
- if (output_type->Is(Type::Unsigned32())) {
- op = simplified()->CheckedUint32ToInt32();
- }
- } else if (output_rep == MachineRepresentation::kBit) {
- return node; // Sloppy comparison -> word32
- } else if (output_rep == MachineRepresentation::kFloat64) {
- if (output_type->Is(Type::Unsigned32())) {
- op = machine()->ChangeFloat64ToUint32();
- } else if (output_type->Is(Type::Signed32())) {
- op = machine()->ChangeFloat64ToInt32();
- } else if (truncation.IsUsedAsWord32()) {
- op = machine()->TruncateFloat64ToWord32();
- } else if (check == TypeCheckKind::kSigned32) {
- op = simplified()->CheckedFloat64ToInt32();
- }
- } else if (output_rep == MachineRepresentation::kFloat32) {
- node = InsertChangeFloat32ToFloat64(node); // float32 -> float64 -> int32
- if (output_type->Is(Type::Unsigned32())) {
- op = machine()->ChangeFloat64ToUint32();
- } else if (output_type->Is(Type::Signed32())) {
- op = machine()->ChangeFloat64ToInt32();
- } else if (truncation.IsUsedAsWord32()) {
- op = machine()->TruncateFloat64ToWord32();
- } else if (check == TypeCheckKind::kSigned32) {
- op = simplified()->CheckedFloat64ToInt32();
- }
- } else if (output_rep == MachineRepresentation::kTagged) {
- if (output_type->Is(Type::TaggedSigned())) {
- op = simplified()->ChangeTaggedSignedToInt32();
- } else if (output_type->Is(Type::Unsigned32())) {
- op = simplified()->ChangeTaggedToUint32();
- } else if (output_type->Is(Type::Signed32())) {
- op = simplified()->ChangeTaggedToInt32();
- } else if (truncation.IsUsedAsWord32()) {
- op = simplified()->TruncateTaggedToWord32();
- } else if (check == TypeCheckKind::kSigned32) {
- op = simplified()->CheckedTaggedToInt32();
- }
- }
- if (op == nullptr) {
- return TypeError(node, output_rep, output_type,
- MachineRepresentation::kWord32);
- }
- if (op->ControlInputCount() > 0) {
- // If the operator can deoptimize (which means it has control
- // input), we need to connect it to the effect and control chains.
- UNIMPLEMENTED();
- }
- return jsgraph()->graph()->NewNode(op, node);
-}
-
const Operator* RepresentationChanger::Int32OperatorFor(
IrOpcode::Value opcode) {
switch (opcode) {
« no previous file with comments | « src/compiler/representation-change.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698