Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 9277719b0fcbfab23de70e27aff41c957372b3de..0dc2ac2dcfa7dc9d96430cfab98908b8a127a73a 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -1606,8 +1606,14 @@ Handle<JSFunction> Genesis::InstallInternalArray( |
factory()->NewJSObject(isolate()->object_function(), TENURED); |
SetPrototype(array_function, prototype); |
- array_function->shared()->set_construct_stub( |
- isolate()->builtins()->builtin(Builtins::kCommonArrayConstructCode)); |
+ if (FLAG_optimize_constructed_arrays) { |
+ InternalArrayConstructorStub internal_array_constructor_stub(isolate()); |
+ Handle<Code> code = internal_array_constructor_stub.GetCode(isolate()); |
+ array_function->shared()->set_construct_stub(*code); |
+ } else { |
+ array_function->shared()->set_construct_stub( |
+ isolate()->builtins()->builtin(Builtins::kCommonArrayConstructCode)); |
+ } |
array_function->shared()->DontAdaptArguments(); |