Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Get QAST -> MAST improvemnets; follow changes.
  • Loading branch information
jnthn committed Jul 27, 2014
1 parent 9515bb7 commit 319a78b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/vm/moar/Perl6/Ops.nqp
Expand Up @@ -184,7 +184,7 @@ $ops.add_hll_op('perl6', 'p6definite', -> $qastcomp, $op {
my $tmp_reg := $*REGALLOC.fresh_i();
my $res_reg := $*REGALLOC.fresh_o();
nqp::push(@ops, MAST::Op.new( :op('isconcrete'), $tmp_reg, $value_res.result_reg ));
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($qastcomp.mast_compunit),
$res_reg, $tmp_reg ));
$*REGALLOC.release_register($value_res.result_reg, $MVM_reg_obj);
$*REGALLOC.release_register($tmp_reg, $MVM_reg_int64);
Expand Down Expand Up @@ -390,31 +390,31 @@ my $p6bool := -> $qastcomp, $op {
my $res_reg := $*REGALLOC.fresh_o();
my $cond_kind := $exprres.result_kind;
if $cond_kind == $MVM_reg_int64 {
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($qastcomp.mast_compunit),
$res_reg, $exprres.result_reg ));
}
elsif $cond_kind == $MVM_reg_num64 {
my $tmp_reg := $*REGALLOC.fresh_i();
my $zero_reg := $*REGALLOC.fresh_n();
nqp::push(@ops, MAST::Op.new( :op('const_n64'), $zero_reg, MAST::NVal.new( :value(0.0) ) ));
nqp::push(@ops, MAST::Op.new( :op('eq_n'), $tmp_reg, $exprres.result_reg, $zero_reg ));
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($qastcomp.mast_compunit),
$res_reg, $tmp_reg ));
$*REGALLOC.release_register($zero_reg, $MVM_reg_num64);
$*REGALLOC.release_register($tmp_reg, $MVM_reg_int64);
}
elsif $cond_kind == $MVM_reg_str {
my $tmp_reg := $*REGALLOC.fresh_i();
nqp::push(@ops, MAST::Op.new( :op('istrue_s'), $tmp_reg, $exprres.result_reg ));
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($qastcomp.mast_compunit),
$res_reg, $tmp_reg ));
$*REGALLOC.release_register($tmp_reg, $MVM_reg_int64);
}
elsif $cond_kind == $MVM_reg_obj {
my $tmp_reg := $*REGALLOC.fresh_i();
nqp::push(@ops, MAST::Op.new( :op('decont'), $res_reg, $exprres.result_reg ));
nqp::push(@ops, MAST::Op.new( :op('istrue'), $tmp_reg, $res_reg ));
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6bool'), :cu($qastcomp.mast_compunit),
$res_reg, $tmp_reg ));
$*REGALLOC.release_register($tmp_reg, $MVM_reg_int64);
}
Expand Down Expand Up @@ -474,7 +474,7 @@ sub boxer($kind, $op) {
-> $qastcomp, $reg {
my @ops;
my $res_reg := $*REGALLOC.fresh_register($MVM_reg_obj);
nqp::push(@ops, MAST::ExtOp.new( :op($op), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op($op), :cu($qastcomp.mast_compunit),
$res_reg, $reg ));
$*REGALLOC.release_register($reg, $kind);
MAST::InstructionList.new(@ops, $res_reg, $MVM_reg_obj)
Expand Down Expand Up @@ -647,7 +647,7 @@ $ops.add_hll_op('perl6', 'p6decontrv', -> $qastcomp, $op {
my @ops;
my $value_res := $qastcomp.as_mast($op[1], :want($MVM_reg_obj));
push_ilist(@ops, $value_res);
nqp::push(@ops, MAST::ExtOp.new( :op('p6decontrv'), :cu($*MAST_COMPUNIT),
nqp::push(@ops, MAST::ExtOp.new( :op('p6decontrv'), :cu($qastcomp.mast_compunit),
$value_res.result_reg, $value_res.result_reg ));
MAST::InstructionList.new(@ops, $value_res.result_reg, $MVM_reg_obj)
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2014.07-27-g68ebbd3
2014.07-29-g4e02ce3

0 comments on commit 319a78b

Please sign in to comment.