Index: src/elements-kind.h |
diff --git a/src/elements-kind.h b/src/elements-kind.h |
index 0254a4fb59b20e44096138e54458840ba5253d26..c3184b93835313d30efc4f12051ceec49b47053e 100644 |
--- a/src/elements-kind.h |
+++ b/src/elements-kind.h |
@@ -32,6 +32,17 @@ |
FAST_SLOPPY_ARGUMENTS_ELEMENTS, |
SLOW_SLOPPY_ARGUMENTS_ELEMENTS, |
+ |
+ // The "fast" kind for external arrays |
+ EXTERNAL_INT8_ELEMENTS, |
+ EXTERNAL_UINT8_ELEMENTS, |
+ EXTERNAL_INT16_ELEMENTS, |
+ EXTERNAL_UINT16_ELEMENTS, |
+ EXTERNAL_INT32_ELEMENTS, |
+ EXTERNAL_UINT32_ELEMENTS, |
+ EXTERNAL_FLOAT32_ELEMENTS, |
+ EXTERNAL_FLOAT64_ELEMENTS, |
+ EXTERNAL_UINT8_CLAMPED_ELEMENTS, |
// Fixed typed arrays |
UINT8_ELEMENTS, |
@@ -49,6 +60,8 @@ |
LAST_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, |
FIRST_FAST_ELEMENTS_KIND = FAST_SMI_ELEMENTS, |
LAST_FAST_ELEMENTS_KIND = FAST_HOLEY_DOUBLE_ELEMENTS, |
+ FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_INT8_ELEMENTS, |
+ LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_UINT8_CLAMPED_ELEMENTS, |
FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_ELEMENTS, |
LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, |
TERMINAL_FAST_ELEMENTS_KIND = FAST_HOLEY_ELEMENTS |
@@ -84,15 +97,21 @@ |
} |
+inline bool IsExternalArrayElementsKind(ElementsKind kind) { |
+ return kind >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && |
+ kind <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND; |
+} |
+ |
+ |
+inline bool IsTerminalElementsKind(ElementsKind kind) { |
+ return kind == TERMINAL_FAST_ELEMENTS_KIND || |
+ IsExternalArrayElementsKind(kind); |
+} |
+ |
+ |
inline bool IsFixedTypedArrayElementsKind(ElementsKind kind) { |
return kind >= FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND && |
- kind <= LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND; |
-} |
- |
- |
-inline bool IsTerminalElementsKind(ElementsKind kind) { |
- return kind == TERMINAL_FAST_ELEMENTS_KIND || |
- IsFixedTypedArrayElementsKind(kind); |
+ kind <= LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND; |
} |
@@ -114,13 +133,21 @@ |
} |
+inline bool IsExternalFloatOrDoubleElementsKind(ElementsKind kind) { |
+ return kind == EXTERNAL_FLOAT64_ELEMENTS || |
+ kind == EXTERNAL_FLOAT32_ELEMENTS; |
+} |
+ |
+ |
inline bool IsFixedFloatElementsKind(ElementsKind kind) { |
return kind == FLOAT32_ELEMENTS || kind == FLOAT64_ELEMENTS; |
} |
inline bool IsDoubleOrFloatElementsKind(ElementsKind kind) { |
- return IsFastDoubleElementsKind(kind) || IsFixedFloatElementsKind(kind); |
+ return IsFastDoubleElementsKind(kind) || |
+ IsExternalFloatOrDoubleElementsKind(kind) || |
+ IsFixedFloatElementsKind(kind); |
} |