Skip to content

Commit 05cb90e

Browse files
committed
also write profiler output when rakudo exit()s
timotimo++ for the proposed patch.
1 parent f54c1a1 commit 05cb90e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vm/moar/HLL/Backend.nqp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ class HLL::Backend::MoarVM {
3838
}
3939
}
4040
method run_profiled($what) {
41+
my @END := nqp::gethllsym('perl6', '@END_PHASERS');
42+
@END.push: -> { self.dump_profile_data($prof_end_sub()) } if nqp::defined(@END);
4143
self.ensure_prof_routines();
4244
$prof_start_sub(nqp::hash());
4345
my $res := $what();
44-
my $data := $prof_end_sub();
45-
self.dump_profile_data($data);
46+
unless nqp::defined(@END) {
47+
my $data := $prof_end_sub();
48+
self.dump_profile_data($data);
49+
}
4650
$res;
4751
}
4852
method dump_profile_data($data) {

0 commit comments

Comments
 (0)