Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
nqp::gethllsym and nqp::bindhllsym
Like getcurhllsym/bindcurhllsym, but with the HLL specified.
  • Loading branch information
jnthn committed Mar 14, 2013
1 parent 6bd6a25 commit 47effd6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/QAST/Operations.nqp
Expand Up @@ -1978,6 +1978,27 @@ QAST::Operations.add_core_pirop_mapping('bindcomp', 'compreg', '1sP');
QAST::Operations.add_core_pirop_mapping('getcurhllsym', 'get_hll_global', 'Ps');
QAST::Operations.add_core_pirop_mapping('bindcurhllsym', 'set_hll_global', '1sP');
QAST::Operations.add_core_pirop_mapping('loadbytecode', 'load_bytecode', '0s');
QAST::Operations.add_core_op('gethllsym', -> $qastcomp, $op {
if +@($op) != 2 {
nqp::die('gethllsym requires two operands');
}
$qastcomp.as_post(QAST::VM.new(
:pirop('get_root_global__PPs'),
QAST::Op.new( :op('list_s'), $op[0] ),
$op[1]
))
});
QAST::Operations.add_core_op('bindhllsym', -> $qastcomp, $op {
if +@($op) != 3 {
nqp::die('bindhllsym requires three operands');
}
$qastcomp.as_post(QAST::VM.new(
:pirop('set_root_global__2PsP'),
QAST::Op.new( :op('list_s'), $op[0] ),
$op[1],
$op[2]
))
});
QAST::Operations.add_core_op('sethllconfig', -> $qastcomp, $op {
# XXX Not really implemented here.
my $ops := PIRT::Ops.new();
Expand Down

0 comments on commit 47effd6

Please sign in to comment.