Skip to content

Commit c9ef29a

Browse files
committed
use replace-arg-literal-obj in nqp's dispatchers
1 parent 8259454 commit c9ef29a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/core/dispatchers.nqp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,11 @@ nqp::dispatch('boot-syscall', 'dispatcher-register', 'nqp-call', -> $capture {
305305
else {
306306
# Non-multi call; run the underlying code reference.
307307
if $code-constant {
308-
my $args := nqp::dispatch('boot-syscall', 'dispatcher-drop-arg', $capture, 0);
309308
# It's a constant, so just extract the do and insert it as a
310309
# constant also.
311310
my $do := nqp::getattr($callee, $callee.WHAT, '$!do');
312-
my $delegate := nqp::dispatch('boot-syscall',
313-
'dispatcher-insert-arg-literal-obj', $args, 0, $do);
311+
my $delegate := nqp::dispatch('boot-syscall', 'dispatcher-replace-arg-literal-obj',
312+
$capture, 0, $do);
314313
nqp::dispatch('boot-syscall', 'dispatcher-delegate',
315314
'boot-code-constant', $delegate);
316315
}
@@ -332,10 +331,9 @@ nqp::dispatch('boot-syscall', 'dispatcher-register', 'nqp-call', -> $capture {
332331
elsif $is-regex {
333332
# Regex, just unwrap the code handle and delegate.
334333
if $code-constant {
335-
my $args := nqp::dispatch('boot-syscall', 'dispatcher-drop-arg', $capture, 0);
336334
my $do := nqp::getattr($callee, $callee.WHAT, '$!do');
337335
my $delegate := nqp::dispatch('boot-syscall',
338-
'dispatcher-insert-arg-literal-obj', $args, 0, $do);
336+
'dispatcher-replace-arg-literal-obj', $capture, 0, $do);
339337
nqp::dispatch('boot-syscall', 'dispatcher-delegate',
340338
'boot-code-constant', $delegate);
341339
}
@@ -351,10 +349,9 @@ nqp::dispatch('boot-syscall', 'dispatcher-register', 'nqp-call', -> $capture {
351349
elsif $is-regex-method {
352350
# NQP regex method object.
353351
if $code-constant {
354-
my $args := nqp::dispatch('boot-syscall', 'dispatcher-drop-arg', $capture, 0);
355352
my $code := nqp::getattr($callee, $NQPRegexMethod, '$!code');
356353
my $delegate := nqp::dispatch('boot-syscall',
357-
'dispatcher-insert-arg-literal-obj', $args, 0, $code);
354+
'dispatcher-replace-arg-literal-obj', $capture, 0, $do);
358355
nqp::dispatch('boot-syscall', 'dispatcher-delegate',
359356
'boot-code-constant', $delegate);
360357
}

0 commit comments

Comments
 (0)