Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 65888acbf00d48974464a5e2872b04f078360f0a..0513297a266cc07656a1f5e0d0da8fd7c9a6649b 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1486,32 +1486,12 @@ static JSFunction* GetTypedArrayFun(ExternalArrayType type, |
Isolate* isolate) { |
Context* native_context = isolate->context()->native_context(); |
switch (type) { |
- case kExternalUnsignedByteArray: |
- return native_context->uint8_array_fun(); |
+#define TYPED_ARRAY_FUN(Type, type, TYPE, ctype, size) \ |
+ case kExternal##Type##Array: \ |
+ return native_context->type##_array_fun(); |
- case kExternalByteArray: |
- return native_context->int8_array_fun(); |
- |
- case kExternalUnsignedShortArray: |
- return native_context->uint16_array_fun(); |
- |
- case kExternalShortArray: |
- return native_context->int16_array_fun(); |
- |
- case kExternalUnsignedIntArray: |
- return native_context->uint32_array_fun(); |
- |
- case kExternalIntArray: |
- return native_context->int32_array_fun(); |
- |
- case kExternalFloatArray: |
- return native_context->float_array_fun(); |
- |
- case kExternalDoubleArray: |
- return native_context->double_array_fun(); |
- |
- case kExternalPixelArray: |
- return native_context->uint8c_array_fun(); |
+ TYPED_ARRAYS(TYPED_ARRAY_FUN) |
+#undef TYPED_ARRAY_FUN |
default: |
UNREACHABLE(); |