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

Unified Diff: src/bootstrapper.cc

Issue 2663033003: [builtins] TurboFan version of Array.prototype.forEach including fast path for FAST_ELEMENTS (Closed)
Patch Set: Disable 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
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/runtime/runtime-array.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index da25d060ff14446258a2760ec2dc8b9dc2379130..95e18098b19e89def682e8f51cd6fd63763c8166 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -217,6 +217,8 @@ class Genesis BASE_EMBEDDED {
HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION)
#undef DECLARE_FEATURE_INITIALIZATION
+ void InitializeGlobal_enable_fast_array_builtins();
+
Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target,
const char* name, Builtins::Name call,
BuiltinFunctionId id);
@@ -2911,6 +2913,8 @@ void Genesis::InitializeExperimentalGlobal() {
HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL)
HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL)
#undef FEATURE_INITIALIZE_GLOBAL
+
+ InitializeGlobal_enable_fast_array_builtins();
}
@@ -3540,6 +3544,22 @@ void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
JSObject::AddProperty(symbol, name_string, value, attributes);
}
+void Genesis::InitializeGlobal_enable_fast_array_builtins() {
+ if (!FLAG_enable_fast_array_builtins) return;
+
+ Handle<JSGlobalObject> global(native_context()->global_object());
+ Isolate* isolate = global->GetIsolate();
+ Factory* factory = isolate->factory();
+
+ Handle<JSObject> utils =
+ Handle<JSObject>::cast(isolate->natives_utils_object());
Yang 2017/02/03 10:20:25 Alternatively, you could just get global.Array.pro
danno 2017/02/03 12:46:55 Done.
+ LookupIterator it(utils,
+ factory->NewStringFromAsciiChecked("ForEachFunction"),
+ LookupIterator::OWN_SKIP_INTERCEPTOR);
+ Handle<Object> for_each_function = Object::GetProperty(&it).ToHandleChecked();
+ Handle<JSFunction>::cast(for_each_function)
+ ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
+}
void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
if (!FLAG_harmony_sharedarraybuffer) return;
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/runtime/runtime-array.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698