Lines Matching defs:length

64   int args_length = args->length();
128 // If |index| is negative, returns length + index.
130 // Returned value is guaranteed to be in the interval of [0, length].
132 double length,
145 return Just(std::max(length + relative_index, 0.0));
148 return Just(std::min(relative_index, length));
151 // Returns "length", has "fast-path" for JSArrays.
156 double length = array->length().Number();
157 DCHECK(0 <= length && length <= kMaxSafeInteger);
159 return Just(length);
169 // Set "length" property, has "fast-path" for JSArrays.
172 Isolate* isolate, Handle<JSReceiver> receiver, double length) {
176 DCHECK_LE(length, kMaxUInt32);
178 JSArray::SetLength(array, static_cast<uint32_t>(length)));
185 isolate->factory()->NewNumber(length), StoreOrigin::kMaybeKeyed,
230 if (args->length() == 1 && array->GetElementsKind() != PACKED_ELEMENTS) {
264 // 2. Let len be ? ToLength(? Get(O, "length")).
265 double length;
267 isolate, length, GetLengthProperty(isolate, receiver));
276 isolate, start_index, GetRelativeIndex(isolate, length, start, 0));
286 isolate, end_index, GetRelativeIndex(isolate, length, end, length));
293 DCHECK_LE(end_index, length);
314 // 2. Let len be ? ToLength(? Get(O, "length")).
323 int arg_count = args->length() - 1;
326 double length = raw_length_number->Number();
327 if (arg_count > kMaxSafeInteger - length) {
341 if (length <= JSObject::kMaxElementIndex) {
343 isolate, Object::SetElement(isolate, receiver, length, element,
346 PropertyKey key(isolate, length);
354 ++length;
357 // 7. Perform ? Set(O, "length", len, true).
358 Handle<Object> final_length = isolate->factory()->NewNumber(length);
374 args.length() - 1)) {
379 int to_add = args.length() - 1;
381 uint32_t len = static_cast<uint32_t>(array->length().Number());
385 DCHECK_LE(to_add, Smi::kMaxValue - Smi::ToInt(array->length()));
407 // 2. Let len be ? ToLength(? Get(O, "length")).
412 double length = raw_length_number->Number();
415 if (length == 0) {
416 // a. Perform ? Set(O, "length", 0, true).
430 Handle<Object> new_length = isolate->factory()->NewNumber(length - 1);
445 // e. Perform ? Set(O, "length", newLen, true).
467 uint32_t len = static_cast<uint32_t>(array->length().Number());
485 // The length could have become read-only during the last GetElement() call,
518 double length) {
528 while (k < length) {
569 isolate->factory()->NewNumber(length - 1));
574 // 8. Perform ? Set(O, "length", len-1, true).
576 SetLengthProperty(isolate, receiver, length - 1));
591 // 2. Let len be ? ToLength(? Get(O, "length")).
592 double length;
594 isolate, length, GetLengthProperty(isolate, receiver));
597 if (length == 0) {
598 // a. Perform ? Set(O, "length", 0, true).
600 SetLengthProperty(isolate, receiver, length));
612 return GenericArrayShift(isolate, receiver, length);
627 args.length() - 1);
629 int to_add = args.length() - 1;
630 if (to_add == 0) return array->length();
633 DCHECK_LE(to_add, Smi::kMaxValue - Smi::ToInt(array->length()));
656 * length overflows 32-bit non-negative integer.
701 if (index < static_cast<uint32_t>(storage_fixed_array()->length())) {
705 // Our initial estimate of length was foiled, possibly by
706 // getters on the arrays increasing the length of later arrays
735 // If the initial length estimate was off (see special case in visit()),
740 static_cast<uint32_t>(FixedArrayBase::cast(*storage_).length())) {
752 Handle<Object> length =
756 array->set_length(*length);
765 Handle<Object> length =
770 isolate_, result, isolate_->factory()->length_string(), length,
785 NumberDictionary::New(isolate_, current_storage->length()));
786 uint32_t current_length = static_cast<uint32_t>(current_storage->length());
843 uint32_t length = static_cast<uint32_t>(array->length().Number());
859 int fast_length = static_cast<int>(length);
871 int fast_length = static_cast<int>(length);
873 DCHECK_EQ(FixedArray::cast(array->elements()).length(), 0);
898 return length;
931 uint32_t length = static_cast<uint32_t>(elements.length());
932 if (range < length) length = range;
933 for (uint32_t i = 0; i < length; i++) {
943 DCHECK_EQ(object->elements().length(), 0);
948 uint32_t length = static_cast<uint32_t>(elements->length());
949 if (range < length) length = range;
950 for (uint32_t i = 0; i < length; i++) {
976 size_t length = Handle<JSTypedArray>::cast(object)->length();
977 if (range <= length) {
978 length = range;
983 // {range} puts a cap on {length}.
984 DCHECK_LE(length, std::numeric_limits<uint32_t>::max());
985 for (uint32_t i = 0; i < length; i++) {
988 if (length == range) return; // All indices accounted for already.
1017 uint32_t length = static_cast<uint32_t>(string->length());
1019 uint32_t limit = std::min(length, range);
1048 uint32_t length, ArrayConcatVisitor* visitor) {
1049 FOR_WITH_HANDLE_SCOPE(isolate, uint32_t, i = 0, i, i < length, ++i, {
1060 visitor->increase_index_offset(length);
1070 * length.
1075 uint32_t length = 0;
1079 length = static_cast<uint32_t>(array->length().Number());
1090 if (!val->ToUint32(&length)) {
1091 length = 0;
1094 return IterateElementsSlow(isolate, receiver, length, visitor);
1099 return IterateElementsSlow(isolate, receiver, length, visitor);
1120 int fast_length = static_cast<int>(length);
1121 DCHECK(fast_length <= elements->length());
1147 if (length == 0) break;
1151 DCHECK_EQ(array->elements().length(), 0);
1156 int fast_length = static_cast<int>(length);
1157 DCHECK(fast_length <= elements->length());
1190 // than length. This might introduce duplicates in the indices list.
1191 CollectElementIndices(isolate, array, length, &indices);
1211 isolate, uint32_t, index = 0, index, index < length, index++, {
1227 return IterateElementsSlow(isolate, receiver, length, visitor);
1237 visitor->increase_index_offset(length);
1259 int argument_count = args->length();
1263 // Pass 1: estimate the length and number of elements of the result.
1264 // The actual length can be larger if any of the arguments have getters
1278 length_estimate = static_cast<uint32_t>(array->length().Number());
1309 // If estimated number of elements is more than half of length, a
1335 uint32_t length = static_cast<uint32_t>(array.length().Number());
1340 if (length == 0) break;
1343 for (uint32_t k = 0; k < length; k++) {
1363 for (uint32_t k = 0; k < length; k++) {
1385 DCHECK_EQ(0u, length);
1410 Handle<Object> length(Smi::zero(), isolate);
1414 Execution::New(isolate, species, species, 1, &length));
1450 // If there is only the 'length' property we are fine.
1471 int n_arguments = args->length();
1476 // and calculating total length.
1491 // The Array length is guaranted to be <= kHalfOfMaxInt thus we won't
1493 result_len += Smi::ToInt(array->length());
1658 k.as_uint32() >= static_cast<uint32_t>(array->length().Number())) {