Index: src/x64/lithium-x64.h |
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h |
index 429d47406beee6ed0c27f71fda590c8859eb0a9c..888c390c94871e41ef897e8ea5914af70638d805 100644 |
--- a/src/x64/lithium-x64.h |
+++ b/src/x64/lithium-x64.h |
@@ -1608,6 +1608,22 @@ class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
}; |
+inline static bool ExternalArrayOpRequiresTemp( |
+ Representation key_representation, |
+ ElementsKind 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 SmiValuesAre31Bits() && key_representation.IsSmi() && |
+ (elements_kind == EXTERNAL_INT8_ELEMENTS || |
+ elements_kind == EXTERNAL_UINT8_ELEMENTS || |
+ elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || |
+ elements_kind == UINT8_ELEMENTS || |
+ elements_kind == INT8_ELEMENTS || |
+ elements_kind == UINT8_CLAMPED_ELEMENTS); |
+} |
+ |
+ |
class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
public: |
LLoadKeyed(LOperand* elements, LOperand* key) { |