Index: src/runtime/runtime-array.cc |
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc |
index 30e936d9c3ea4e1a790f3c5bd5b06827daf24b4d..3e3753c07a88788aec1763ec2d87244000100097 100644 |
--- a/src/runtime/runtime-array.cc |
+++ b/src/runtime/runtime-array.cc |
@@ -272,16 +272,10 @@ Object* ArrayConstructorCommon(Isolate* isolate, Handle<JSFunction> constructor, |
} |
} |
- // TODO(verwaest): new_target could be a proxy. Read new.target.prototype in |
- // that case. |
- Handle<JSFunction> original_function = Handle<JSFunction>::cast(new_target); |
- |
- JSFunction::EnsureHasInitialMap(constructor); |
- |
- // TODO(verwaest): original_function could have non-instance-prototype |
- // (non-JSReceiver), requiring fallback to the intrinsicDefaultProto. |
- Handle<Map> initial_map = |
- JSFunction::EnsureDerivedHasInitialMap(original_function, constructor); |
+ Handle<Map> initial_map; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, initial_map, |
+ JSFunction::GetDerivedMap(isolate, constructor, new_target)); |
ElementsKind to_kind = can_use_type_feedback ? site->GetElementsKind() |
: initial_map->elements_kind(); |