Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 65dbaebdba781312618fbb87c8c0c47fca7109ff..96b002601aea186c427c88f89bd72f5ac636ada7 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -2330,6 +2330,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 Function.prototype.call appears to be compiled. |
Igor Sheludko
2015/09/07 10:53:11
Please update comment.
|
+ // 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 Function.prototype.call appears to be compiled. |
Igor Sheludko
2015/09/07 10:53:10
Please update comment.
|
+ // 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(); |