diff options
author | Reini Urban <rurban@x-ray.at> | 2008-06-08 16:41:51 +0200 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2008-12-04 01:25:36 +0000 |
commit | c328e2240a007973ffdd89b8eea34b5aba045d1e (patch) | |
tree | f4e35735a25c9785c398571228d1fdd93f6c49a6 /pad.h | |
parent | f0bb253115a6e215d99518bef6cf2cc5d773f21b (diff) | |
download | perl-c328e2240a007973ffdd89b8eea34b5aba045d1e.tar.gz |
Integrate:
[ 34029]
Subject: [PATCH] readable assertion names
From: "Reini Urban" <rurban@x-ray.at>
Date: Sun, 8 Jun 2008 14:41:51 +0200
Message-ID: <6910a60806080541n4f7e1939q254797411545ebea@mail.gmail.com>
[ 34030]
Subject: Re: [PATCH] readable assertion names, now the rest
From: "Reini Urban" <rurban@x-ray.at>
Date: Sun, 8 Jun 2008 16:17:32 +0200
Message-ID: <6910a60806080717h1aaaef1fh425a2ef21a62c9ed@mail.gmail.com>
[ 34031]
Subject: Re: [PATCH] readable assertion names, now sv.h
From: "Reini Urban" <rurban@x-ray.at>
Date: Sun, 8 Jun 2008 15:26:41 +0200
Message-ID: <6910a60806080626kfda0dd1ja906513e8fd0aa39@mail.gmail.com>
p4raw-link: @34031 on //depot/perl: e5ae200f29f943d2dad731c89f20babe8c7c8786
p4raw-link: @34030 on //depot/perl: 7948fc082b7916e5f602700f36d83fdcf421314c
p4raw-link: @34029 on //depot/perl: 603aa20df51288786331f1d6680081156c2ce5a9
p4raw-id: //depot/maint-5.10/perl@35005
p4raw-integrated: from //depot/perl@34031 'edit in' sv.h (@33627..)
p4raw-integrated: from //depot/perl@34030 'edit in' regexp.h (@33292..)
'ignore' op.h (@33679..) 'merge in' pad.h (@32982..) cv.h
(@33051..)
p4raw-integrated: from //depot/perl@34029 'merge in' gv.h (@33702..)
Diffstat (limited to 'pad.h')
-rw-r--r-- | pad.h | 74 |
1 files changed, 39 insertions, 35 deletions
@@ -31,50 +31,54 @@ typedef U64TYPE PADOFFSET; #endif #define NOT_IN_PAD ((PADOFFSET) -1) -/* B.xs needs these for the benefit of B::Deparse */ +/* B.xs needs these for the benefit of B::Deparse */ /* Low range end is exclusive (valid from the cop seq after this one) */ /* High range end is inclusive (valid up to this cop seq) */ #if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define COP_SEQ_RANGE_LOW(sv) \ - (({ SV *const _svi = (SV *) (sv); \ - assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \ - assert(SvTYPE(_svi) != SVt_PVAV); \ - assert(SvTYPE(_svi) != SVt_PVHV); \ - assert(SvTYPE(_svi) != SVt_PVCV); \ - assert(SvTYPE(_svi) != SVt_PVFM); \ - assert(!isGV_with_GP(_svi)); \ - ((XPVNV*) SvANY(_svi))->xnv_u.xpad_cop_seq.xlow; \ + (({ SV *const _sv_cop_seq_range_low = (SV *) (sv); \ + assert(SvTYPE(_sv_cop_seq_range_low) == SVt_NV \ + || SvTYPE(_sv_cop_seq_range_low) >= SVt_PVNV); \ + assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVAV); \ + assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVHV); \ + assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVCV); \ + assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVFM); \ + assert(!isGV_with_GP(_sv_cop_seq_range_low)); \ + ((XPVNV*) SvANY(_sv_cop_seq_range_low))->xnv_u.xpad_cop_seq.xlow; \ })) # define COP_SEQ_RANGE_HIGH(sv) \ - (({ SV *const _svi = (SV *) (sv); \ - assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \ - assert(SvTYPE(_svi) != SVt_PVAV); \ - assert(SvTYPE(_svi) != SVt_PVHV); \ - assert(SvTYPE(_svi) != SVt_PVCV); \ - assert(SvTYPE(_svi) != SVt_PVFM); \ - assert(!isGV_with_GP(_svi)); \ - ((XPVNV*) SvANY(_svi))->xnv_u.xpad_cop_seq.xhigh; \ + (({ SV *const _sv_cop_seq_range_high = (SV *) (sv); \ + assert(SvTYPE(_sv_cop_seq_range_high) == SVt_NV \ + || SvTYPE(_sv_cop_seq_range_high) >= SVt_PVNV); \ + assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVAV); \ + assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVHV); \ + assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVCV); \ + assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVFM); \ + assert(!isGV_with_GP(_sv_cop_seq_range_high)); \ + ((XPVNV*) SvANY(_sv_cop_seq_range_high))->xnv_u.xpad_cop_seq.xhigh; \ })) # define PARENT_PAD_INDEX(sv) \ - (({ SV *const _svi = (SV *) (sv); \ - assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \ - assert(SvTYPE(_svi) != SVt_PVAV); \ - assert(SvTYPE(_svi) != SVt_PVHV); \ - assert(SvTYPE(_svi) != SVt_PVCV); \ - assert(SvTYPE(_svi) != SVt_PVFM); \ - assert(!isGV_with_GP(_svi)); \ - ((XPVNV*) SvANY(_svi))->xnv_u.xpad_cop_seq.xlow; \ + (({ SV *const _sv_parent_pad_index = (SV *) (sv); \ + assert(SvTYPE(_sv_parent_pad_index) == SVt_NV \ + || SvTYPE(_sv_parent_pad_index) >= SVt_PVNV); \ + assert(SvTYPE(_sv_parent_pad_index) != SVt_PVAV); \ + assert(SvTYPE(_sv_parent_pad_index) != SVt_PVHV); \ + assert(SvTYPE(_sv_parent_pad_index) != SVt_PVCV); \ + assert(SvTYPE(_sv_parent_pad_index) != SVt_PVFM); \ + assert(!isGV_with_GP(_sv_parent_pad_index)); \ + ((XPVNV*) SvANY(_sv_parent_pad_index))->xnv_u.xpad_cop_seq.xlow; \ })) # define PARENT_FAKELEX_FLAGS(sv) \ - (({ SV *const _svi = (SV *) (sv); \ - assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \ - assert(SvTYPE(_svi) != SVt_PVAV); \ - assert(SvTYPE(_svi) != SVt_PVHV); \ - assert(SvTYPE(_svi) != SVt_PVCV); \ - assert(SvTYPE(_svi) != SVt_PVFM); \ - assert(!isGV_with_GP(_svi)); \ - ((XPVNV*) SvANY(_svi))->xnv_u.xpad_cop_seq.xhigh; \ + (({ SV *const _sv_parent_fakelex_flags = (SV *) (sv); \ + assert(SvTYPE(_sv_parent_fakelex_flags) == SVt_NV \ + || SvTYPE(_sv_parent_fakelex_flags) >= SVt_PVNV); \ + assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVAV); \ + assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVHV); \ + assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVCV); \ + assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVFM); \ + assert(!isGV_with_GP(_sv_parent_fakelex_flags)); \ + ((XPVNV*) SvANY(_sv_parent_fakelex_flags))->xnv_u.xpad_cop_seq.xhigh; \ })) #else # define COP_SEQ_RANGE_LOW(sv) \ @@ -90,7 +94,7 @@ typedef U64TYPE PADOFFSET; #endif /* Flags set in the SvIVX field of FAKE namesvs */ - + #define PAD_FAKELEX_ANON 1 /* the lex is declared in an ANON, or ... */ #define PAD_FAKELEX_MULTI 2 /* the lex can be instantiated multiple times */ @@ -207,7 +211,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() #define PAD_BASE_SV(padlist, po) \ (AvARRAY(padlist)[1]) \ ? AvARRAY((AV*)(AvARRAY(padlist)[1]))[po] : NULL; - + #define PAD_SET_CUR_NOSAVE(padlist,nth) \ PL_comppad = (PAD*) (AvARRAY(padlist)[nth]); \ |