Chromium Code Reviews| Index: src/compiler/simplified-lowering.cc |
| diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
| index b3050719883c0467bf97f8d0610e494a3142c014..5a3488c78df7b77a2b2ea8d117f8d4418f907a1a 100644 |
| --- a/src/compiler/simplified-lowering.cc |
| +++ b/src/compiler/simplified-lowering.cc |
| @@ -324,7 +324,8 @@ class RepresentationSelector { |
| } else if (upper->Is(Type::Signed32()) || upper->Is(Type::Unsigned32())) { |
| // multiple uses, but we are within 32 bits range => pick kRepWord32. |
| return kRepWord32; |
| - } else if ((use & kRepMask) == kRepWord32 || |
| + } else if (((use & kRepMask) == kRepWord32 && |
| + !CanObserveNonWord32(use)) || |
| (use & kTypeMask) == kTypeInt32 || |
| (use & kTypeMask) == kTypeUint32) { |
| // We only use 32 bits or we use the result consistently. |
| @@ -451,6 +452,10 @@ class RepresentationSelector { |
| !CanObserveNonUint32(use); |
| } |
| + bool CanObserveNonWord32(MachineTypeUnion use) { |
| + return (use & (kTypeNumber | kTypeAny)) != 0; |
|
Benedikt Meurer
2015/03/02 18:08:58
Can we use the inverse, i.e. check against ~(kType
Jarin
2015/03/03 08:57:23
Done.
|
| + } |
| + |
| bool CanObserveNonInt32(MachineTypeUnion use) { |
| return (use & (kTypeUint32 | kTypeNumber | kTypeAny)) != 0; |
| } |