Skip to content

Commit 71fab2d

Browse files
committed
Clean up JVM/Parrot divergences in src/core.
1 parent 5104c2e commit 71fab2d

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/core/NQPMu.pm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,29 @@ my class NQPMu {
2626
# See if we have a value to initialize this attr with.
2727
my $key_name := nqp::atpos($task, 2);
2828
if nqp::existskey(%attrinit, $key_name) {
29-
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 3), %attrinit{$key_name});
29+
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos($task, 3), %attrinit{$key_name});
3030
}
3131
}
3232
elsif nqp::iseq_i($code, 2) {
3333
# See if we have a value to initialize this attr with;
3434
# if not, set it to an empty array.
3535
my $key_name := nqp::atpos($task, 2);
3636
if nqp::existskey(%attrinit, $key_name) {
37-
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 3), %attrinit{$key_name});
37+
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos($task, 3), %attrinit{$key_name});
3838
}
3939
else {
40-
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 3), nqp::list());
40+
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos($task, 3), nqp::list());
4141
}
4242
}
4343
elsif nqp::iseq_i($code, 3) {
4444
# See if we have a value to initialize this attr with;
45-
# if not, set it to an empty hash.
45+
# if not, set it to an empty array.
4646
my $key_name := nqp::atpos($task, 2);
4747
if nqp::existskey(%attrinit, $key_name) {
48-
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 3), %attrinit{$key_name});
48+
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos($task, 3), %attrinit{$key_name});
4949
}
5050
else {
51-
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 3), nqp::hash());
51+
nqp::bindattr(self, nqp::atpos($task, 1), nqp::atpos($task, 3), nqp::hash());
5252
}
5353
}
5454
elsif nqp::iseq_i($code, 4) {

src/core/NQPRoutine.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ my knowhow NQPRoutine {
276276
my $param_type := pir::what_or_null__PP($param); # Parrot hack; just .WHAT on JVM etc.
277277
my $type_obj := $cur_candidate<types>[$i];
278278
my $definedness := $cur_candidate<definednesses>[$i];
279-
unless nqp::eqaddr($param_type, $type_obj) || is_narrower_type($param_type, $type_obj) {
279+
unless nqp::eqaddr($param_type, $type_obj) || nqp::isnull($type_obj) || is_narrower_type($param_type, $type_obj) {
280280
$type_mismatch := 1;
281281
last;
282282
}
@@ -348,8 +348,6 @@ my knowhow NQPRoutine {
348348
}
349349
nqp::setinvokespec(NQPRoutine, NQPRoutine, '$!do', nqp::null);
350350
nqp::setboolspec(NQPRoutine, 5, nqp::null());
351-
pir::stable_publish_vtable_handler_mapping__vPP(NQPRoutine,
352-
nqp::hash('get_string', nqp::list(NQPRoutine, '$!do')));
353351

354352
my knowhow NQPSignature {
355353
has $!types;
@@ -439,5 +437,3 @@ my knowhow NQPRegex {
439437
}
440438
nqp::setinvokespec(NQPRegex, NQPRegex, '$!do', nqp::null);
441439
nqp::setboolspec(NQPRegex, 5, nqp::null());
442-
pir::stable_publish_vtable_handler_mapping__vPP(NQPRegex,
443-
nqp::hash('get_string', nqp::list(NQPRegex, '$!do')));

src/core/Regex.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sub match ($text, $regex, :$global?) {
1414
if $global {
1515
my @matches;
1616
while $match {
17-
@matches.push($match);
17+
nqp::push(@matches, $match);
1818
$match := $match.CURSOR.parse($text, :rule($regex), :c($match.to));
1919
}
2020
@matches;

0 commit comments

Comments
 (0)