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

Unified Diff: src/js/prologue.js

Issue 2663033003: [builtins] TurboFan version of Array.prototype.forEach including fast path for FAST_ELEMENTS (Closed)
Patch Set: Rebase on ToT Created 3 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/js/array.js ('K') | « src/js/array.js ('k') | src/runtime/runtime.h » ('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 e51ab558b6605e62d87b6be93ed9f34122f30e8b..df7370c33ed69fdfef593fb3864902d08267d68f 100644
--- a/src/js/prologue.js
+++ b/src/js/prologue.js
@@ -15,6 +15,11 @@ var imports = UNDEFINED;
var imports_from_experimental = UNDEFINED;
var exports_container = %ExportFromRuntime({});
var typed_array_setup = UNDEFINED;
+var InstallExperimentalArrayFunctions;
+
+Import(function(from) {
+ InstallExperimentalArrayFunctions = from.InstallExperimentalArrayFunctions;
+});
// Register context value to be initialized with a typed array in
// Genesis::InitializeBuiltinTypedArrays.
@@ -86,14 +91,17 @@ function InstallConstants(object, constants) {
}
-function InstallFunctions(object, attributes, functions) {
+ function InstallFunctions(object, attributes, functions,
+ remove_prototype = true) {
%CheckIsBootstrapping();
%OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
for (var i = 0; i < functions.length; i += 2) {
var key = functions[i];
var f = functions[i + 1];
SetFunctionName(f, key);
- %FunctionRemovePrototype(f);
+ if (remove_prototype) {
+ %FunctionRemovePrototype(f);
+ }
%AddNamedProperty(object, key, f, attributes);
%SetNativeFlag(f);
}
@@ -200,7 +208,6 @@ function PostNatives(utils) {
utils.ImportFromExperimental = UNDEFINED;
}
-
function PostExperimentals(utils) {
%CheckIsBootstrapping();
%ExportExperimentalFromRuntime(exports_container);
@@ -216,6 +223,8 @@ function PostExperimentals(utils) {
utils.PostDebug = UNDEFINED;
utils.PostExperimentals = UNDEFINED;
typed_array_setup = UNDEFINED;
+
+ InstallExperimentalArrayFunctions();
}
« src/js/array.js ('K') | « src/js/array.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698