use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class MapInterop method getHashSize.
@ExportMessage
public static long getHashSize(StaticObject receiver, @Cached.Exclusive @Cached InvokeEspressoNode invoke) throws UnsupportedMessageException {
if (!hasHashEntries(receiver)) {
throw UnsupportedMessageException.create();
}
Meta meta = receiver.getKlass().getMeta();
Method size = getInteropKlass(receiver).itableLookup(meta.java_util_Map, meta.java_util_Map_size.getITableIndex());
try {
return (int) invoke.execute(size, receiver, EMPTY_ARRAY);
} catch (UnsupportedTypeException | ArityException e) {
throw EspressoError.shouldNotReachHere(e);
}
}
Aggregations