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

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

Issue 2184513003: [turbofan] Adds handling of number or oddball type feedback to SpeculativeNumberShiftLeft. (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
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 0c19a12f1b854ec6844f69d2f0b9892c0cb1db24..c6a96af27cbf0bcf6aae7ed76b56c9b8c7e13f22 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -457,6 +457,16 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else if (output_type->Is(Type::Signed32())) {
op = simplified()->ChangeTaggedToInt32();
} else if (use_info.truncation().IsUsedAsWord32()) {
+ if (use_info.type_check() == TypeCheckKind::kNumberOrOddball) {
+ op = simplified()->CheckedTaggedToFloat64();
+ Node* effect = NodeProperties::GetEffectInput(use_node);
+ Node* control = NodeProperties::GetControlInput(use_node);
+ Node* to_float_checked =
+ jsgraph()->graph()->NewNode(op, node, effect, control);
+ NodeProperties::ReplaceEffectInput(use_node, to_float_checked);
+ return jsgraph()->graph()->NewNode(machine()->TruncateFloat64ToWord32(),
+ to_float_checked);
Jarin 2016/07/27 05:34:01 As discussed offline, we should introduce a dedica
epertoso 2016/07/27 08:26:36 Acknowledged.
+ }
op = simplified()->TruncateTaggedToWord32();
} else if (use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedTaggedToInt32();
@@ -464,11 +474,15 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else if (output_rep == MachineRepresentation::kWord32) {
// Only the checked case should get here, the non-checked case is
// handled in GetRepresentationFor.
- DCHECK(use_info.type_check() == TypeCheckKind::kSigned32);
- if (output_type->Is(Type::Signed32())) {
+ if (use_info.type_check() == TypeCheckKind::kSigned32) {
+ if (output_type->Is(Type::Signed32())) {
+ return node;
+ } else if (output_type->Is(Type::Unsigned32())) {
+ op = simplified()->CheckedUint32ToInt32();
+ }
+ } else {
+ DCHECK(use_info.type_check() == TypeCheckKind::kNumberOrOddball);
Benedikt Meurer 2016/07/27 03:34:36 Nit: Use DCHECK_EQ(TypeCheckKind::kNumberOrOddball
epertoso 2016/07/27 08:26:36 Done.
return node;
- } else if (output_type->Is(Type::Unsigned32())) {
- op = simplified()->CheckedUint32ToInt32();
}
} else if (output_rep == MachineRepresentation::kWord8 ||
output_rep == MachineRepresentation::kWord16) {

Powered by Google App Engine
This is Rietveld 408576698