Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add nqp::rebless, though P6opaque not updated yet.
  • Loading branch information
jnthn committed Feb 1, 2013
1 parent 3ef0749 commit 9202f07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/QAST/JASTCompiler.nqp
Expand Up @@ -1358,6 +1358,7 @@ QAST::OperationsJAST.map_classlib_core_op('how', $TYPE_OPS, 'how', [$RT_OBJ], $R
QAST::OperationsJAST.map_classlib_core_op('who', $TYPE_OPS, 'who', [$RT_OBJ], $RT_OBJ);
QAST::OperationsJAST.map_classlib_core_op('where', $TYPE_OPS, 'where', [$RT_OBJ], $RT_INT);
QAST::OperationsJAST.map_classlib_core_op('setwho', $TYPE_OPS, 'setwho', [$RT_OBJ, $RT_OBJ], $RT_OBJ);
QAST::OperationsJAST.map_classlib_core_op('rebless', $TYPE_OPS, 'rebless', [$RT_OBJ, $RT_OBJ], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('knowhow', $TYPE_OPS, 'knowhow', [], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('knowhowattr', $TYPE_OPS, 'knowhowattr', [], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('bootint', $TYPE_OPS, 'bootint', [], $RT_OBJ, :tc);
Expand Down
4 changes: 4 additions & 0 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1008,6 +1008,10 @@ public static SixModelObject setwho(SixModelObject o, SixModelObject who) {
o.st.WHO = who;
return o;
}
public static SixModelObject rebless(SixModelObject obj, SixModelObject newType, ThreadContext tc) {
obj.st.REPR.change_type(tc, obj, newType);
return obj;
}
public static SixModelObject create(SixModelObject obj, ThreadContext tc) {
SixModelObject res = obj.st.REPR.allocate(tc, obj.st);
res.initialize(tc);
Expand Down

0 comments on commit 9202f07

Please sign in to comment.