Lines Matching defs:map

340     Handle<Map> map, AllocationType allocation,
342 DCHECK(map->instance_type() != MAP_TYPE);
343 int size = map->instance_size();
353 result.set_map_after_allocation(*map, write_barrier_mode);
356 Object(result.ptr() + map->instance_size()));
373 HeapObject Factory::New(Handle<Map> map, AllocationType allocation) {
374 DCHECK(map->instance_type() != MAP_TYPE);
375 int size = map->instance_size();
382 result.set_map_after_allocation(*map, write_barrier_mode);
427 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string,
430 Handle<Oddball> oddball(Oddball::cast(New(map, AllocationType::kReadOnly)),
547 Handle<T> Factory::AllocateSmallOrderedHashTable(Handle<Map> map, int capacity,
563 HeapObject result = AllocateRawWithImmortalMap(size, allocation, *map);
636 Map map = roots.swiss_name_dictionary_map();
639 AllocateRawWithImmortalMap(size, AllocationType::kReadOnly, map);
837 // Compute map and object size.
839 Map map;
841 map = *one_byte_internalized_string_map();
844 map = *internalized_string_map();
853 map),
854 map));
886 // This method may be called concurrently, so snapshot the map from the input
888 // reload the map each time.
889 Map map = string->map();
890 *internalized_map = GetInPlaceInternalizedStringMap(map);
894 if (InstanceTypeChecker::IsInternalizedString(map.instance_type())) {
902 Handle<Map> map =
903 GetInPlaceInternalizedStringMap(string->map()).ToHandleChecked();
905 StringClass::cast(New(map, AllocationType::kOld));
930 InstanceType instance_type = string->map().instance_type();
1034 Handle<Map> map = str->IsOneByteRepresentation()
1037 SlicedString slice = SlicedString::cast(New(map, AllocationType::kYoung));
1054 Handle<Map> map = resource->IsCacheable()
1058 ExternalOneByteString::cast(New(map, AllocationType::kOld));
1078 Handle<Map> map = resource->IsCacheable() ? external_string_map()
1081 ExternalTwoByteString::cast(New(map, AllocationType::kOld));
1094 Handle<Map> map(isolate()->native_context()->initial_string_iterator_map(),
1098 Handle<JSStringIterator>::cast(NewJSObjectFromMap(map));
1146 Context Factory::NewContextInternal(Handle<Map> map, int size,
1156 result.set_map_after_allocation(*map);
1160 DCHECK_EQ(context.SizeFromMap(*map), size);
1171 Handle<Map> map = NewMap(NATIVE_CONTEXT_TYPE, kVariableSizeSentinel);
1173 map, NativeContext::kSize, NativeContext::NATIVE_CONTEXT_SLOTS,
1176 context.set_native_context_map(*map);
1177 map->set_native_context(context);
1235 Handle<Map> map;
1238 map = isolate()->eval_context_map();
1241 map = isolate()->function_context_map();
1248 NewContextInternal(map, Context::SizeFor(variadic_part_length),
1467 Map map = *foreign_map();
1469 map.instance_size(), AllocationType::kYoung, map));
1510 Map map = *wasm_type_info_map();
1512 map.instance_size(), AllocationType::kOld, map));
1525 Map map = *wasm_api_function_ref_map();
1527 map.instance_size(), AllocationType::kOld, map));
1566 Map map = *wasm_js_function_data_map();
1569 map.instance_size(), AllocationType::kOld, map));
1581 Map map = *wasm_onfulfilled_data_map();
1584 map.instance_size(), AllocationType::kOld, map));
1597 Map map = *wasm_exported_function_data_map();
1600 map.instance_size(), AllocationType::kOld, map));
1628 Map map = *wasm_capi_function_data_map();
1631 map.instance_size(), AllocationType::kOld, map));
1642 Handle<Map> map) {
1645 AllocateRaw(WasmArray::SizeFor(*map, length), AllocationType::kYoung);
1647 raw.set_map_after_allocation(*map);
1668 Handle<Map> map,
1671 map->wasm_type_info().foreign_address())
1675 AllocateRaw(WasmArray::SizeFor(*map, length), AllocationType::kYoung);
1677 raw.set_map_after_allocation(*map);
1690 Handle<Map> map) {
1691 DCHECK_EQ(WasmStruct::Size(type), map->wasm_type_info().instance_size());
1693 raw.set_map_after_allocation(*map);
1824 Handle<Map> map = with_weak_next ? allocation_site_map()
1827 AllocationSite::cast(New(map, AllocationType::kOld)), isolate());
1861 Map Factory::InitializeMap(Map map, InstanceType type, int instance_size,
1865 map.set_bit_field(0);
1866 map.set_bit_field2(Map::Bits2::NewTargetIsBaseBit::encode(true));
1872 map.set_bit_field3(bit_field3);
1873 map.set_instance_type(type);
1876 map.set_prototype(raw_null_value, SKIP_WRITE_BARRIER);
1877 map.set_constructor_or_back_pointer(raw_null_value, SKIP_WRITE_BARRIER);
1878 map.set_instance_size(instance_size);
1879 if (map.IsJSObjectMap()) {
1880 DCHECK(!ReadOnlyHeap::Contains(map));
1881 map.SetInObjectPropertiesStartInWords(instance_size / kTaggedSize -
1883 DCHECK_EQ(map.GetInObjectProperties(), inobject_properties);
1884 map.set_prototype_validity_cell(roots->invalid_prototype_validity_cell());
1887 map.set_inobject_properties_start_or_constructor_function_index(0);
1888 map.set_prototype_validity_cell(Smi::FromInt(Map::kPrototypeChainValid),
1891 map.set_dependent_code(DependentCode::empty_dependent_code(ro_roots),
1893 map.set_raw_transitions(MaybeObject::FromSmi(Smi::zero()),
1895 map.SetInObjectUnusedPropertyFields(inobject_properties);
1896 map.SetInstanceDescriptors(isolate(), ro_roots.empty_descriptor_array(), 0);
1898 map.set_visitor_id(Map::GetVisitorId(map));
1899 DCHECK(!map.is_in_retained_map_list());
1900 map.clear_padding();
1901 map.set_elements_kind(elements_kind);
1903 if (FLAG_log_maps) LOG(isolate(), MapCreate(map));
1904 return map;
1913 Handle<Map> map(source->map(), isolate());
1917 InstanceType instance_type = map->instance_type();
1935 int object_size = map->instance_size();
1968 if (elements.map() == *fixed_cow_array_map()) {
1985 handle(properties, isolate()), handle(properties.map(), isolate()));
2022 Handle<T> Factory::CopyArrayWithMap(Handle<T> src, Handle<Map> map) {
2026 new_object.set_map_after_allocation(*map, SKIP_WRITE_BARRIER);
2044 new_object.set_map_after_allocation(src->map(), SKIP_WRITE_BARRIER);
2056 Handle<Map> map) {
2057 return CopyArrayWithMap(array, map);
2162 return CopyArrayWithMap(array, handle(array->map(), isolate()));
2254 // Each function prototype gets a fresh map to avoid unwanted sharing of
2427 Handle<Map> map(constructor->initial_map(), isolate());
2428 return NewJSObjectFromMap(map, allocation);
2438 Handle<Map> map(isolate()->object_function()->initial_map(), isolate());
2440 Map::TransitionToPrototype(isolate(), map, null_value());
2447 Handle<Map> map(constructor->initial_map(), isolate());
2448 DCHECK(map->is_dictionary_map());
2450 // Make sure no field properties are described in the initial map.
2453 DCHECK_EQ(map->NextFreePropertyIndex(), 0);
2457 DCHECK_EQ(map->UnusedPropertyFields(), 0);
2458 DCHECK_EQ(map->GetInObjectProperties(), 0);
2466 int at_least_space_for = map->NumberOfOwnDescriptors() * 2 + initial_size;
2472 Handle<DescriptorArray> descs(map->instance_descriptors(isolate()),
2474 for (InternalIndex i : map->IterateOwnDescriptors()) {
2489 JSGlobalObject::cast(New(map, AllocationType::kOld)), isolate());
2490 InitializeJSObjectFromMap(*global, *dictionary, *map);
2492 // Create a new map for the global object.
2493 Handle<Map> new_map = Map::CopyDropDescriptors(isolate(), map);
2509 Map map) {
2514 // according to the object's initial map. For example, if the map's
2520 InitializeJSObjectBody(obj, map, JSObject::kHeaderSize);
2523 void Factory::InitializeJSObjectBody(JSObject obj, Map map, int start_offset) {
2525 if (start_offset == map.instance_size()) return;
2526 DCHECK_LT(start_offset, map.instance_size());
2535 // In case of Array subclassing the |map| could already be transitioned
2536 // to different elements kind from the initial map on which we track slack.
2537 bool in_progress = map.IsInobjectSlackTrackingInProgress();
2538 obj.InitializeBody(map, start_offset, in_progress,
2542 map.FindRootMap(isolate()).InobjectSlackTrackingStep(isolate());
2547 Handle<Map> map, AllocationType allocation,
2551 DCHECK(!InstanceTypeChecker::IsJSFunction((map->instance_type())));
2555 DCHECK(map->instance_type() != JS_GLOBAL_OBJECT_TYPE);
2558 AllocateRawWithAllocationSite(map, allocation, allocation_site));
2560 InitializeJSObjectFromMap(js_obj, *empty_fixed_array(), *map);
2570 Handle<Map> map, int capacity, AllocationType allocation,
2572 DCHECK(map->is_dictionary_map());
2580 NewJSObjectFromMap(map, allocation, allocation_site);
2643 Map map = native_context.GetInitialJSArrayMap(elements_kind);
2644 if (map.is_null()) {
2646 map = array_function.initial_map();
2649 NewJSObjectFromMap(handle(map, isolate()), allocation));
2703 Handle<Map> map(native_context.js_weak_map_fun().initial_map(), isolate());
2704 Handle<JSWeakMap> weakmap(JSWeakMap::cast(*NewJSObjectFromMap(map)),
2715 Handle<Map> map = isolate()->js_module_namespace_map();
2717 Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map)));
2719 *map, InternalIndex(JSModuleNamespace::kToStringTagFieldIndex));
2728 Handle<Map> map(
2736 isolate()->factory()->NewJSObjectFromMap(map));
2750 Handle<Map> map(function->initial_map(), isolate());
2752 DCHECK(map->instance_type() == JS_GENERATOR_OBJECT_TYPE ||
2753 map->instance_type() == JS_ASYNC_GENERATOR_OBJECT_TYPE);
2755 return Handle<JSGeneratorObject>::cast(NewJSObjectFromMap(map));
2827 Handle<Map> map(isolate()->native_context()->array_buffer_fun().initial_map(),
2830 Handle<JSArrayBuffer>::cast(NewJSObjectFromMap(map, allocation));
2846 Handle<Map> map(isolate()->native_context()->array_buffer_fun().initial_map(),
2849 Handle<JSArrayBuffer>::cast(NewJSObjectFromMap(map, allocation));
2858 Handle<Map> map(
2862 NewJSObjectFromMap(map, AllocationType::kYoung));
2872 Handle<Map> map(isolate()->native_context()->iterator_result_map(),
2875 NewJSObjectFromMap(map, AllocationType::kYoung));
2885 Handle<Map> map(isolate()->native_context()->async_from_sync_iterator_map(),
2889 NewJSObjectFromMap(map, AllocationType::kYoung));
2898 Handle<Map> map(isolate()->native_context()->js_map_map(), isolate());
2899 Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map));
2905 Handle<Map> map(isolate()->native_context()->js_set_map(), isolate());
2906 Handle<JSSet> js_set = Handle<JSSet>::cast(NewJSObjectFromMap(map));
2949 Handle<Map> map, Handle<FixedArrayBase> elements,
2955 NewJSObjectFromMap(map, AllocationType::kYoung));
2983 Handle<Map> map;
2987 map = \
3000 map, empty_byte_array(), buffer, byte_offset, byte_length));
3013 Handle<Map> map(isolate()->native_context()->data_view_fun().initial_map(),
3016 map, empty_fixed_array(), buffer, byte_offset, byte_length));
3056 // Setup the map for the JSBoundFunction instance.
3057 Handle<Map> map = target_function->IsConstructor()
3060 if (map->prototype() != *prototype) {
3061 map = Map::TransitionToPrototype(isolate(), map, prototype);
3063 DCHECK_EQ(target_function->IsConstructor(), map->is_constructor());
3067 NewJSObjectFromMap(map, AllocationType::kYoung));
3080 Handle<Map> map;
3083 map = Handle<Map>(isolate()->proxy_constructor_map());
3085 map = Handle<Map>(isolate()->proxy_callable_map());
3088 map = Handle<Map>(isolate()->proxy_map());
3090 DCHECK(map->prototype().IsNull(isolate()));
3091 JSProxy result = JSProxy::cast(New(map, AllocationType::kYoung));
3102 Handle<Map> map = NewMap(JS_GLOBAL_PROXY_TYPE, size);
3106 Map raw = *map;
3112 NewJSObjectFromMap(map, AllocationType::kOld));
3122 Handle<Map> map(constructor->initial_map(), isolate());
3123 Handle<Map> old_map(object->map(), isolate());
3130 map = Map::Copy(isolate(), map, "CopyAsPrototypeForJSGlobalProxy");
3131 map->set_is_prototype_map(true);
3133 JSObject::NotifyMapChange(old_map, map, isolate());
3138 DCHECK(map->instance_size() == old_map->instance_size());
3139 DCHECK(map->instance_type() == old_map->instance_type());
3145 // Reset the map for the object.
3147 raw.set_map(*map, kReleaseStore);
3149 // Reinitialize the object from the constructor map.
3150 InitializeJSObjectFromMap(raw, *raw_properties_or_hash, *map);
3157 Handle<Map> map = message_object_map();
3159 JSMessageObject::cast(New(map, AllocationType::kYoung));
3477 Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map()
3482 Handle<JSObject> result = NewJSObjectFromMap(map);
3499 // Use initial slow object proto map for too many properties.
3511 Map map = Map::cast(heap_object);
3512 DCHECK(!map.is_dictionary_map());
3513 return handle(map, isolate());
3516 // Create a new map and add it to the cache.
3517 Handle<Map> map = Map::Create(isolate(), number_of_properties);
3518 DCHECK(!map->is_dictionary_map());
3519 cache->Set(number_of_properties, HeapObjectReference::Weak(*map));
3520 return map;
3525 Handle<Map> map = read_only_roots().mega_dom_handler_map_handle();
3526 MegaDomHandler handler = MegaDomHandler::cast(New(map, AllocationType::kOld));
3535 Handle<Map> map;
3538 map = load_handler1_map();
3541 map = load_handler2_map();
3544 map = load_handler3_map();
3549 return handle(LoadHandler::cast(New(map, allocation)), isolate());
3553 Handle<Map> map;
3556 map = store_handler0_map();
3559 map = store_handler1_map();
3562 map = store_handler2_map();
3565 map = store_handler3_map();
3570 return handle(StoreHandler::cast(New(map, AllocationType::kOld)), isolate());
3687 Handle<Map> map = NewMap(
3692 Map raw_map = *map;
3699 Map::SetPrototype(isolate(), map, empty_function);
3705 Map::EnsureDescriptorSlack(isolate(), map, descriptors_count);
3720 map->AppendDescriptor(isolate(), &d);
3730 map->AppendDescriptor(isolate(), &d);
3736 map->AppendDescriptor(isolate(), &d);
3741 map->AppendDescriptor(isolate(), &d);
3746 map->AppendDescriptor(isolate(), &d);
3755 map->AppendDescriptor(isolate(), &d);
3759 map->instance_descriptors(isolate()).number_of_slack_descriptors());
3760 LOG(isolate(), MapDetails(*map));
3761 return map;
3779 Handle<Map> map = NewMap(
3784 Map raw_map = *map;
3789 Map::SetPrototype(isolate(), map, empty_function);
3794 Map::EnsureDescriptorSlack(isolate(), map, descriptors_count);
3808 map->AppendDescriptor(isolate(), &d);
3817 map->AppendDescriptor(isolate(), &d);
3823 map->AppendDescriptor(isolate(), &d);
3833 map->AppendDescriptor(isolate(), &d);
3837 map->instance_descriptors(isolate()).number_of_slack_descriptors());
3838 LOG(isolate(), MapDetails(*map));
3839 return map;
3843 Handle<Map> map =
3847 Map raw_map = *map;
3853 Map::SetPrototype(isolate(), map, empty_function);
3858 Map::EnsureDescriptorSlack(isolate(), map, 2);
3869 map->AppendDescriptor(isolate(), &d);
3876 map->AppendDescriptor(isolate(), &d);
3878 LOG(isolate(), MapDetails(*map));
3879 return map;
3903 Handle<Map> map = has_no_side_effect
3906 CallHandlerInfo info = CallHandlerInfo::cast(New(map, AllocationType::kOld));
3962 Handle<Map> map = maybe_map_.ToHandleChecked();
3965 DCHECK(InstanceTypeChecker::IsJSFunction(map->instance_type()));
3968 JSFunction function = JSFunction::cast(factory->New(map, allocation_type_));
3989 function, *map, JSFunction::GetHeaderSize(map->has_prototype_slot()));
3996 // No specific map requested, use the default.