From: Jarkko Hietaniemi Date: Sun, 10 Dec 2000 18:07:55 +0000 (+0000) Subject: The walkoptree confusion rages; walkoptree() seems to be coming X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2590c4eed970cd7ecbb1ec3a1d5b37545bacdd2;p=p5sagit%2Fp5-mst-13.2.git The walkoptree confusion rages; walkoptree() seems to be coming from B.xs, while walkoptree_slow() comes from B.pm. p4raw-id: //depot/perl@8072 --- diff --git a/ext/B/B.pm b/ext/B/B.pm index a9ea704..982395b 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -9,12 +9,16 @@ package B; use XSLoader (); require Exporter; @ISA = qw(Exporter); + +# walkoptree comes from B.pm (you are there), walkoptree comes from B.xs @EXPORT_OK = qw(minus_c ppname save_BEGINs class peekop cast_I32 cstring cchar hash threadsv_names - main_root main_start main_cv svref_2object opnumber amagic_generation + main_root main_start main_cv svref_2object opnumber + amagic_generation walkoptree_slow walkoptree walkoptree_exec walksymtable parents comppadlist sv_undef compile_stats timing_info begin_av init_av end_av); + sub OPf_KIDS (); use strict; @B::SV::ISA = 'B::OBJECT'; @@ -80,7 +84,7 @@ sub peekop { return sprintf("%s (0x%x) %s", class($op), $$op, $op->name); } -sub walkoptree { +sub walkoptree_slow { my($op, $method, $level) = @_; $op_count++; # just for statistics $level ||= 0; @@ -90,14 +94,12 @@ sub walkoptree { my $kid; unshift(@parents, $op); for ($kid = $op->first; $$kid; $kid = $kid->sibling) { - walkoptree($kid, $method, $level + 1); + walkoptree_slow($kid, $method, $level + 1); } shift @parents; } } -*walkoptree_slow = \&walkoptree; # Who is using this? - sub compile_stats { return "Total number of OPs processed: $op_count\n"; }