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

Unified Diff: src/runtime/runtime-array.cc

Issue 2663033003: [builtins] TurboFan version of Array.prototype.forEach including fast path for FAST_ELEMENTS (Closed)
Patch Set: Review feedback Created 3 years, 10 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/array.js ('k') | test/mjsunit/proto-elements-add-during-foreach.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index 20cd65974c0fcaa67e38c823b246b36e073bf970..04a2a313e4eab6e8fc93378f28d36ff25bdf4aae 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -37,7 +37,7 @@ static void InstallCode(
BuiltinFunctionId id = static_cast<BuiltinFunctionId>(-1)) {
Handle<String> key = isolate->factory()->InternalizeUtf8String(name);
Handle<JSFunction> optimized =
- isolate->factory()->NewFunctionWithoutPrototype(key, code);
+ isolate->factory()->NewFunctionWithoutPrototype(key, code, true);
if (argc < 0) {
optimized->shared()->DontAdaptArguments();
} else {
@@ -46,6 +46,8 @@ static void InstallCode(
if (id >= 0) {
optimized->shared()->set_builtin_function_id(id);
}
+ optimized->shared()->set_language_mode(STRICT);
+ optimized->shared()->set_native(true);
JSObject::AddProperty(holder, key, optimized, NONE);
}
@@ -78,11 +80,9 @@ RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) {
kArrayValues);
InstallBuiltin(isolate, holder, "entries", Builtins::kArrayPrototypeEntries,
0, kArrayEntries);
-
return *holder;
}
-
RUNTIME_FUNCTION(Runtime_FixedArrayGet) {
SealHandleScope shs(isolate);
DCHECK_EQ(2, args.length());
« no previous file with comments | « src/js/array.js ('k') | test/mjsunit/proto-elements-add-during-foreach.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698