Lines Matching refs:idx
522 static void zend_hash_remove_iterator_copies(uint32_t idx) { in zend_hash_remove_iterator_copies() argument
525 HashTableIterator *iter = iterators + idx; in zend_hash_remove_iterator_copies()
527 while (next_idx != idx) { in zend_hash_remove_iterator_copies()
534 iter->next_copy = idx; in zend_hash_remove_iterator_copies()
541 uint32_t idx; in zend_hash_iterator_add() local
550 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
551 iter->next_copy = idx; in zend_hash_iterator_add()
552 if (idx + 1 > EG(ht_iterators_used)) { in zend_hash_iterator_add()
553 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
555 return idx; in zend_hash_iterator_add()
570 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
571 iter->next_copy = idx; in zend_hash_iterator_add()
572 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
573 return idx; in zend_hash_iterator_add()
577 static zend_always_inline bool zend_hash_iterator_find_copy_pos(uint32_t idx, HashTable *ht) { in zend_hash_iterator_find_copy_pos() argument
578 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_find_copy_pos()
581 if (EXPECTED(next_idx != idx)) { in zend_hash_iterator_find_copy_pos()
583 while (next_idx != idx) { in zend_hash_iterator_find_copy_pos()
597 zend_hash_remove_iterator_copies(idx); in zend_hash_iterator_find_copy_pos()
602 zend_hash_remove_iterator_copies(idx); in zend_hash_iterator_find_copy_pos()
608 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht) in zend_hash_iterator_pos() argument
610 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos()
612 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos()
613 if (UNEXPECTED(iter->ht != ht) && !zend_hash_iterator_find_copy_pos(idx, ht)) { in zend_hash_iterator_pos()
627 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array) in zend_hash_iterator_pos_ex() argument
630 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos_ex()
632 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos_ex()
633 if (UNEXPECTED(iter->ht != ht) && !zend_hash_iterator_find_copy_pos(idx, ht)) { in zend_hash_iterator_pos_ex()
649 ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx) in zend_hash_iterator_del() argument
651 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_del()
653 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_del()
662 if (UNEXPECTED(iter->next_copy != idx)) { in zend_hash_iterator_del()
663 zend_hash_remove_iterator_copies(idx); in zend_hash_iterator_del()
666 if (idx == EG(ht_iterators_used) - 1) { in zend_hash_iterator_del()
667 while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) { in zend_hash_iterator_del()
668 idx--; in zend_hash_iterator_del()
670 EG(ht_iterators_used) = idx; in zend_hash_iterator_del()
741 uint32_t idx; in zend_hash_find_bucket() local
748 idx = HT_HASH_EX(arData, nIndex); in zend_hash_find_bucket()
750 if (UNEXPECTED(idx == HT_INVALID_IDX)) { in zend_hash_find_bucket()
753 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
764 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
765 if (idx == HT_INVALID_IDX) { in zend_hash_find_bucket()
768 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
778 uint32_t idx; in zend_hash_str_find_bucket() local
783 idx = HT_HASH_EX(arData, nIndex); in zend_hash_str_find_bucket()
784 while (idx != HT_INVALID_IDX) { in zend_hash_str_find_bucket()
785 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_str_find_bucket()
786 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
792 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
800 uint32_t idx; in zend_hash_index_find_bucket() local
805 idx = HT_HASH_EX(arData, nIndex); in zend_hash_index_find_bucket()
806 while (idx != HT_INVALID_IDX) { in zend_hash_index_find_bucket()
807 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_index_find_bucket()
808 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
812 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
821 uint32_t idx; in _zend_hash_add_or_update_i() local
880 idx = ht->nNumUsed++; in _zend_hash_add_or_update_i()
883 p = arData + idx; in _zend_hash_add_or_update_i()
888 HT_HASH_EX(arData, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_add_or_update_i()
902 uint32_t idx; in _zend_hash_str_add_or_update_i() local
955 idx = ht->nNumUsed++; in _zend_hash_str_add_or_update_i()
957 p = ht->arData + idx; in _zend_hash_str_add_or_update_i()
973 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_str_add_or_update_i()
1086 uint32_t idx; in _zend_hash_index_add_or_update_i() local
1171 idx = ht->nNumUsed++; in _zend_hash_index_add_or_update_i()
1173 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
1175 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_index_add_or_update_i()
1242 uint32_t idx, i; in zend_hash_set_bucket_key() local
1263 idx = HT_IDX_TO_HASH(b - arData); in zend_hash_set_bucket_key()
1266 if (i == idx) { in zend_hash_set_bucket_key()
1270 while (Z_NEXT(p->val) != idx) { in zend_hash_set_bucket_key()
1279 idx = b - arData; in zend_hash_set_bucket_key()
1283 idx = HT_IDX_TO_HASH(idx); in zend_hash_set_bucket_key()
1285 if (i == HT_INVALID_IDX || i < idx) { in zend_hash_set_bucket_key()
1287 HT_HASH_EX(arData, nIndex) = idx; in zend_hash_set_bucket_key()
1290 while (Z_NEXT(p->val) != HT_INVALID_IDX && Z_NEXT(p->val) > idx) { in zend_hash_set_bucket_key()
1295 Z_NEXT(p->val) = idx; in zend_hash_set_bucket_key()
1446 static zend_always_inline void _zend_hash_packed_del_val(HashTable *ht, uint32_t idx, zval *zv) in _zend_hash_packed_del_val() argument
1448 idx = HT_HASH_TO_IDX(idx); in _zend_hash_packed_del_val()
1450 if (ht->nNumUsed - 1 == idx) { in _zend_hash_packed_del_val()
1467 static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint32_t idx, Bucket *p, Bucket … in _zend_hash_del_el_ex() argument
1474 idx = HT_HASH_TO_IDX(idx); in _zend_hash_del_el_ex()
1476 if (ht->nNumUsed - 1 == idx) { in _zend_hash_del_el_ex()
1493 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1502 if (i != idx) { in _zend_hash_del_el()
1504 while (Z_NEXT(prev->val) != idx) { in _zend_hash_del_el()
1514 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1538 uint32_t idx; in zend_hash_del() local
1548 idx = HT_HASH(ht, nIndex); in zend_hash_del()
1549 while (idx != HT_INVALID_IDX) { in zend_hash_del()
1550 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1557 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1561 idx = Z_NEXT(p->val); in zend_hash_del()
1570 uint32_t idx; in zend_hash_del_ind() local
1580 idx = HT_HASH(ht, nIndex); in zend_hash_del_ind()
1581 while (idx != HT_INVALID_IDX) { in zend_hash_del_ind()
1582 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1606 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1611 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1620 uint32_t idx; in zend_hash_str_del_ind() local
1630 idx = HT_HASH(ht, nIndex); in zend_hash_str_del_ind()
1631 while (idx != HT_INVALID_IDX) { in zend_hash_str_del_ind()
1632 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1651 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1656 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1665 uint32_t idx; in zend_hash_str_del() local
1675 idx = HT_HASH(ht, nIndex); in zend_hash_str_del()
1676 while (idx != HT_INVALID_IDX) { in zend_hash_str_del()
1677 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1683 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1687 idx = Z_NEXT(p->val); in zend_hash_str_del()
1695 uint32_t idx; in zend_hash_index_del() local
1714 idx = HT_HASH(ht, nIndex); in zend_hash_index_del()
1715 while (idx != HT_INVALID_IDX) { in zend_hash_index_del()
1716 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1718 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1722 idx = Z_NEXT(p->val); in zend_hash_index_del()
1988 uint32_t idx; in zend_hash_graceful_destroy() local
1996 for (idx = 0; idx < ht->nNumUsed; idx++, zv++) { in zend_hash_graceful_destroy()
1998 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_graceful_destroy()
2003 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
2005 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
2017 uint32_t idx; in zend_hash_graceful_reverse_destroy() local
2022 idx = ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
2026 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
2027 idx--; in zend_hash_graceful_reverse_destroy()
2030 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_graceful_reverse_destroy()
2035 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
2036 idx--; in zend_hash_graceful_reverse_destroy()
2039 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
2061 uint32_t idx; in zend_hash_apply() local
2066 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
2067 zval *zv = ht->arPacked + idx; in zend_hash_apply()
2074 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply()
2081 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
2082 Bucket *p = ht->arData + idx; in zend_hash_apply()
2089 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
2101 uint32_t idx; in zend_hash_apply_with_argument() local
2106 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
2107 zval *zv = ht->arPacked + idx; in zend_hash_apply_with_argument()
2113 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply_with_argument()
2120 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
2121 Bucket *p = ht->arData + idx; in zend_hash_apply_with_argument()
2127 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
2139 uint32_t idx; in zend_hash_apply_with_arguments() local
2147 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
2148 zval *zv = ht->arPacked + idx; in zend_hash_apply_with_arguments()
2152 hash_key.h = idx; in zend_hash_apply_with_arguments()
2159 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply_with_arguments()
2168 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
2169 Bucket *p = ht->arData + idx; in zend_hash_apply_with_arguments()
2180 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
2194 uint32_t idx; in zend_hash_reverse_apply() local
2199 idx = ht->nNumUsed; in zend_hash_reverse_apply()
2203 while (idx > 0) { in zend_hash_reverse_apply()
2204 idx--; in zend_hash_reverse_apply()
2205 zv = ht->arPacked + idx; in zend_hash_reverse_apply()
2212 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_reverse_apply()
2221 while (idx > 0) { in zend_hash_reverse_apply()
2222 idx--; in zend_hash_reverse_apply()
2223 p = ht->arData + idx; in zend_hash_reverse_apply()
2230 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
2242 uint32_t idx; in zend_hash_copy() local
2250 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
2251 zval *zv = source->arPacked + idx; in zend_hash_copy()
2254 new_entry = zend_hash_index_update(target, idx, zv); in zend_hash_copy()
2262 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
2263 Bucket *p = source->arData + idx; in zend_hash_copy()
2324 …bool zend_array_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket … in zend_array_dup_element() argument
2341 HT_HASH(target, nIndex) = HT_IDX_TO_HASH(idx); in zend_array_dup_element()
2387 uint32_t idx = 0; in zend_array_dup_elements() local
2397 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2398 uint32_t target_idx = idx; in zend_array_dup_elements()
2400 idx++; p++; in zend_array_dup_elements()
2404 if (source->nInternalPointer == idx) { in zend_array_dup_elements()
2409 idx++; p++; in zend_array_dup_elements()
2413 uint32_t iter_pos = zend_hash_iterators_lower_pos(target, idx); in zend_array_dup_elements()
2417 if (source->nInternalPointer == idx) { in zend_array_dup_elements()
2420 if (UNEXPECTED(idx >= iter_pos)) { in zend_array_dup_elements()
2424 } while (iter_pos < idx); in zend_array_dup_elements()
2428 idx++; p++; in zend_array_dup_elements()
2433 idx++; p++; q++; in zend_array_dup_elements()
2435 return idx; in zend_array_dup_elements()
2440 uint32_t idx; in zend_array_dup() local
2509 idx = zend_array_dup_elements(source, target, 1, 0); in zend_array_dup()
2511 idx = zend_array_dup_elements(source, target, 1, 1); in zend_array_dup()
2515 idx = zend_array_dup_elements(source, target, 0, 0); in zend_array_dup()
2517 idx = zend_array_dup_elements(source, target, 0, 1); in zend_array_dup()
2520 target->nNumUsed = idx; in zend_array_dup()
2521 target->nNumOfElements = idx; in zend_array_dup()
2549 uint32_t idx; in zend_hash_merge() local
2559 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2560 s = source->arPacked + idx; in zend_hash_merge()
2564 t = zend_hash_index_update(target, idx, s); in zend_hash_merge()
2572 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2573 p = source->arData + idx; in zend_hash_merge()
2595 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2596 s = source->arPacked + idx; in zend_hash_merge()
2600 t = zend_hash_index_add(target, idx, s); in zend_hash_merge()
2608 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2609 p = source->arData + idx; in zend_hash_merge()
2645 uint32_t idx; in zend_hash_merge_ex() local
2654 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge_ex()
2655 p = source->arData + idx; in zend_hash_merge_ex()
2746 uint32_t idx; in zend_hash_internal_pointer_end_ex() local
2751 idx = ht->nNumUsed; in zend_hash_internal_pointer_end_ex()
2753 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2754 idx--; in zend_hash_internal_pointer_end_ex()
2755 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2756 *pos = idx; in zend_hash_internal_pointer_end_ex()
2761 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2762 idx--; in zend_hash_internal_pointer_end_ex()
2763 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2764 *pos = idx; in zend_hash_internal_pointer_end_ex()
2775 uint32_t idx; in zend_hash_move_forward_ex() local
2780 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_move_forward_ex()
2781 if (idx < ht->nNumUsed) { in zend_hash_move_forward_ex()
2784 idx++; in zend_hash_move_forward_ex()
2785 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2789 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_move_forward_ex()
2790 *pos = idx; in zend_hash_move_forward_ex()
2796 idx++; in zend_hash_move_forward_ex()
2797 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2801 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_forward_ex()
2802 *pos = idx; in zend_hash_move_forward_ex()
2814 uint32_t idx = *pos; in zend_hash_move_backwards_ex() local
2819 if (idx < ht->nNumUsed) { in zend_hash_move_backwards_ex()
2821 while (idx > 0) { in zend_hash_move_backwards_ex()
2822 idx--; in zend_hash_move_backwards_ex()
2823 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2824 *pos = idx; in zend_hash_move_backwards_ex()
2829 while (idx > 0) { in zend_hash_move_backwards_ex()
2830 idx--; in zend_hash_move_backwards_ex()
2831 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2832 *pos = idx; in zend_hash_move_backwards_ex()
2848 uint32_t idx; in zend_hash_get_current_key_ex() local
2852 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_ex()
2853 if (idx < ht->nNumUsed) { in zend_hash_get_current_key_ex()
2855 *num_index = idx; in zend_hash_get_current_key_ex()
2858 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2872 uint32_t idx; in zend_hash_get_current_key_zval_ex() local
2876 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_zval_ex()
2877 if (idx >= ht->nNumUsed) { in zend_hash_get_current_key_zval_ex()
2881 ZVAL_LONG(key, idx); in zend_hash_get_current_key_zval_ex()
2884 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2895 uint32_t idx; in zend_hash_get_current_key_type_ex() local
2899 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_type_ex()
2900 if (idx < ht->nNumUsed) { in zend_hash_get_current_key_type_ex()
2904 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2917 uint32_t idx; in zend_hash_get_current_data_ex() local
2921 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_data_ex()
2922 if (idx < ht->nNumUsed) { in zend_hash_get_current_data_ex()
2924 return &ht->arPacked[idx]; in zend_hash_get_current_data_ex()
2926 p = ht->arData + idx; in zend_hash_get_current_data_ex()
3226 uint32_t idx; in zend_hash_minmax() local
3238 idx = 0; in zend_hash_minmax()
3240 if (idx == ht->nNumUsed) { in zend_hash_minmax()
3243 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) break; in zend_hash_minmax()
3244 idx++; in zend_hash_minmax()
3246 res = ht->arPacked + idx; in zend_hash_minmax()
3247 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
3248 zv = ht->arPacked + idx; in zend_hash_minmax()
3264 idx = 0; in zend_hash_minmax()
3266 if (idx == ht->nNumUsed) { in zend_hash_minmax()
3269 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) break; in zend_hash_minmax()
3270 idx++; in zend_hash_minmax()
3272 res = &ht->arData[idx].val; in zend_hash_minmax()
3273 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
3274 p = ht->arData + idx; in zend_hash_minmax()
3291 …API bool ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx) in _zend_handle_numeric_str_ex() argument
3308 *idx = (*tmp - '0'); in _zend_handle_numeric_str_ex()
3313 if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
3316 *idx = 0 - *idx; in _zend_handle_numeric_str_ex()
3317 } else if (*idx > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
3323 *idx = (*idx * 10) + (*tmp - '0'); in _zend_handle_numeric_str_ex()