Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some small tweaks towards getting backend working.
  • Loading branch information
jnthn committed Feb 27, 2013
1 parent 9a5e5a5 commit 9fb6e7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/QAST/JASTCompiler.nqp
Expand Up @@ -276,12 +276,12 @@ class QAST::OperationsJAST {

# Generates instructions to box what's currently on the stack top.
method box($qastcomp, $hll, $type) {
(%hll_box{$hll}{$type} // %hll_box{''}{$type})($qastcomp)
(%hll_box{$hll} // %hll_box{''}){$type}($qastcomp)
}

# Generates instructions to unbox what's currently on the stack top.
method unbox($qastcomp, $hll, $type) {
(%hll_unbox{$hll}{$type} // %hll_unbox{''}{$type})($qastcomp)
(%hll_unbox{$hll} // %hll_unbox{''}){$type}($qastcomp)
}
}

Expand Down Expand Up @@ -1916,7 +1916,7 @@ class QAST::CompilerJAST {
}

method get_callsite_idx(@arg_types, @arg_names) {
my $key := nqp::join("-", @arg_types) ~ ';' ~ nqp::join("\0", @arg_names);
my $key := join("-", @arg_types) ~ ';' ~ join("\0", @arg_names);
if nqp::existskey(%!callsite_map, $key) {
return %!callsite_map{$key};
}
Expand Down Expand Up @@ -4503,3 +4503,6 @@ class QAST::CompilerJAST {

method operations() { QAST::OperationsJAST }
}

# Register as the QAST compiler.
nqp::bindcomp('qast', QAST::CompilerJAST);
5 changes: 3 additions & 2 deletions nqp-src/NQPHLL.pm
Expand Up @@ -910,10 +910,11 @@ class HLL::Backend::JVM {
}

method jast($qast, *%adverbs) {
QAST::CompilerJAST.jast($qast, :classname(%*COMPILING<%?OPTIONS><javaclass>));
nqp::getcomp('qast').jast($qast, :classname(%*COMPILING<%?OPTIONS><javaclass>));
}

method classfile($jast, *%adverbs) {
say($jast.dump());
nqp::die("NYI");
}

Expand All @@ -922,7 +923,7 @@ class HLL::Backend::JVM {
}

method is_compunit($cuish) {
nqp::die("NYI");
0
}

method compunit_mainline($cu) {
Expand Down

0 comments on commit 9fb6e7e

Please sign in to comment.