Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Basic nqp::clone implementation.
  • Loading branch information
jnthn committed Feb 1, 2013
1 parent fa58117 commit 0c369f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/QAST/JASTCompiler.nqp
Expand Up @@ -1364,6 +1364,7 @@ QAST::OperationsJAST.map_classlib_core_op('bootstr', $TYPE_OPS, 'bootstr', [], $
QAST::OperationsJAST.map_classlib_core_op('bootarray', $TYPE_OPS, 'bootarray', [], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('boothash', $TYPE_OPS, 'boothash', [], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('create', $TYPE_OPS, 'create', [$RT_OBJ], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('clone', $TYPE_OPS, 'clone', [$RT_OBJ], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('isconcrete', $TYPE_OPS, 'isconcrete', [$RT_OBJ], $RT_INT, :tc);
QAST::OperationsJAST.map_classlib_core_op('iscont', $TYPE_OPS, 'iscont', [$RT_OBJ], $RT_INT);
QAST::OperationsJAST.map_classlib_core_op('decont', $TYPE_OPS, 'decont', [$RT_OBJ], $RT_OBJ, :tc);
Expand Down
3 changes: 3 additions & 0 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1013,6 +1013,9 @@ public static SixModelObject create(SixModelObject obj, ThreadContext tc) {
res.initialize(tc);
return res;
}
public static SixModelObject clone(SixModelObject obj, ThreadContext tc) {
return obj.clone(tc);
}
public static long isconcrete(SixModelObject obj, ThreadContext tc) {
return obj instanceof TypeObject ? 0 : 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/perl6/nqp/sixmodel/SixModelObject.java
Expand Up @@ -10,7 +10,7 @@
* a better fit and stands a better chance of performing well with the
* way the JVM does things.
*/
public abstract class SixModelObject {
public abstract class SixModelObject implements Cloneable {
/**
* The STable of the object.
*/
Expand Down

0 comments on commit 0c369f7

Please sign in to comment.