Change 26063 by [EMAIL PROTECTED] on 2005/11/09 17:29:44
Make the Bytecode changes conditional on perl version.
Affected files ...
... //depot/perl/ext/B/B/Bytecode.pm#40 edit
Differences ...
==== //depot/perl/ext/B/B/Bytecode.pm#40 (text) ====
Index: perl/ext/B/B/Bytecode.pm
--- perl/ext/B/B/Bytecode.pm#39~24879~ Thu Jun 16 15:08:29 2005
+++ perl/ext/B/B/Bytecode.pm Wed Nov 9 09:29:44 2005
@@ -172,6 +172,9 @@
asm "ldsv", $varix = $ix unless $ix == $varix;
($i = not $i) ? asm ("newpv", pvstring $_) : asm("hv_store", $_)
for @array;
+ if (VERSION >= 5.009) {
+ asm "xnv", $hv->NVX;
+ }
asm "xmg_stash", $stashix;
asm "xhv_riter", $hv->RITER;
}
@@ -233,9 +236,11 @@
$sv->ROK ?
$sv->B::RV::bsave($ix):
$sv->B::NULL::bsave($ix);
- # See note below in B::PVNV::bsave
- return if $sv->isa('B::AV');
- return if $sv->isa('B::HV');
+ if (VERSION >= 5.009) {
+ # See note below in B::PVNV::bsave
+ return if $sv->isa('B::AV');
+ return if $sv->isa('B::HV');
+ }
asm "xiv", !ITHREADS && $sv->FLAGS & (SVf_FAKE|SVf_READONLY) ?
"0 but true" : $sv->IVX;
}
@@ -243,13 +248,15 @@
sub B::PVNV::bsave {
my ($sv,$ix) = @_;
$sv->B::PVIV::bsave($ix);
- # Magical AVs end up here, but AVs now don't have an NV slot actually
- # allocated. Hence don't write out assembly to store the NV slot if we're
- # actually an array.
- return if $sv->isa('B::AV');
- # Likewise HVs have no NV slot actually allocated.
- # I don't think that they can get here, but better safe than sorry
- return if $sv->isa('B::HV');
+ if (VERSION >= 5.009) {
+ # Magical AVs end up here, but AVs now don't have an NV slot actually
+ # allocated. Hence don't write out assembly to store the NV slot if
+ # we're actually an array.
+ return if $sv->isa('B::AV');
+ # Likewise HVs have no NV slot actually allocated.
+ # I don't think that they can get here, but better safe than sorry
+ return if $sv->isa('B::HV');
+ }
asm "xnv", sprintf "%.40g", $sv->NVX;
}
@@ -370,6 +377,9 @@
asm "av_extend", $av->MAX if $av->MAX >= 0;
asm "av_pushx", $_ for @array;
asm "sv_refcnt", $av->REFCNT;
+ if (VERSION < 5.009) {
+ asm "xav_flags", $av->AvFLAGS;
+ }
asm "xmg_stash", $stashix;
}
End of Patch.