Lines Matching defs:map
34 #include "src/objects/map-updater.h"
65 #include "src/objects/map-inl.h"
290 if (target->map().is_deprecated()) {
294 Handle<Map> map(JSReceiver::cast(*source).map(), isolate);
296 if (!map->IsJSObjectMap()) return Just(false);
297 if (!map->OnlyHasSimpleProperties()) return Just(false);
307 Handle<DescriptorArray> descriptors(map->instance_descriptors(isolate),
316 for (InternalIndex i : map->IterateOwnDescriptors()) {
332 DCHECK_EQ(from->map(), *map);
333 DCHECK_EQ(*descriptors, map->instance_descriptors(isolate));
343 *map, details.field_index(), representation);
352 stable = from->map() == *map;
353 descriptors.PatchValue(map->instance_descriptors(isolate));
356 // If the map did change, do a slower lookup. We are still guaranteed
378 stable = from->map() == *map;
379 descriptors.PatchValue(map->instance_descriptors(isolate));
520 return map().is_callable() ? roots.Function_string()
528 if (map().elements_kind() == TYPE##_ELEMENTS) { \
555 // constructor on the map provides the most accurate name.
558 if (!receiver->IsJSProxy() && receiver->map().new_target_is_base() &&
559 !receiver->map().is_prototype_map()) {
560 Handle<Object> maybe_constructor(receiver->map().GetConstructor(), isolate);
637 Object constructor = receiver.map().GetConstructor();
668 DCHECK(current.map().is_constructor());
917 if (object->map().is_prototype_map()) {
920 JSObject::InvalidatePrototypeChains(object->map());
1393 // - handle accessors correctly (which might change the holder's map)
1998 if (!receiver->map().IsCustomElementsReceiverMap()) {
2087 Handle<Map> map(JSReceiver::cast(*receiver).map(), isolate);
2089 if (!map->IsJSObjectMap()) return Just(false);
2090 if (!map->OnlyHasSimpleProperties()) return Just(false);
2093 Handle<DescriptorArray> descriptors(map->instance_descriptors(isolate),
2096 int number_of_own_descriptors = map->NumberOfOwnDescriptors();
2120 bool stable = *map == object->map();
2122 descriptors.PatchValue(map->instance_descriptors(isolate));
2134 DCHECK_EQ(object->map(), *map);
2135 DCHECK_EQ(*descriptors, map->instance_descriptors(isolate));
2145 *map, details.field_index(), representation);
2155 stable = object->map() == *map;
2156 descriptors.PatchValue(map->instance_descriptors(isolate));
2159 // If the map did change, do a slower lookup. We are still guaranteed that
2279 Object maybe_constructor = map().GetConstructor();
2326 // Generate the map with the specified {prototype} based on the Object
2327 // function's initial map from the current native context.
2330 Handle<Map> map =
2334 return isolate->factory()->NewFastOrSlowJSObjectFromMap(map);
2343 if (raw_elems.map() != ReadOnlyRoots(isolate).fixed_cow_array_map()) return;
2668 DCHECK_IMPLIES(global_obj->map().is_prototype_map(),
2669 Map::IsPrototypeChainInvalidated(global_obj->map()));
2688 DCHECK_IMPLIES(object->map().is_prototype_map(),
2689 Map::IsPrototypeChainInvalidated(object->map()));
2701 DCHECK_IMPLIES(object->map().is_prototype_map(),
2702 Map::IsPrototypeChainInvalidated(object->map()));
2732 switch (map().instance_type()) {
2816 Map map_of_this = map();
2926 Object maybe_constructor = js_object.map().GetConstructor();
2933 return constructor.initial_map() == heap_object.map();
2946 PrintF("Moving prototype_info %p from map %p to map %p.\n",
2953 // The new map isn't registered with its prototype yet; reflect this fact
2954 // in the PrototypeInfo it just inherited from the old map.
2969 // If the map was registered with its prototype before, ensure that it
2971 // when a map on a prototype chain is registered with its prototype, then
2979 // To migrate a fast instance to a fast map:
2981 // change the map.
2996 Handle<Map> old_map(object->map(), isolate);
2999 // If the map does not add named properties, simply set the map.
3006 // If the map adds a new kDescriptor property, simply set the map.
3014 // can also simply set the map (modulo a special case for mutable
3029 // This migration is a transition from a map that has run out of property
3051 // Set the new property value and do the map transition.
3180 // We are storing the new map using release store after creating a filler for
3197 Handle<Map> map(object->map(isolate), isolate);
3200 int real_size = map->NumberOfOwnDescriptors();
3220 Handle<DescriptorArray> descs(map->instance_descriptors(isolate), isolate);
3226 FieldIndex index = FieldIndex::ForDescriptor(isolate, *map, i);
3268 int old_instance_size = map->instance_size();
3278 // We are storing the new map using release store after creating a filler for
3314 if (object->map(isolate) == *new_map) return;
3315 Handle<Map> old_map(object->map(isolate), isolate);
3332 // Transfer ownership to the new map. Keep the descriptor pointer of the
3333 // old map intact because the concurrent marker might be iterating the
3334 // object with the old map.
3341 DCHECK(object->map(isolate) != *old_map);
3349 // state now: the new map might have a new elements_kind, but the object's
3358 Handle<Map> old_map = Handle<Map>(object->map(), isolate);
3373 Handle<Map> map(object->map(), object->GetIsolate());
3374 return Map::TransitionElementsTo(object->GetIsolate(), map, to_kind);
3377 void JSObject::AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map) {
3378 DCHECK(object->map().GetInObjectProperties() == map->GetInObjectProperties());
3379 ElementsKind obj_kind = object->map().elements_kind();
3380 ElementsKind map_kind = map->elements_kind();
3392 map = MapUpdater{isolate, map}.ReconfigureElementsKind(to_kind);
3394 int number_of_fields = map->NumberOfFields(ConcurrencyMode::kSynchronous);
3395 int inobject = map->GetInObjectProperties();
3396 int unused = map->UnusedPropertyFields();
3403 Handle<DescriptorArray> descriptors(map->instance_descriptors(isolate),
3409 for (InternalIndex i : map->IterateOwnDescriptors()) {
3413 FieldIndex index = FieldIndex::ForDescriptor(*map, i);
3424 FieldIndex index = FieldIndex::ForPropertyIndex(*map, i);
3428 object->set_map(*map, kReleaseStore);
3432 Handle<Map> original_map(object->map(), isolate);
3433 Handle<Map> map = Map::Update(isolate, original_map);
3434 map->set_is_migration_target(true);
3435 JSObject::MigrateToMap(isolate, object, map);
3437 object->PrintInstanceMigration(stdout, *original_map, *map);
3449 Handle<Map> original_map(object->map(), isolate);
3455 if (FLAG_trace_migration && *original_map != object->map()) {
3456 object->PrintInstanceMigration(stdout, *original_map, object->map());
3479 DCHECK(object->map().is_extensible() || name->IsPrivate());
3665 Handle<Map> map(object->map(), isolate);
3667 Map::Normalize(isolate, map, map->elements_kind(), mode, reason);
3731 Handle<Map> old_map(object->map(), isolate);
3735 // Allocate new map.
3738 // old bit because turning a map into dictionary always sets this bit.
3883 if (map().is_prototype_map()) {
3886 InvalidatePrototypeChains(map());
3922 // Set the new map first to satify the elements type assert in set_elements().
4027 bool TestFastPropertiesIntegrityLevel(Map map, PropertyAttributes level) {
4029 DCHECK(!map.IsCustomElementsReceiverMap());
4030 DCHECK(!map.is_dictionary_map());
4032 DescriptorArray descriptors = map.instance_descriptors();
4033 for (InternalIndex i : map.IterateOwnDescriptors()) {
4046 DCHECK(!object.map().IsCustomElementsReceiverMap());
4049 return TestFastPropertiesIntegrityLevel(object.map(), level);
4088 DCHECK(!object.map().IsCustomElementsReceiverMap());
4090 return !object.map().is_extensible() &&
4099 if (!object->map().IsCustomElementsReceiverMap() &&
4122 if (!object->map().is_extensible()) return Just(true);
4132 if (object->map().has_named_interceptor() ||
4133 object->map().has_indexed_interceptor()) {
4149 // Do a map transition, other objects with this map may still
4153 Map::Copy(isolate, handle(object->map(), isolate), "PreventExtensions");
4157 DCHECK(!object->map().is_extensible());
4172 return iter.GetCurrent<JSObject>().map().is_extensible();
4174 return object->map().is_extensible();
4247 if (attrs == NONE && !object->map().is_extensible()) {
4252 ElementsKind old_elements_kind = object->map().elements_kind();
4267 if (object->map().has_named_interceptor() ||
4268 object->map().has_indexed_interceptor()) {
4302 switch (object->map().elements_kind()) {
4320 Handle<Map> old_map(object->map(), isolate);
4349 // Create a new map, since other objects with this map may be extensible.
4351 Handle<Map> new_map = Map::Copy(isolate, handle(object->map(), isolate),
4386 if (object->map().has_any_nonextensible_elements()) {
4403 DCHECK(object->map().has_dictionary_elements() ||
4404 object->map().elements_kind() == SLOW_STRING_WRAPPER_ELEMENTS);
4641 DescriptorArray descs = map().instance_descriptors();
4643 for (InternalIndex i : map().IterateOwnDescriptors()) {
4647 FieldIndex field_index = FieldIndex::ForDescriptor(map(), i);
4682 Map map = Map::cast(value);
4683 DCHECK(map.prototype_info().IsPrototypeInfo());
4684 PrototypeInfo proto_info = PrototypeInfo::cast(map.prototype_info());
4700 Map current_map = current_obj->map();
4702 // If the map is already marked as should be fast, we're done. Its
4705 Handle<Map> map(current_map, isolate);
4706 Map::SetShouldBeFastPrototypeMap(map, true, isolate);
4719 return !object->map().is_prototype_map() ||
4720 !object->map().should_be_fast_prototype_map();
4733 if (object->map().is_prototype_map()) {
4735 object->map().should_be_fast_prototype_map() &&
4741 Map::Copy(isolate, handle(object->map(), isolate), "CopyAsPrototype");
4783 DCHECK_IMPLIES(should_be_dictionary, object->map().is_dictionary_map());
4789 if (!object->map().is_prototype_map()) return;
4790 if (!object->map().should_be_fast_prototype_map()) return;
4829 PrintF("Registering %p as a user of prototype %p (map=%p).\n",
4832 reinterpret_cast<void*>(proto->map().ptr()));
4835 current_user = handle(proto->map(), isolate);
4859 DCHECK(prototype->map().is_prototype_map());
4860 Object maybe_proto_info = prototype->map().prototype_info();
4882 void InvalidateOnePrototypeValidityCellInternal(Map map) {
4883 DCHECK(map.is_prototype_map());
4885 PrintF("Invalidating prototype map %p 's cell\n",
4886 reinterpret_cast<void*>(map.ptr()));
4888 Object maybe_cell = map.prototype_validity_cell();
4894 Object maybe_prototype_info = map.prototype_info();
4911 if (V8_DICT_PROPERTY_CONST_TRACKING_BOOL && map.is_dictionary_map()) {
4913 Isolate* isolate = GetIsolateFromWritableObject(map);
4914 map.dependent_code().DeoptimizeDependentCodeGroup(
4919 void InvalidatePrototypeChainsInternal(Map map) {
4925 for (; !map.is_null(); map = next_map, next_map = Map()) {
4926 InvalidateOnePrototypeValidityCellInternal(map);
4928 Object maybe_proto_info = map.prototype_info();
4957 Map JSObject::InvalidatePrototypeChains(Map map) {
4959 InvalidatePrototypeChainsInternal(map);
4960 return map;
4973 InvalidateOnePrototypeValidityCellInternal(global.map());
4999 bool all_extensible = object->map().is_extensible();
5011 all_extensible = all_extensible && real_receiver->map().is_extensible();
5014 Handle<Map> map(real_receiver->map(), isolate);
5017 if (map->prototype() == *value) return Just(true);
5019 bool immutable_proto = map->is_immutable_proto();
5058 Map::TransitionToPrototype(isolate, map, Handle<HeapObject>::cast(value));
5068 Handle<Map> map(object->map(), object->GetIsolate());
5071 if (map->is_immutable_proto()) return;
5074 Map::TransitionToImmutableProto(object->GetIsolate(), map);
5130 if (!object.map().CanHaveFastTransitionableElementsKind()) {
5162 DCHECK(object->map(isolate).is_extensible());
5228 heap->FindAllocationMemento<Heap::kForRuntime>(object->map(), *object);
5266 // only requires a map change.