| Index: src/ia32/lithium-ia32.h
|
| diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
|
| index 88b1ef01ea04092fc083f07b3b662abb3849af7c..18741d1fca2cf9488fc18a2f7ba8dc775a221c49 100644
|
| --- a/src/ia32/lithium-ia32.h
|
| +++ b/src/ia32/lithium-ia32.h
|
| @@ -1408,13 +1408,16 @@ class LLoadKeyed: public LTemplateInstruction<1, 2, 0> {
|
| };
|
|
|
|
|
| -inline static bool ExternalArrayOpRequiresTemp(
|
| - Representation key_representation,
|
| - ElementsKind elements_kind) {
|
| +template <class T>
|
| +inline static bool ExternalArrayOpRequiresTemp(T* value) {
|
| + CHECK(value->IsLoadKeyed() || value->IsStoreKeyed());
|
| + Representation key_representation = value->key()->representation();
|
| + ElementsKind elements_kind = value->elements_kind();
|
| +
|
| // Operations that require the key to be divided by two to be converted into
|
| // an index cannot fold the scale operation into a load and need an extra
|
| // temp register to do the work.
|
| - return key_representation.IsTagged() &&
|
| + return !value->IsConstant() && key_representation.IsTagged() &&
|
| (elements_kind == EXTERNAL_BYTE_ELEMENTS ||
|
| elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
|
| elements_kind == EXTERNAL_PIXEL_ELEMENTS);
|
|
|