hv_store_ent() to macros, and consign the function bodies to history.
Er, mathoms.c
p4raw-id: //depot/perl@31924
poM |HV * |hv_copy_hints_hv|NN HV *const ohv
Ap |void |hv_delayfree_ent|NN HV* hv|NULLOK HE* entry
Apd |SV* |hv_delete |NULLOK HV* tb|NN const char* key|I32 klen|I32 flags
-Apd |SV* |hv_delete_ent |NULLOK HV* tb|NN SV* key|I32 flags|U32 hash
+Abmd |SV* |hv_delete_ent |NULLOK HV* tb|NN SV* key|I32 flags|U32 hash
ApdR |bool |hv_exists |NULLOK HV* tb|NN const char* key|I32 klen
-ApdR |bool |hv_exists_ent |NULLOK HV* tb|NN SV* key|U32 hash
+AbmdR |bool |hv_exists_ent |NULLOK HV* tb|NN SV* key|U32 hash
Apd |SV** |hv_fetch |NULLOK HV* tb|NN const char* key|I32 klen|I32 lval
-Apd |HE* |hv_fetch_ent |NULLOK HV* tb|NN SV* key|I32 lval|U32 hash
+Abmd |HE* |hv_fetch_ent |NULLOK HV* tb|NN SV* key|I32 lval|U32 hash
Ap |HE* |hv_common |NULLOK HV* tb|NULLOK SV* keysv \
|NULLOK const char* key|STRLEN klen|int flags \
|int action|NULLOK SV* val|U32 hash
|NULLOK SV *const key|NULLOK SV *const value
Apd |SV** |hv_store |NULLOK HV* tb|NULLOK const char* key|I32 klen|NULLOK SV* val \
|U32 hash
-Apd |HE* |hv_store_ent |NULLOK HV* tb|NULLOK SV* key|NULLOK SV* val|U32 hash
+Abmd |HE* |hv_store_ent |NULLOK HV* tb|NULLOK SV* key|NULLOK SV* val|U32 hash
ApM |SV** |hv_store_flags |NULLOK HV* tb|NULLOK const char* key|I32 klen|NULLOK SV* val \
|U32 hash|int flags
Apd |void |hv_undef |NULLOK HV* tb
#define hv_clear Perl_hv_clear
#define hv_delayfree_ent Perl_hv_delayfree_ent
#define hv_delete Perl_hv_delete
-#define hv_delete_ent Perl_hv_delete_ent
#define hv_exists Perl_hv_exists
-#define hv_exists_ent Perl_hv_exists_ent
#define hv_fetch Perl_hv_fetch
-#define hv_fetch_ent Perl_hv_fetch_ent
#define hv_common Perl_hv_common
#define hv_free_ent Perl_hv_free_ent
#define hv_iterinit Perl_hv_iterinit
#define hv_iterval Perl_hv_iterval
#define hv_ksplit Perl_hv_ksplit
#define hv_store Perl_hv_store
-#define hv_store_ent Perl_hv_store_ent
#define hv_store_flags Perl_hv_store_flags
#define hv_undef Perl_hv_undef
#define ibcmp Perl_ibcmp
#endif
#define hv_delayfree_ent(a,b) Perl_hv_delayfree_ent(aTHX_ a,b)
#define hv_delete(a,b,c,d) Perl_hv_delete(aTHX_ a,b,c,d)
-#define hv_delete_ent(a,b,c,d) Perl_hv_delete_ent(aTHX_ a,b,c,d)
#define hv_exists(a,b,c) Perl_hv_exists(aTHX_ a,b,c)
-#define hv_exists_ent(a,b,c) Perl_hv_exists_ent(aTHX_ a,b,c)
#define hv_fetch(a,b,c,d) Perl_hv_fetch(aTHX_ a,b,c,d)
-#define hv_fetch_ent(a,b,c,d) Perl_hv_fetch_ent(aTHX_ a,b,c,d)
#define hv_common(a,b,c,d,e,f,g,h) Perl_hv_common(aTHX_ a,b,c,d,e,f,g,h)
#define hv_free_ent(a,b) Perl_hv_free_ent(aTHX_ a,b)
#define hv_iterinit(a) Perl_hv_iterinit(aTHX_ a)
#if defined(PERL_CORE) || defined(PERL_EXT)
#endif
#define hv_store(a,b,c,d,e) Perl_hv_store(aTHX_ a,b,c,d,e)
-#define hv_store_ent(a,b,c,d) Perl_hv_store_ent(aTHX_ a,b,c,d)
#define hv_store_flags(a,b,c,d,e,f) Perl_hv_store_flags(aTHX_ a,b,c,d,e,f)
#define hv_undef(a) Perl_hv_undef(aTHX_ a)
#define ibcmp(a,b,c) Perl_ibcmp(aTHX_ a,b,c)
return hek ? &HeVAL(hek) : NULL;
}
-/* XXX This looks like an ideal candidate to inline */
+/* Tricky to inlike this because it needs a temporary variable */
SV**
Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val,
register U32 hash, int flags)
=cut
*/
-/* XXX This looks like an ideal candidate to inline */
-HE *
-Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash)
-{
- return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash);
-}
-
/*
=for apidoc hv_exists
=cut
*/
-/* XXX This looks like an ideal candidate to inline */
-bool
-Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
-{
- return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash)
- ? TRUE : FALSE;
-}
-
/* returns an HE * structure with the all fields set */
/* note that hent_val will be a mortal sv for MAGICAL hashes */
/*
*/
HE *
-Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
-{
- return hv_common(hv, keysv, NULL, 0, 0,
- (lval ? HV_FETCH_LVALUE : 0), NULL, hash);
-}
-
-HE *
Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
int flags, int action, SV *val, register U32 hash)
{
=cut
*/
-/* XXX This looks like an ideal candidate to inline */
-SV *
-Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
-{
- return (SV *) hv_common(hv, keysv, NULL, 0, 0, flags | HV_DELETE, NULL,
- hash);
-}
-
STATIC SV *
S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
int k_flags, I32 d_flags, U32 hash)
->shared_he_he.he_valu.hent_refcount), \
hek)
+#define hv_store_ent(zlonk, awk, touche, zgruppp) \
+ hv_common((zlonk), (awk), NULL, 0, 0, HV_FETCH_ISSTORE, (touche), (zgruppp))
+
+#define hv_exists_ent(zlonk, awk, zgruppp) \
+ (hv_common((zlonk), (awk), NULL, 0, 0, HV_FETCH_ISEXISTS, 0, (zgruppp))\
+ ? TRUE : FALSE)
+#define hv_fetch_ent(zlonk, awk, touche, zgruppp) \
+ hv_common((zlonk), (awk), NULL, 0, 0, ((touche) ? HV_FETCH_LVALUE : 0), \
+ NULL, (zgruppp))
+#define hv_delete_ent(zlonk, awk, touche, zgruppp) \
+ ((SV *) hv_common((zlonk), (awk), NULL, 0, 0, (touche) | HV_DELETE, \
+ NULL, (zgruppp)))
+
/* This refcounted he structure is used for storing the hints used for lexical
pragmas. Without threads, it's basically struct he + refcount.
With threads, life gets more complex as the structure needs to be shared
packlist(cat, pat, patend, beglist, endlist);
}
+
+HE *
+Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash);
+}
+
+bool
+Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash)
+ ? TRUE : FALSE;
+}
+
+HE *
+Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0,
+ (lval ? HV_FETCH_LVALUE : 0), NULL, hash);
+}
+
+SV *
+Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
+{
+ return (SV *) hv_common(hv, keysv, NULL, 0, 0, flags | HV_DELETE, NULL,
+ hash);
+}
+
#endif /* NO_MATHOMS */
/*
PERL_CALLCONV SV* Perl_hv_delete(pTHX_ HV* tb, const char* key, I32 klen, I32 flags)
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV SV* Perl_hv_delete_ent(pTHX_ HV* tb, SV* key, I32 flags, U32 hash)
- __attribute__nonnull__(pTHX_2);
+/* PERL_CALLCONV SV* Perl_hv_delete_ent(pTHX_ HV* tb, SV* key, I32 flags, U32 hash)
+ __attribute__nonnull__(pTHX_2); */
PERL_CALLCONV bool Perl_hv_exists(pTHX_ HV* tb, const char* key, I32 klen)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV bool Perl_hv_exists_ent(pTHX_ HV* tb, SV* key, U32 hash)
+/* PERL_CALLCONV bool Perl_hv_exists_ent(pTHX_ HV* tb, SV* key, U32 hash)
__attribute__warn_unused_result__
- __attribute__nonnull__(pTHX_2);
+ __attribute__nonnull__(pTHX_2); */
PERL_CALLCONV SV** Perl_hv_fetch(pTHX_ HV* tb, const char* key, I32 klen, I32 lval)
__attribute__nonnull__(pTHX_2);
-PERL_CALLCONV HE* Perl_hv_fetch_ent(pTHX_ HV* tb, SV* key, I32 lval, U32 hash)
- __attribute__nonnull__(pTHX_2);
+/* PERL_CALLCONV HE* Perl_hv_fetch_ent(pTHX_ HV* tb, SV* key, I32 lval, U32 hash)
+ __attribute__nonnull__(pTHX_2); */
PERL_CALLCONV HE* Perl_hv_common(pTHX_ HV* tb, SV* keysv, const char* key, STRLEN klen, int flags, int action, SV* val, U32 hash);
PERL_CALLCONV void Perl_hv_free_ent(pTHX_ HV* hv, HE* entryK)
PERL_CALLCONV void Perl_refcounted_he_free(pTHX_ struct refcounted_he *he);
PERL_CALLCONV struct refcounted_he * Perl_refcounted_he_new(pTHX_ struct refcounted_he *const parent, SV *const key, SV *const value);
PERL_CALLCONV SV** Perl_hv_store(pTHX_ HV* tb, const char* key, I32 klen, SV* val, U32 hash);
-PERL_CALLCONV HE* Perl_hv_store_ent(pTHX_ HV* tb, SV* key, SV* val, U32 hash);
+/* PERL_CALLCONV HE* Perl_hv_store_ent(pTHX_ HV* tb, SV* key, SV* val, U32 hash); */
PERL_CALLCONV SV** Perl_hv_store_flags(pTHX_ HV* tb, const char* key, I32 klen, SV* val, U32 hash, int flags);
PERL_CALLCONV void Perl_hv_undef(pTHX_ HV* tb);
PERL_CALLCONV I32 Perl_ibcmp(pTHX_ const char* a, const char* b, I32 len)