Lines Matching refs:idx

511 	uint32_t idx;  in zend_hash_iterator_add()  local
520 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
521 if (idx + 1 > EG(ht_iterators_used)) { in zend_hash_iterator_add()
522 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
524 return idx; in zend_hash_iterator_add()
539 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
540 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
541 return idx; in zend_hash_iterator_add()
544 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht) in zend_hash_iterator_pos() argument
546 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos()
548 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos()
563 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array) in zend_hash_iterator_pos_ex() argument
566 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos_ex()
568 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos_ex()
585 ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx) in zend_hash_iterator_del() argument
587 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_del()
589 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_del()
598 if (idx == EG(ht_iterators_used) - 1) { in zend_hash_iterator_del()
599 while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) { in zend_hash_iterator_del()
600 idx--; in zend_hash_iterator_del()
602 EG(ht_iterators_used) = idx; in zend_hash_iterator_del()
673 uint32_t idx; in zend_hash_find_bucket() local
680 idx = HT_HASH_EX(arData, nIndex); in zend_hash_find_bucket()
682 if (UNEXPECTED(idx == HT_INVALID_IDX)) { in zend_hash_find_bucket()
685 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
696 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
697 if (idx == HT_INVALID_IDX) { in zend_hash_find_bucket()
700 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
710 uint32_t idx; in zend_hash_str_find_bucket() local
715 idx = HT_HASH_EX(arData, nIndex); in zend_hash_str_find_bucket()
716 while (idx != HT_INVALID_IDX) { in zend_hash_str_find_bucket()
717 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_str_find_bucket()
718 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
724 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
732 uint32_t idx; in zend_hash_index_find_bucket() local
737 idx = HT_HASH_EX(arData, nIndex); in zend_hash_index_find_bucket()
738 while (idx != HT_INVALID_IDX) { in zend_hash_index_find_bucket()
739 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_index_find_bucket()
740 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
744 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
753 uint32_t idx; in _zend_hash_add_or_update_i() local
812 idx = ht->nNumUsed++; in _zend_hash_add_or_update_i()
815 p = arData + idx; in _zend_hash_add_or_update_i()
820 HT_HASH_EX(arData, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_add_or_update_i()
834 uint32_t idx; in _zend_hash_str_add_or_update_i() local
887 idx = ht->nNumUsed++; in _zend_hash_str_add_or_update_i()
889 p = ht->arData + idx; in _zend_hash_str_add_or_update_i()
905 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_str_add_or_update_i()
1018 uint32_t idx; in _zend_hash_index_add_or_update_i() local
1103 idx = ht->nNumUsed++; in _zend_hash_index_add_or_update_i()
1105 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
1107 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_index_add_or_update_i()
1174 uint32_t idx, i; in zend_hash_set_bucket_key() local
1195 idx = HT_IDX_TO_HASH(b - arData); in zend_hash_set_bucket_key()
1198 if (i == idx) { in zend_hash_set_bucket_key()
1202 while (Z_NEXT(p->val) != idx) { in zend_hash_set_bucket_key()
1211 idx = b - arData; in zend_hash_set_bucket_key()
1215 idx = HT_IDX_TO_HASH(idx); in zend_hash_set_bucket_key()
1217 if (i == HT_INVALID_IDX || i < idx) { in zend_hash_set_bucket_key()
1219 HT_HASH_EX(arData, nIndex) = idx; in zend_hash_set_bucket_key()
1222 while (Z_NEXT(p->val) != HT_INVALID_IDX && Z_NEXT(p->val) > idx) { in zend_hash_set_bucket_key()
1227 Z_NEXT(p->val) = idx; in zend_hash_set_bucket_key()
1352 static zend_always_inline void _zend_hash_packed_del_val(HashTable *ht, uint32_t idx, zval *zv) in _zend_hash_packed_del_val() argument
1354 idx = HT_HASH_TO_IDX(idx); in _zend_hash_packed_del_val()
1356 if (ht->nInternalPointer == idx || UNEXPECTED(HT_HAS_ITERATORS(ht))) { in _zend_hash_packed_del_val()
1359 new_idx = idx; in _zend_hash_packed_del_val()
1368 if (ht->nInternalPointer == idx) { in _zend_hash_packed_del_val()
1371 zend_hash_iterators_update(ht, idx, new_idx); in _zend_hash_packed_del_val()
1373 if (ht->nNumUsed - 1 == idx) { in _zend_hash_packed_del_val()
1389 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
1396 idx = HT_HASH_TO_IDX(idx); in _zend_hash_del_el_ex()
1398 if (ht->nInternalPointer == idx || UNEXPECTED(HT_HAS_ITERATORS(ht))) { in _zend_hash_del_el_ex()
1401 new_idx = idx; in _zend_hash_del_el_ex()
1410 if (ht->nInternalPointer == idx) { in _zend_hash_del_el_ex()
1413 zend_hash_iterators_update(ht, idx, new_idx); in _zend_hash_del_el_ex()
1415 if (ht->nNumUsed - 1 == idx) { in _zend_hash_del_el_ex()
1431 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1440 if (i != idx) { in _zend_hash_del_el()
1442 while (Z_NEXT(prev->val) != idx) { in _zend_hash_del_el()
1452 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1476 uint32_t idx; in zend_hash_del() local
1486 idx = HT_HASH(ht, nIndex); in zend_hash_del()
1487 while (idx != HT_INVALID_IDX) { in zend_hash_del()
1488 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1495 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1499 idx = Z_NEXT(p->val); in zend_hash_del()
1508 uint32_t idx; in zend_hash_del_ind() local
1518 idx = HT_HASH(ht, nIndex); in zend_hash_del_ind()
1519 while (idx != HT_INVALID_IDX) { in zend_hash_del_ind()
1520 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1544 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1549 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1558 uint32_t idx; in zend_hash_str_del_ind() local
1568 idx = HT_HASH(ht, nIndex); in zend_hash_str_del_ind()
1569 while (idx != HT_INVALID_IDX) { in zend_hash_str_del_ind()
1570 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1589 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1594 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1603 uint32_t idx; in zend_hash_str_del() local
1613 idx = HT_HASH(ht, nIndex); in zend_hash_str_del()
1614 while (idx != HT_INVALID_IDX) { in zend_hash_str_del()
1615 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1621 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1625 idx = Z_NEXT(p->val); in zend_hash_str_del()
1633 uint32_t idx; in zend_hash_index_del() local
1652 idx = HT_HASH(ht, nIndex); in zend_hash_index_del()
1653 while (idx != HT_INVALID_IDX) { in zend_hash_index_del()
1654 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1656 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1660 idx = Z_NEXT(p->val); in zend_hash_index_del()
1926 uint32_t idx; in zend_hash_graceful_destroy() local
1934 for (idx = 0; idx < ht->nNumUsed; idx++, zv++) { in zend_hash_graceful_destroy()
1936 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_graceful_destroy()
1941 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1943 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1955 uint32_t idx; in zend_hash_graceful_reverse_destroy() local
1960 idx = ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1964 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
1965 idx--; in zend_hash_graceful_reverse_destroy()
1968 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_graceful_reverse_destroy()
1973 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
1974 idx--; in zend_hash_graceful_reverse_destroy()
1977 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1999 uint32_t idx; in zend_hash_apply() local
2004 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
2005 zval *zv = ht->arPacked + idx; in zend_hash_apply()
2012 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply()
2019 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
2020 Bucket *p = ht->arData + idx; in zend_hash_apply()
2027 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
2039 uint32_t idx; in zend_hash_apply_with_argument() local
2044 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
2045 zval *zv = ht->arPacked + idx; in zend_hash_apply_with_argument()
2051 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply_with_argument()
2058 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
2059 Bucket *p = ht->arData + idx; in zend_hash_apply_with_argument()
2065 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
2077 uint32_t idx; in zend_hash_apply_with_arguments() local
2085 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
2086 zval *zv = ht->arPacked + idx; in zend_hash_apply_with_arguments()
2090 hash_key.h = idx; in zend_hash_apply_with_arguments()
2097 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_apply_with_arguments()
2106 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
2107 Bucket *p = ht->arData + idx; in zend_hash_apply_with_arguments()
2118 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
2132 uint32_t idx; in zend_hash_reverse_apply() local
2137 idx = ht->nNumUsed; in zend_hash_reverse_apply()
2141 while (idx > 0) { in zend_hash_reverse_apply()
2142 idx--; in zend_hash_reverse_apply()
2143 zv = ht->arPacked + idx; in zend_hash_reverse_apply()
2150 _zend_hash_packed_del_val(ht, HT_IDX_TO_HASH(idx), zv); in zend_hash_reverse_apply()
2159 while (idx > 0) { in zend_hash_reverse_apply()
2160 idx--; in zend_hash_reverse_apply()
2161 p = ht->arData + idx; in zend_hash_reverse_apply()
2168 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
2180 uint32_t idx; in zend_hash_copy() local
2188 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
2189 zval *zv = source->arPacked + idx; in zend_hash_copy()
2192 new_entry = zend_hash_index_update(target, idx, zv); in zend_hash_copy()
2200 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
2201 Bucket *p = source->arData + idx; in zend_hash_copy()
2262 …bool zend_array_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket … in zend_array_dup_element() argument
2279 HT_HASH(target, nIndex) = HT_IDX_TO_HASH(idx); in zend_array_dup_element()
2302 uint32_t idx = 0; in zend_array_dup_elements() local
2308 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2309 uint32_t target_idx = idx; in zend_array_dup_elements()
2311 idx++; p++; in zend_array_dup_elements()
2314 if (source->nInternalPointer == idx) { in zend_array_dup_elements()
2319 idx++; p++; in zend_array_dup_elements()
2323 idx++; p++; q++; in zend_array_dup_elements()
2325 return idx; in zend_array_dup_elements()
2330 uint32_t idx; in zend_array_dup() local
2399 idx = zend_array_dup_elements(source, target, 1, 0); in zend_array_dup()
2401 idx = zend_array_dup_elements(source, target, 1, 1); in zend_array_dup()
2405 idx = zend_array_dup_elements(source, target, 0, 0); in zend_array_dup()
2407 idx = zend_array_dup_elements(source, target, 0, 1); in zend_array_dup()
2410 target->nNumUsed = idx; in zend_array_dup()
2411 target->nNumOfElements = idx; in zend_array_dup()
2439 uint32_t idx; in zend_hash_merge() local
2449 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2450 s = source->arPacked + idx; in zend_hash_merge()
2454 t = zend_hash_index_update(target, idx, s); in zend_hash_merge()
2462 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2463 p = source->arData + idx; in zend_hash_merge()
2485 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2486 s = source->arPacked + idx; in zend_hash_merge()
2490 t = zend_hash_index_add(target, idx, s); in zend_hash_merge()
2498 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge()
2499 p = source->arData + idx; in zend_hash_merge()
2535 uint32_t idx; in zend_hash_merge_ex() local
2544 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge_ex()
2545 p = source->arData + idx; in zend_hash_merge_ex()
2636 uint32_t idx; in zend_hash_internal_pointer_end_ex() local
2641 idx = ht->nNumUsed; in zend_hash_internal_pointer_end_ex()
2643 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2644 idx--; in zend_hash_internal_pointer_end_ex()
2645 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2646 *pos = idx; in zend_hash_internal_pointer_end_ex()
2651 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2652 idx--; in zend_hash_internal_pointer_end_ex()
2653 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2654 *pos = idx; in zend_hash_internal_pointer_end_ex()
2665 uint32_t idx; in zend_hash_move_forward_ex() local
2670 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_move_forward_ex()
2671 if (idx < ht->nNumUsed) { in zend_hash_move_forward_ex()
2674 idx++; in zend_hash_move_forward_ex()
2675 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2679 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_move_forward_ex()
2680 *pos = idx; in zend_hash_move_forward_ex()
2686 idx++; in zend_hash_move_forward_ex()
2687 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2691 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_forward_ex()
2692 *pos = idx; in zend_hash_move_forward_ex()
2704 uint32_t idx = *pos; in zend_hash_move_backwards_ex() local
2709 if (idx < ht->nNumUsed) { in zend_hash_move_backwards_ex()
2711 while (idx > 0) { in zend_hash_move_backwards_ex()
2712 idx--; in zend_hash_move_backwards_ex()
2713 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2714 *pos = idx; in zend_hash_move_backwards_ex()
2719 while (idx > 0) { in zend_hash_move_backwards_ex()
2720 idx--; in zend_hash_move_backwards_ex()
2721 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2722 *pos = idx; in zend_hash_move_backwards_ex()
2738 uint32_t idx; in zend_hash_get_current_key_ex() local
2742 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_ex()
2743 if (idx < ht->nNumUsed) { in zend_hash_get_current_key_ex()
2745 *num_index = idx; in zend_hash_get_current_key_ex()
2748 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2762 uint32_t idx; in zend_hash_get_current_key_zval_ex() local
2766 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_zval_ex()
2767 if (idx >= ht->nNumUsed) { in zend_hash_get_current_key_zval_ex()
2771 ZVAL_LONG(key, idx); in zend_hash_get_current_key_zval_ex()
2774 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2785 uint32_t idx; in zend_hash_get_current_key_type_ex() local
2789 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_key_type_ex()
2790 if (idx < ht->nNumUsed) { in zend_hash_get_current_key_type_ex()
2794 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2807 uint32_t idx; in zend_hash_get_current_data_ex() local
2811 idx = _zend_hash_get_valid_pos(ht, *pos); in zend_hash_get_current_data_ex()
2812 if (idx < ht->nNumUsed) { in zend_hash_get_current_data_ex()
2814 return &ht->arPacked[idx]; in zend_hash_get_current_data_ex()
2816 p = ht->arData + idx; in zend_hash_get_current_data_ex()
3115 uint32_t idx; in zend_hash_minmax() local
3127 idx = 0; in zend_hash_minmax()
3129 if (idx == ht->nNumUsed) { in zend_hash_minmax()
3132 if (Z_TYPE(ht->arPacked[idx]) != IS_UNDEF) break; in zend_hash_minmax()
3133 idx++; in zend_hash_minmax()
3135 res = ht->arPacked + idx; in zend_hash_minmax()
3136 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
3137 zv = ht->arPacked + idx; in zend_hash_minmax()
3153 idx = 0; in zend_hash_minmax()
3155 if (idx == ht->nNumUsed) { in zend_hash_minmax()
3158 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) break; in zend_hash_minmax()
3159 idx++; in zend_hash_minmax()
3161 res = &ht->arData[idx].val; in zend_hash_minmax()
3162 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
3163 p = ht->arData + idx; in zend_hash_minmax()
3180 …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
3197 *idx = (*tmp - '0'); in _zend_handle_numeric_str_ex()
3202 if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
3205 *idx = 0 - *idx; in _zend_handle_numeric_str_ex()
3206 } else if (*idx > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
3212 *idx = (*idx * 10) + (*tmp - '0'); in _zend_handle_numeric_str_ex()