Lines Matching defs:length

449 Handle<PropertyArray> Factory::NewPropertyArray(int length,
451 DCHECK_LE(0, length);
452 if (length == 0) return empty_property_array();
453 HeapObject result = AllocateRawFixedArray(length, allocation);
457 array.initialize_length(length);
458 MemsetTagged(array.data_start(), read_only_roots().undefined_value(), length);
463 int length, AllocationType allocation_type) {
464 DCHECK_LE(0, length);
465 if (length == 0) return empty_fixed_array();
467 int size = FixedArray::SizeFor(length);
479 array.set_length(length);
480 MemsetTagged(array.data_start(), *undefined_value(), length);
485 int length) {
486 if (length == 0) return empty_closure_feedback_cell_array();
490 read_only_roots().closure_feedback_cell_array_map_handle(), length,
499 int length = shared->feedback_metadata().slot_count();
500 DCHECK_LE(0, length);
501 int size = FeedbackVector::SizeFor(length);
509 vector.set_length(length);
516 MemsetTagged(ObjectSlot(vector.slots_start()), *undefined_value(), length);
520 Handle<EmbedderDataArray> Factory::NewEmbedderDataArray(int length) {
521 DCHECK_LE(0, length);
522 int size = EmbedderDataArray::SizeFor(length);
526 array.set_length(length);
528 if (length > 0) {
529 for (int i = 0; i < length; i++) {
537 Handle<FixedArrayBase> Factory::NewFixedDoubleArrayWithHoles(int length) {
538 DCHECK_LE(0, length);
539 Handle<FixedArrayBase> array = NewFixedDoubleArray(length);
540 if (length > 0) {
541 Handle<FixedDoubleArray>::cast(array)->FillWithHoles(0, length);
666 int length, bool convert_encoding) {
667 SeqSubStringKey<SeqString> key(isolate(), string, from, length,
673 Handle<SeqOneByteString> string, int from, int length,
676 Handle<SeqTwoByteString> string, int from, int length,
682 int length = string.length();
683 if (length == 0) return empty_string();
684 if (length == 1) return LookupSingleCharacterStringFromCode(string[0]);
687 NewRawOneByteString(string.length(), allocation),
693 length);
729 Handle<SeqOneByteString> str, int begin, int length,
735 base::Vector<const uint8_t>(str->GetChars(no_gc) + begin, length);
739 if (length == 1) {
741 // Decode even in the case of length 1 since it can be a bad character.
749 return NewSubString(str, begin, begin + length);
764 base::Vector<const uint8_t>(str->GetChars(no_gc) + begin, length);
778 utf8_data = base::Vector<const uint8_t>(str->GetChars(no_gc) + begin, length);
784 int length,
787 if (length == 0) return empty_string();
788 if (String::IsOneByte(string, length)) {
789 if (length == 1) return LookupSingleCharacterStringFromCode(string[0]);
792 NewRawOneByteString(length, allocation), String);
794 CopyChars(result->GetChars(no_gc), string, length);
799 NewRawTwoByteString(length, allocation), String);
801 CopyChars(result->GetChars(no_gc), string, length);
808 return NewStringFromTwoByte(string.begin(), string.length(), allocation);
820 DCHECK(s->length() == len);
825 DCHECK(s->length() == len);
909 external_string.set_length(cast_string.length());
985 DCHECK(begin > 0 || end < str->length());
989 int length = end - begin;
990 if (length <= 0) return empty_string();
991 if (length == 1) {
994 if (length == 2) {
1003 if (!FLAG_string_slices || length < SlicedString::kMinLength) {
1006 NewRawOneByteString(length).ToHandleChecked();
1009 String::WriteToFlat(*str, dest, begin, length);
1013 NewRawTwoByteString(length).ToHandleChecked();
1016 String::WriteToFlat(*str, dest, begin, length);
1040 slice.set_length(length);
1048 size_t length = resource->length();
1049 if (length > static_cast<size_t>(String::kMaxLength)) {
1052 if (length == 0) return empty_string();
1061 external_string.set_length(static_cast<int>(length));
1072 size_t length = resource->length();
1073 if (length > static_cast<size_t>(String::kMaxLength)) {
1076 if (length == 0) return empty_string();
1084 string.set_length(static_cast<int>(length));
1492 for (int i = 0; i < supertypes->length(); i++) {
1498 int last_defined_index = parent_supertypes->length() - 1;
1503 if (last_defined_index == parent_supertypes->length() - 1) {
1643 uint32_t length = static_cast<uint32_t>(elements.size());
1645 AllocateRaw(WasmArray::SizeFor(*map, length), AllocationType::kYoung);
1650 result.set_length(length);
1652 for (uint32_t i = 0; i < length; i++) {
1659 for (uint32_t i = 0; i < length; i++) {
1667 Handle<WasmArray> Factory::NewWasmArrayFromMemory(uint32_t length,
1675 AllocateRaw(WasmArray::SizeFor(*map, length), AllocationType::kYoung);
1680 result.set_length(length);
1683 length * element_type.value_kind_size());
1966 if (elements.length() > 0) {
1982 if (properties.length() > 0) {
2004 void initialize_length(T array, int length) {
2005 array.set_length(length);
2009 void initialize_length<PropertyArray>(PropertyArray array, int length) {
2010 array.initialize_length(length);
2023 int len = src->length();
2039 DCHECK_LE(grow_by, kMaxInt - src->length());
2040 int old_len = src->length();
2104 int old_len = src->length();
2125 int copy_to = 0, length = raw_src.length();
2126 for (int i = 0; i < length; i++) {
2147 DCHECK_LE(new_len, array->length());
2161 if (array->length() == 0) return array;
2167 int len = array->length();
2212 FATAL("Aborting on invalid string length");
2214 // Invalidate the "string length" protector.
2282 int length) {
2284 NewWeakFixedArray(length, AllocationType::kOld));
2335 DCHECK_EQ(reloc_info.length(), canonical_reloc_info.length());
2336 for (int i = 0; i < reloc_info.length(); ++i) {
2404 int size = BytecodeArray::SizeFor(source->length());
2409 copy.set_length(raw_source.length());
2515 // instance type is JS_ARRAY_TYPE, the length field should be initialized
2611 Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind, int length,
2615 DCHECK(capacity >= length);
2617 return NewJSArrayWithElements(empty_fixed_array(), elements_kind, length,
2625 elms, elements_kind, length, allocation));
2630 int length,
2633 elements, elements_kind, length, allocation);
2639 Handle<FixedArrayBase> elements, ElementsKind elements_kind, int length,
2641 DCHECK(length <= elements->length());
2653 raw.set_length(Smi::FromInt(length));
2657 void Factory::NewJSArrayStorage(Handle<JSArray> array, int length, int capacity,
2659 DCHECK(capacity >= length);
2675 raw.set_length(Smi::FromInt(length));
2767 NewFixedArray(module_info->regular_imports().length());
2768 int requested_modules_length = module_info->module_requests().length();
2806 ObjectHashTable::New(isolate(), static_cast<int>(export_names->length()));
2973 size_t length) {
2977 size_t byte_length = length * element_size;
2979 CHECK_LE(length, JSTypedArray::kMaxLength);
2980 CHECK_EQ(length, byte_length / element_size);
3003 raw.set_length(length);
3019 // TODO(v8:11111): Support creating length tracking DataViews via the API.
3030 if (bound_args.length() >= Code::kMaxArguments) {
3047 if (bound_args.length() == 0) {
3050 bound_arguments = NewFixedArray(bound_args.length());
3051 for (int i = 0; i < bound_args.length(); ++i) {
3215 int mask = (cache->length() >> 1) - 1;
3220 int mask = (cache->length() >> 1) - 1;
3242 if (number_string_cache()->length() != full_size) {
3341 static_cast<uint32_t>(number.value()), raw.length());
3364 int i = buffer.length();
3381 static_cast<uint32_t>(value), raw.length());
3474 int length) {
3483 Handle<Smi> value(Smi::FromInt(length), isolate());
3717 { // Add length accessor.
3770 // length and prototype accessors or just length accessor.
3805 { // Add length accessor.
3866 { // Add length accessor.