Index: src/elements-kind.cc |
diff --git a/src/elements-kind.cc b/src/elements-kind.cc |
index 16f5bff98bdfc77b67e18f883efebe45f9624030..689c2205696689e82dd45bfb6a67d92a8c3f5099 100644 |
--- a/src/elements-kind.cc |
+++ b/src/elements-kind.cc |
@@ -35,6 +35,36 @@ namespace v8 { |
namespace internal { |
+int ElementsKindToShiftSize(ElementsKind elements_kind) { |
+ switch (elements_kind) { |
+ case EXTERNAL_BYTE_ELEMENTS: |
+ case EXTERNAL_PIXEL_ELEMENTS: |
+ case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
+ return 0; |
+ case EXTERNAL_SHORT_ELEMENTS: |
+ case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
+ return 1; |
+ case EXTERNAL_INT_ELEMENTS: |
+ case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
+ case EXTERNAL_FLOAT_ELEMENTS: |
+ return 2; |
+ case EXTERNAL_DOUBLE_ELEMENTS: |
+ case FAST_DOUBLE_ELEMENTS: |
+ case FAST_HOLEY_DOUBLE_ELEMENTS: |
+ return 3; |
+ case FAST_SMI_ELEMENTS: |
+ case FAST_ELEMENTS: |
+ case FAST_HOLEY_SMI_ELEMENTS: |
+ case FAST_HOLEY_ELEMENTS: |
+ case DICTIONARY_ELEMENTS: |
+ case NON_STRICT_ARGUMENTS_ELEMENTS: |
+ return kPointerSizeLog2; |
+ } |
+ UNREACHABLE(); |
+ return 0; |
+} |
+ |
+ |
const char* ElementsKindToString(ElementsKind kind) { |
ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); |
return accessor->name(); |