This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge the implementation of B::COP::{filegv,stash} using ALIAS.
authorNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 08:12:39 +0000 (08:12 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 08:12:39 +0000 (08:12 +0000)
On this platform, this reduces the object size by about 400 bytes for a threaded
build.

ext/B/B.xs

index 6f9f9c8..9e995ef 100644 (file)
@@ -1242,16 +1242,16 @@ COP_label(o)
 # above (B::OP::next)
  
 #ifdef USE_ITHREADS
-#define COP_stash(o)   CopSTASH(o)
-#define COP_filegv(o)  CopFILEGV(o)
 
-B::HV
+B::SV
 COP_stash(o)
        B::COP  o
-
-B::GV
-COP_filegv(o)
-       B::COP  o
+    ALIAS:
+       filegv = 1
+    CODE:
+       RETVAL = ix ? (SV *)CopFILEGV(o) : (SV *)CopSTASH(o);
+    OUTPUT:
+       RETVAL
 
 #else