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

Unified Diff: src/js/prologue.js

Issue 1420473002: Move math-related typed arrays off js builtins object.. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/js/math.js ('k') | src/third_party/fdlibm/fdlibm.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/js/math.js ('k') | src/third_party/fdlibm/fdlibm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698