summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorMarc Reisner <reisner.marc@gmail.com>2021-04-05 11:56:29 -0500
committerPaul Evans <leonerd@leonerd.org.uk>2021-04-15 00:12:27 +0100
commit5f65868c2ca80b3ca5d0cebbbaf7241caa69c65f (patch)
tree01f993f9ae4c9c4d6d2c2c20977dab639a0c9693 /gv.h
parent5611ffc345393211770ee36bf0e3782dc7b0dcef (diff)
downloadperl-5f65868c2ca80b3ca5d0cebbbaf7241caa69c65f.tar.gz
Add GV_NOUNIVERSAL flag to skip UNIVERSAL lookup
For the `isa` infix operator, we can fall back to `sv_derived_from_sv` instead of looking up UNIVERSAL::isa. Passing GV_NOUNIVERSAL will tell gv_fetchmeth_internal not to look at UNIVERSAL for the method, and instead return NULL. Then `Perl_sv_isa_sv` will skip the if block and check `sv_derived_from_sv` which does the same thing UNIVERSAL::isa would have done.
Diffstat (limited to 'gv.h')
-rw-r--r--gv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gv.h b/gv.h
index 514bac1871..9b465a069d 100644
--- a/gv.h
+++ b/gv.h
@@ -245,6 +245,7 @@ Return the CV from the GV.
/* Flags for gv_fetchmeth_pvn and gv_autoload_pvn*/
#define GV_SUPER 0x1000 /* SUPER::method */
+#define GV_NOUNIVERSAL 0x2000 /* Skip UNIVERSAL lookup */
/* Flags for gv_autoload_*/
#define GV_AUTOLOAD_ISMETHOD 1 /* autoloading a method? */