Skip to content

Commit

Permalink
Prevent unnecessary gisting because of sinking
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 28, 2019
1 parent 26a309b commit 9203ef2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/MoarVM/Profiler.pm6
Expand Up @@ -386,6 +386,7 @@ class MoarVM::Profiler::Type does OnHash[<
self.bless(:%hash)
}
method TWEAK(--> Nil) {
# link to originating profile
%!hash.BIND-KEY("profile",$_) with $*PROFILE;
}

Expand Down Expand Up @@ -449,8 +450,8 @@ class MoarVM::Profiler::Thread does OnHash[<
self!mogrify-to-object(MoarVM::Profiler::Callee,'call_graph','caller');
self!mogrify-to-slip(MoarVM::Profiler::GC,'gcs','thread');

# link back to the profiler if one available
%!hash<profile> = $_ with $*PROFILE;
# link to originating profile
%!hash.BIND-KEY("profile",$_) with $*PROFILE;
}

# additional accessor logic
Expand Down Expand Up @@ -596,7 +597,7 @@ class MoarVM::Profiler {
}
method Str(--> Str:D) { self.gist }

method sink(--> Nil) { self.note }
method sink(--> Nil) { self.note if %!threads_by_id }

multi method profile(&code, :$times!) {
my @profiles;
Expand Down

0 comments on commit 9203ef2

Please sign in to comment.