Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
nqp::getlexdyn and nqp::bindlexdyn.
Functionality already existed, just wasn't wired to the ops yet.
  • Loading branch information
jnthn committed Feb 24, 2013
1 parent 2a4dea6 commit bd662c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/QAST/JASTCompiler.nqp
Expand Up @@ -1784,6 +1784,8 @@ QAST::OperationsJAST.map_classlib_core_op('bindlex', $TYPE_OPS, 'bindlex', [$RT_
QAST::OperationsJAST.map_classlib_core_op('bindlex_i', $TYPE_OPS, 'bindlex_i', [$RT_STR, $RT_INT], $RT_INT, :tc);
QAST::OperationsJAST.map_classlib_core_op('bindlex_n', $TYPE_OPS, 'bindlex_n', [$RT_STR, $RT_NUM], $RT_NUM, :tc);
QAST::OperationsJAST.map_classlib_core_op('bindlex_s', $TYPE_OPS, 'bindlex_s', [$RT_STR, $RT_STR], $RT_STR, :tc);
QAST::OperationsJAST.map_classlib_core_op('getlexdyn', $TYPE_OPS, 'getlexdyn', [$RT_STR], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('bindlexdyn', $TYPE_OPS, 'bindlexdyn', [$RT_STR, $RT_OBJ], $RT_OBJ, :tc);

# code object related opcodes
QAST::OperationsJAST.map_classlib_core_op('takeclosure', $TYPE_OPS, 'takeclosure', [$RT_OBJ], $RT_OBJ, :tc);
Expand Down Expand Up @@ -3023,9 +3025,9 @@ class QAST::CompilerJAST {
$il.append(JAST::Instruction.new( :op('aload_1') ));
$il.append($*BINDVAL
?? JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS,
"binddynlex", $TYPE_SMO, $TYPE_SMO, $TYPE_STR, $TYPE_TC )
"bindlexdyn", $TYPE_SMO, $TYPE_SMO, $TYPE_STR, $TYPE_TC )
!! JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS,
"getdynlex", $TYPE_SMO, $TYPE_STR, $TYPE_TC ));
"getlexdyn", $TYPE_SMO, $TYPE_STR, $TYPE_TC ));
return result($il, $RT_OBJ);
}
elsif $scope eq 'attribute' {
Expand Down
4 changes: 2 additions & 2 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -349,7 +349,7 @@ public static String bindlex_s(String name, String value, ThreadContext tc) {
}

/* Dynamic lexicals. */
public static SixModelObject binddynlex(SixModelObject value, String name, ThreadContext tc) {
public static SixModelObject bindlexdyn(SixModelObject value, String name, ThreadContext tc) {
CallFrame curFrame = tc.curFrame;
while (curFrame != null) {
Integer idx = curFrame.codeRef.staticInfo.oTryGetLexicalIdx(name);
Expand All @@ -361,7 +361,7 @@ public static SixModelObject binddynlex(SixModelObject value, String name, Threa
}
throw new RuntimeException("Dyanmic variable '" + name + "' not found");
}
public static SixModelObject getdynlex(String name, ThreadContext tc) {
public static SixModelObject getlexdyn(String name, ThreadContext tc) {
CallFrame curFrame = tc.curFrame;
while (curFrame != null) {
Integer idx = curFrame.codeRef.staticInfo.oTryGetLexicalIdx(name);
Expand Down

0 comments on commit bd662c8

Please sign in to comment.