Skip to content

Commit

Permalink
[js] Adapt to calling convention change
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Feb 18, 2018
1 parent e02ddce commit 2de8a7e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/Perl6/World.nqp
Expand Up @@ -2778,6 +2778,12 @@ class Perl6::World is HLL::World {
if nqp::isnull($r) {
QAST::Op.new( :op<null> )
}
elsif nqp::isstr($r) {
QAST::SVal.new( :value($r) )
}
elsif nqp::isint($r) {
QAST::IVal.new( :value($r) )
}
else {
self.add_object_if_no_sc($r);
QAST::WVal.new( :value($r) )
Expand Down
4 changes: 2 additions & 2 deletions src/core/VM.pm
@@ -1,8 +1,8 @@
my constant $?COMPILATION-ID :=
nqp::sha1(nqp::concat(
nqp::p6box_s(nqp::sha1(nqp::concat(
$*W.handle,
nqp::getcomp('perl6').compilation-id
));
)));

class VM does Systemic {
has $.config;
Expand Down
4 changes: 2 additions & 2 deletions src/vm/js/Perl6/Ops.nqp
Expand Up @@ -76,7 +76,7 @@ $ops.add_simple_op('p6trialbind', $ops.OBJ, [$ops.OBJ, $ops.OBJ, $ops.OBJ], :!in
});

$ops.add_simple_op('p6isbindable', $ops.OBJ, [$ops.OBJ, $ops.OBJ], :!inlinable, sub ($sig, $cap) {
"nqp.p6binder.is_bindable($*CTX, null, nqp.p6binder, $sig, $cap)"
"nqp.retval(HLL, nqp.p6binder.is_bindable($*CTX, null, nqp.p6binder, $sig, $cap))"
});

$ops.add_simple_op('p6bindcaptosig', $ops.OBJ, [$ops.OBJ, $ops.OBJ], sub ($sig, $cap) {
Expand All @@ -86,7 +86,7 @@ $ops.add_simple_op('p6bindcaptosig', $ops.OBJ, [$ops.OBJ, $ops.OBJ], sub ($sig,
$ops.add_op('p6bindattrinvres', $ops.bindattr($ops.OBJ, :inverted_result));

$ops.add_simple_op('p6invokeunder', $ops.OBJ, [$ops.OBJ, $ops.OBJ], :side_effects, sub ($fake, $code) {
"$code.\$\$call($*CTX, null)"
"nqp.retval(HLL, $code.\$\$call($*CTX, null))"
});

$ops.add_simple_op('p6settypes', $ops.OBJ, [$ops.OBJ], :side_effects);
Expand Down
2 changes: 1 addition & 1 deletion src/vm/js/perl6-runtime/runtime.js
Expand Up @@ -49,7 +49,7 @@ module.exports.load = function(nqp, CodeRef, Capture, containerSpecs) {
let targetType;
const how = rtype._STable.HOW;
const archetypes = how.archetypes(ctx, null, how);
const isCoercive = archetypes.coercive(ctx, null, archetypes).$$toBool(ctx);
const isCoercive = nqp.retval_bool(ctx, archetypes.coercive(ctx, null, archetypes));

if (isCoercive) {
targetType = how.target_type(ctx, null, how, rtype);
Expand Down

0 comments on commit 2de8a7e

Please sign in to comment.