Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 97364ca6999a6f35816fd2bde788b71bf1ed0632..6952a55346feb0c6a234dd93b69e00751ad98872 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -1094,33 +1094,14 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, |
} |
{ // -- T y p e d A r r a y s |
- Handle<JSFunction> int8_fun = InstallTypedArray("Int8Array", |
- EXTERNAL_BYTE_ELEMENTS); |
- native_context()->set_int8_array_fun(*int8_fun); |
- Handle<JSFunction> uint8_fun = InstallTypedArray("Uint8Array", |
- EXTERNAL_UNSIGNED_BYTE_ELEMENTS); |
- native_context()->set_uint8_array_fun(*uint8_fun); |
- Handle<JSFunction> int16_fun = InstallTypedArray("Int16Array", |
- EXTERNAL_SHORT_ELEMENTS); |
- native_context()->set_int16_array_fun(*int16_fun); |
- Handle<JSFunction> uint16_fun = InstallTypedArray("Uint16Array", |
- EXTERNAL_UNSIGNED_SHORT_ELEMENTS); |
- native_context()->set_uint16_array_fun(*uint16_fun); |
- Handle<JSFunction> int32_fun = InstallTypedArray("Int32Array", |
- EXTERNAL_INT_ELEMENTS); |
- native_context()->set_int32_array_fun(*int32_fun); |
- Handle<JSFunction> uint32_fun = InstallTypedArray("Uint32Array", |
- EXTERNAL_UNSIGNED_INT_ELEMENTS); |
- native_context()->set_uint32_array_fun(*uint32_fun); |
- Handle<JSFunction> float_fun = InstallTypedArray("Float32Array", |
- EXTERNAL_FLOAT_ELEMENTS); |
- native_context()->set_float_array_fun(*float_fun); |
- Handle<JSFunction> double_fun = InstallTypedArray("Float64Array", |
- EXTERNAL_DOUBLE_ELEMENTS); |
- native_context()->set_double_array_fun(*double_fun); |
- Handle<JSFunction> uint8c_fun = InstallTypedArray("Uint8ClampedArray", |
- EXTERNAL_PIXEL_ELEMENTS); |
- native_context()->set_uint8c_array_fun(*uint8c_fun); |
+#define INSTALL_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
+ { \ |
+ Handle<JSFunction> fun = InstallTypedArray(#Type "Array", \ |
+ EXTERNAL_##TYPE##_ELEMENTS); \ |
+ native_context()->set_##type##_array_fun(*fun); \ |
+ } |
+ TYPED_ARRAYS(INSTALL_TYPED_ARRAY) |
+#undef INSTALL_TYPED_ARRAY |
Handle<JSFunction> data_view_fun = |
InstallFunction( |