Index: src/js/prologue.js |
diff --git a/src/js/prologue.js b/src/js/prologue.js |
index 0b94e2b6544e5ad9ae593302178f9be9d39e9172..ac4e5ace2336f21b89f0f92d447b0e6f40a5f916 100644 |
--- a/src/js/prologue.js |
+++ b/src/js/prologue.js |
@@ -14,6 +14,14 @@ |
var imports = UNDEFINED; |
var imports_from_experimental = UNDEFINED; |
var exports_container = %ExportFromRuntime({}); |
+var typed_array_setup = UNDEFINED; |
+ |
+// Register context value to be initialized with a typed array in |
+// Genesis::InitializeBuiltinTypedArrays. |
+function SetupTypedArray(f) { |
+ f.next = typed_array_setup; |
+ typed_array_setup = f; |
+} |
// Export to other scripts. |
// In normal natives, this exports functions to other normal natives. |
@@ -236,6 +244,9 @@ function PostExperimentals(utils) { |
utils.Export = UNDEFINED; |
utils.PostDebug = UNDEFINED; |
utils.PostExperimentals = UNDEFINED; |
+ utils.InitializeBuiltinTypedArrays = UNDEFINED; |
+ utils.SetupTypedArray = UNDEFINED; |
+ typed_array_setup = UNDEFINED; |
} |
@@ -251,12 +262,25 @@ function PostDebug(utils) { |
utils.ImportNow = UNDEFINED; |
utils.PostDebug = UNDEFINED; |
utils.PostExperimentals = UNDEFINED; |
+ utils.InitializeBuiltinTypedArrays = UNDEFINED; |
+ utils.SetupTypedArray = UNDEFINED; |
+ typed_array_setup = UNDEFINED; |
+} |
+ |
+ |
+function InitializeBuiltinTypedArrays( |
+ utils, rng_state, math_constants, rempio2result) { |
+ var setup_list = typed_array_setup; |
+ |
+ for ( ; !IS_UNDEFINED(setup_list); setup_list = setup_list.next) { |
+ setup_list(rng_state, math_constants, rempio2result); |
+ } |
} |
// ----------------------------------------------------------------------- |
-%OptimizeObjectForAddingMultipleProperties(utils, 13); |
+%OptimizeObjectForAddingMultipleProperties(utils, 15); |
utils.Import = Import; |
utils.ImportNow = ImportNow; |
@@ -271,6 +295,8 @@ utils.SetUpLockedPrototype = SetUpLockedPrototype; |
utils.PostNatives = PostNatives; |
utils.PostExperimentals = PostExperimentals; |
utils.PostDebug = PostDebug; |
+utils.SetupTypedArray = SetupTypedArray; |
+utils.InitializeBuiltinTypedArrays = InitializeBuiltinTypedArrays; |
%ToFastProperties(utils); |