@@ -1038,7 +1038,6 @@ RUNTIME_FUNCTION(Runtime_GetArrayKeys) {
10381038
10391039static Object* ArrayConstructorCommon (Isolate* isolate,
10401040 Handle<JSFunction> constructor,
1041- Handle<JSFunction> original_constructor,
10421041 Handle<AllocationSite> site,
10431042 Arguments* caller_args) {
10441043 Factory* factory = isolate->factory ();
@@ -1110,19 +1109,6 @@ static Object* ArrayConstructorCommon(Isolate* isolate,
11101109 // We must mark the allocationsite as un-inlinable.
11111110 site->SetDoNotInlineCall ();
11121111 }
1113-
1114- // Set up the prototoype using original function.
1115- // TODO(dslomov): instead of setting the __proto__,
1116- // use and cache the correct map.
1117- if (*original_constructor != *constructor) {
1118- if (original_constructor->has_instance_prototype ()) {
1119- Handle<Object> prototype =
1120- handle (original_constructor->instance_prototype (), isolate);
1121- RETURN_FAILURE_ON_EXCEPTION (
1122- isolate, JSObject::SetPrototype (array, prototype, false ));
1123- }
1124- }
1125-
11261112 return *array;
11271113}
11281114
@@ -1156,20 +1142,7 @@ RUNTIME_FUNCTION(Runtime_ArrayConstructor) {
11561142 DCHECK (!site->SitePointsToLiteral ());
11571143 }
11581144
1159- return ArrayConstructorCommon (isolate, constructor, constructor, site,
1160- caller_args);
1161- }
1162-
1163-
1164- RUNTIME_FUNCTION (Runtime_ArrayConstructorWithSubclassing) {
1165- HandleScope scope (isolate);
1166- DCHECK (args.length () >= 2 );
1167- int args_length = args.length ();
1168- CONVERT_ARG_HANDLE_CHECKED (JSFunction, constructor, args_length - 2 );
1169- CONVERT_ARG_HANDLE_CHECKED (JSFunction, original_constructor, args_length - 1 );
1170- Arguments caller_args (args_length - 2 , args.arguments ());
1171- return ArrayConstructorCommon (isolate, constructor, original_constructor,
1172- Handle<AllocationSite>::null (), &caller_args);
1145+ return ArrayConstructorCommon (isolate, constructor, site, caller_args);
11731146}
11741147
11751148
@@ -1188,7 +1161,7 @@ RUNTIME_FUNCTION(Runtime_InternalArrayConstructor) {
11881161 DCHECK (arg_count == caller_args->length ());
11891162 }
11901163#endif
1191- return ArrayConstructorCommon (isolate, constructor, constructor,
1164+ return ArrayConstructorCommon (isolate, constructor,
11921165 Handle<AllocationSite>::null (), caller_args);
11931166}
11941167
0 commit comments