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

Unified Diff: src/bootstrapper.cc

Issue 1330483003: Adding ElementsAccessor::Concat (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-09-01_array_builtins_shift
Patch Set: merging master Created 5 years, 3 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/array.js ('k') | src/builtins.cc » ('j') | no next file with comments »
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 e8cf0d6470a12152d109c041131c46cf0ebc05ea..7ee75b2cab0d01cc731308ae8f002333d35d7050 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2331,6 +2331,40 @@ bool Genesis::InstallNatives(ContextType context_type) {
to_primitive->shared()->set_length(1);
}
+ // Install Array.prototype.concat
+ {
+ Handle<JSFunction> array_constructor(native_context()->array_function());
+ Handle<JSObject> proto(JSObject::cast(array_constructor->prototype()));
+ Handle<JSFunction> concat =
+ InstallFunction(proto, "concat", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ MaybeHandle<JSObject>(), Builtins::kArrayConcat);
+
+ // Make sure that Array.prototype.concat appears to be compiled.
+ // The code will never be called, but inline caching for call will
+ // only work if it appears to be compiled.
+ concat->shared()->DontAdaptArguments();
+ DCHECK(concat->is_compiled());
+ // Set the lengths for the functions to satisfy ECMA-262.
+ concat->shared()->set_length(1);
+ }
+
+ // Install InternalArray.prototype.concat
+ {
+ Handle<JSFunction> array_constructor(
+ native_context()->internal_array_function());
+ Handle<JSObject> proto(JSObject::cast(array_constructor->prototype()));
+ Handle<JSFunction> concat =
+ InstallFunction(proto, "concat", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ MaybeHandle<JSObject>(), Builtins::kArrayConcat);
+
+ // Make sure that InternalArray.prototype.concat appears to be compiled.
+ // The code will never be called, but inline caching for call will
+ // only work if it appears to be compiled.
+ concat->shared()->DontAdaptArguments();
+ DCHECK(concat->is_compiled());
+ // Set the lengths for the functions to satisfy ECMA-262.
+ concat->shared()->set_length(1);
+ }
// Install Function.prototype.call and apply.
{
Handle<String> key = factory()->Function_string();
« no previous file with comments | « src/array.js ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698