Skip to content

Commit

Permalink
Streamline try_bind_sig helper sub in bootstrap
Browse files Browse the repository at this point in the history
Allowing it to be inlined sooner
  • Loading branch information
lizmat committed Mar 1, 2024
1 parent 96c0a5d commit 485fc86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Perl6/bootstrap.c/BOOTSTRAP.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,16 @@ my class Binder {
}

method try_bind_sig($capture) {
# Get signature and lexpad.
my $caller := nqp::getcodeobj(nqp::callercode());
my $sig := nqp::getattr($caller, Code, '$!signature');
my $lexpad := nqp::ctxcaller(nqp::ctx());

# Call binder, and return non-zero if the bind is successful.
bind($capture, $sig, $lexpad, 0, NQPMu) == 0
nqp::not_i(
bind(
$capture,
nqp::getattr(nqp::getcodeobj(nqp::callercode), Code, '$!signature'),
nqp::ctxcaller(nqp::ctx),
0,
NQPMu
)
)
}

method bind_sig($capture) {
Expand Down

0 comments on commit 485fc86

Please sign in to comment.