Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: src/factory.cc

Issue 145133013: External Array renaming and boilerplate scrapping (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/api.cc ('K') | « src/elements-kind.cc ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« src/api.cc ('K') | « src/elements-kind.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698