Skip to content

Commit b6257b3

Browse files
committed
Enable HOW computation to be overridden.
1 parent c4d04bb commit b6257b3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vm/jvm/runtime/org/perl6/nqp/runtime/BootJavaInterop.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,20 @@ protected SixModelObject computeInterop(ThreadContext tc, Class<?> klass) {
276276
}
277277

278278
STable protoSt = gc.BOOTJava.st;
279-
SixModelObject freshType = protoSt.REPR.type_object_for(tc, protoSt.HOW);
279+
SixModelObject freshType = protoSt.REPR.type_object_for(tc, computeHOW(tc, klass.getName()));
280280
freshType.st.MethodCache = names;
281281
freshType.st.ModeFlags |= STable.METHOD_CACHE_AUTHORITATIVE;
282282

283283
hash.bind_key_boxed(tc, "/TYPE/", freshType);
284284

285285
return hash;
286286
}
287+
288+
/** Produces a meta-object for a Java type. Override this to have something
289+
* other than the BOOTJava one. */
290+
protected SixModelObject computeHOW(ThreadContext tc, String name) {
291+
return gc.BOOTJava.st.HOW;
292+
}
287293

288294
/** Handles class construction for adaptors. */
289295
protected ClassContext createAdaptor(Class<?> target) {

0 commit comments

Comments
 (0)