Chromium Code Reviews| Index: src/hydrogen-instructions.cc |
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
| index 9b96cfe7ca6a1dcd19ef7394a001c60e6863b84c..cff5070bbcf6b275886ed5512b5ec5602cc2d951 100644 |
| --- a/src/hydrogen-instructions.cc |
| +++ b/src/hydrogen-instructions.cc |
| @@ -2590,6 +2590,10 @@ bool HLoadKeyed::UsesMustHandleHole() const { |
| return false; |
| } |
| + if (IsExternalArrayElementsKind(elements_kind())) { |
| + return false; |
| + } |
| + |
| if (hole_mode() == ALLOW_RETURN_HOLE) return true; |
| if (IsFastDoubleElementsKind(elements_kind())) { |
| @@ -2612,6 +2616,10 @@ bool HLoadKeyed::RequiresHoleCheck() const { |
| return false; |
| } |
| + if (IsExternalArrayElementsKind(elements_kind())) { |
| + return false; |
| + } |
| + |
| return !UsesMustHandleHole(); |
| } |
| @@ -3037,10 +3045,22 @@ bool HStoreKeyed::NeedsCanonicalization() { |
| // If value is an integer or smi or comes from the result of a keyed load or |
| // constant then it is either be a non-hole value or in the case of a constant |
| // the hole is only being stored explicitly: no need for canonicalization. |
| - if (value()->IsLoadKeyed() || value()->IsConstant()) { |
| + // |
| + // The exception to that is keyed loads from external float or double arrays: |
| + // these can load arbitrary representation of NaN. |
| + |
| + if (value()->IsConstant()) { |
| return false; |
| } |
| + if (value()->IsLoadKeyed()) { |
| + ElementsKind load_elements_kind = |
| + HLoadKeyed::cast(value())->elements_kind(); |
| + |
| + return load_elements_kind == EXTERNAL_FLOAT_ELEMENTS |
|
danno
2013/03/28 12:30:40
Maybe add a predicate to elements-kind.h: IsExtern
|
| + || load_elements_kind == EXTERNAL_DOUBLE_ELEMENTS; |
| + } |
| + |
| if (value()->IsChange()) { |
| if (HChange::cast(value())->from().IsInteger32()) { |
| return false; |