Skip to content

Commit 55b0dac

Browse files
committed
Stub in Decoder REPR on JVM.
1 parent 65e7981 commit 55b0dac

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/vm/jvm/runtime/org/perl6/nqp/sixmodel/REPRRegistry.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.perl6.nqp.sixmodel.reprs.AsyncTask;
4141
import org.perl6.nqp.sixmodel.reprs.NativeRef;
4242
import org.perl6.nqp.sixmodel.reprs.MultiDimArray;
43+
import org.perl6.nqp.sixmodel.reprs.Decoder;
4344

4445
public class REPRRegistry {
4546
private static HashMap<String, Integer> reprIdMap = new HashMap<String, Integer>();
@@ -104,5 +105,6 @@ private static void addREPR(String name, REPR REPR) {
104105
addREPR("AsyncTask", new AsyncTask());
105106
addREPR("NativeRef", new NativeRef());
106107
addREPR("MultiDimArray", new MultiDimArray());
108+
addREPR("Decoder", new Decoder());
107109
}
108110
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.perl6.nqp.sixmodel.reprs;
2+
3+
import org.perl6.nqp.runtime.ExceptionHandling;
4+
import org.perl6.nqp.runtime.ThreadContext;
5+
import org.perl6.nqp.sixmodel.REPR;
6+
import org.perl6.nqp.sixmodel.STable;
7+
import org.perl6.nqp.sixmodel.SerializationReader;
8+
import org.perl6.nqp.sixmodel.SixModelObject;
9+
import org.perl6.nqp.sixmodel.TypeObject;
10+
11+
public class Decoder extends REPR {
12+
public SixModelObject type_object_for(ThreadContext tc, SixModelObject HOW) {
13+
STable st = new STable(this, HOW);
14+
SixModelObject obj = new TypeObject();
15+
obj.st = st;
16+
st.WHAT = obj;
17+
return st.WHAT;
18+
}
19+
20+
public SixModelObject allocate(ThreadContext tc, STable st) {
21+
DecoderInstance obj = new DecoderInstance();
22+
obj.st = st;
23+
return obj;
24+
}
25+
26+
public SixModelObject deserialize_stub(ThreadContext tc, STable st) {
27+
throw ExceptionHandling.dieInternal(tc, "Cannot deserialize a Decoder");
28+
}
29+
30+
public void deserialize_finish(ThreadContext tc, STable st,
31+
SerializationReader reader, SixModelObject obj) {
32+
throw ExceptionHandling.dieInternal(tc, "Cannot deserialize a Decoder");
33+
}
34+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.perl6.nqp.sixmodel.reprs;
2+
3+
import org.perl6.nqp.sixmodel.SixModelObject;
4+
5+
public class DecoderInstance extends SixModelObject {
6+
}

0 commit comments

Comments
 (0)