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

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

Issue 1348073002: [turbofan] Get rid of type lower bounds. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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/osr.cc ('k') | src/compiler/schedule.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.h
diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h
index 0aa258bdfbb96301a912f118332e662443965724..0c38e020add70542c1462bccb2292b35b04b7d23 100644
--- a/src/compiler/representation-change.h
+++ b/src/compiler/representation-change.h
@@ -30,7 +30,9 @@ class RepresentationChanger {
type_error_(false) {}
// TODO(titzer): should Word64 also be implicitly convertable to others?
- static const MachineTypeUnion rWord = kRepWord8 | kRepWord16 | kRepWord32;
+ static bool IsWord(MachineTypeUnion type) {
+ return (type & (kRepWord8 | kRepWord16 | kRepWord32)) != 0;
+ }
Node* GetRepresentationFor(Node* node, MachineTypeUnion output_type,
MachineTypeUnion use_type) {
@@ -42,7 +44,7 @@ class RepresentationChanger {
// Representations are the same. That's a no-op.
return node;
}
- if ((use_type & rWord) && (output_type & rWord)) {
+ if (IsWord(use_type) && IsWord(output_type)) {
// Both are words less than or equal to 32-bits.
// Since loads of integers from memory implicitly sign or zero extend the
// value to the full machine word size and stores implicitly truncate,
@@ -57,7 +59,7 @@ class RepresentationChanger {
return GetFloat64RepresentationFor(node, output_type);
} else if (use_type & kRepBit) {
return GetBitRepresentationFor(node, output_type);
- } else if (use_type & rWord) {
+ } else if (IsWord(use_type)) {
return GetWord32RepresentationFor(node, output_type,
use_type & kTypeUint32);
} else if (use_type & kRepWord64) {
@@ -97,7 +99,7 @@ class RepresentationChanger {
const Operator* op;
if (output_type & kRepBit) {
op = simplified()->ChangeBitToBool();
- } else if (output_type & rWord) {
+ } else if (IsWord(output_type)) {
if (output_type & kTypeUint32) {
op = simplified()->ChangeUint32ToTagged();
} else if (output_type & kTypeInt32) {
@@ -140,7 +142,7 @@ class RepresentationChanger {
const Operator* op;
if (output_type & kRepBit) {
return TypeError(node, output_type, kRepFloat32);
- } else if (output_type & rWord) {
+ } else if (IsWord(output_type)) {
if (output_type & kTypeUint32) {
op = machine()->ChangeUint32ToFloat64();
} else {
@@ -186,7 +188,7 @@ class RepresentationChanger {
const Operator* op;
if (output_type & kRepBit) {
return TypeError(node, output_type, kRepFloat64);
- } else if (output_type & rWord) {
+ } else if (IsWord(output_type)) {
if (output_type & kTypeUint32) {
op = machine()->ChangeUint32ToFloat64();
} else {
« no previous file with comments | « src/compiler/osr.cc ('k') | src/compiler/schedule.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698