Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 28007d73f5e1ce27867312a38e713ef5d6d9cc8a..d2821a4320755d0b2c1d56c9c5a5896291d5f6f2 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -10512,6 +10512,9 @@ void JSFunction::SetInstancePrototype(Handle<JSFunction> function, |
function->set_prototype_or_initial_map(*value); |
} else { |
Handle<Map> new_map = Map::Copy(initial_map, "SetInstancePrototype"); |
+ if (function->map()->is_strong()) { |
+ new_map->set_is_strong(); |
+ } |
JSFunction::SetInitialMap(function, new_map, value); |
// If the function is used as the global Array function, cache the |
@@ -10636,6 +10639,9 @@ void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
in_object_properties = function->shared()->CalculateInObjectProperties(); |
} |
Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); |
+ if (function->map()->is_strong()) { |
+ map->set_is_strong(); |
+ } |
// Fetch or allocate prototype. |
Handle<Object> prototype; |
@@ -10649,7 +10655,8 @@ void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
DCHECK(map->has_fast_object_elements()); |
// Finally link initial map and constructor function. |
- JSFunction::SetInitialMap(function, map, Handle<JSReceiver>::cast(prototype)); |
+ DCHECK(prototype->IsJSReceiver()); |
+ JSFunction::SetInitialMap(function, map, prototype); |
if (!function->shared()->is_generator()) { |
function->StartInobjectSlackTracking(); |