}
}
}
-
+sub Dummy_initxs{};
sub B::CV::save {
my ($cv) = @_;
my $sym = objsym($cv);
my $cvname = $gv->NAME;
my $root = $cv->ROOT;
my $cvxsub = $cv->XSUB;
- if ($cvxsub) {
+ #INIT is removed from the symbol table, so this call must come
+ # from PL_initav->save. Re-bootstrapping will push INIT back in
+ # so nullop should be sent.
+ if ($cvxsub && ($cvname ne "INIT")) {
+ #if ($cvxsub) {
my $egv = $gv->EGV;
my $stashname = $egv->STASH->NAME;
$xsub{$stashname}='Static' unless $xsub{$stashname};
+ return qq/(perl_get_cv("$stashname\:\:$cvname",0))/;
+ }
+ if ($cvxsub && $cvname eq "INIT") {
+ no strict 'refs';
+ return svref_2object(\&Dummy_initxs)->save;
}
my $sv_ix = $svsect->index + 1;
$svsect->add("svix$sv_ix");
if ($debug_runtime) {
warn(@_);
} else {
- runtime(map { chomp; "/* $_ */"} @_);
+ my @tmp=@_;
+ runtime(map { chomp; "/* $_ */"} @tmp);
}
}
sub cc {
my ($name, $root, $start, @padlist) = @_;
my $op;
+ if($done{$$start}){
+ #warn "repeat=>".ref($start)."$name,\n";#debug
+ $decl->add(sprintf("#define $name %s",$done{$$start}));
+ return;
+ }
init_pp($name);
load_pad(@padlist);
B::Pseudoreg->new_scope;
next if !defined($op) || !$$op || $done{$$op};
#warn "...compiling it\n"; # debug
do {
- $done{$$op} = 1;
+ $done{$$op} = $name;
$op = compile_bblock($op);
if ($need_freetmps && $freetmps_each_bblock) {
runtime("FREETMPS;");