Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also write profiler output when rakudo exit()s
timotimo++ for the proposed patch.
  • Loading branch information
FROGGS committed Nov 1, 2014
1 parent f54c1a1 commit 05cb90e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vm/moar/HLL/Backend.nqp
Expand Up @@ -38,11 +38,15 @@ class HLL::Backend::MoarVM {
}
}
method run_profiled($what) {
my @END := nqp::gethllsym('perl6', '@END_PHASERS');
@END.push: -> { self.dump_profile_data($prof_end_sub()) } if nqp::defined(@END);
self.ensure_prof_routines();
$prof_start_sub(nqp::hash());
my $res := $what();
my $data := $prof_end_sub();
self.dump_profile_data($data);
unless nqp::defined(@END) {
my $data := $prof_end_sub();
self.dump_profile_data($data);
}
$res;
}
method dump_profile_data($data) {
Expand Down

0 comments on commit 05cb90e

Please sign in to comment.