use of com.oracle.truffle.llvm.runtime.interop.export.LLVMForeignGetSuperElemPtrNode in project graal by oracle.
the class LLVMResolveForeignClassChainNode method doClassResolvingCached.
/**
* @param ident
* @param clazz
* @param cachedIdent
* @param cachedClazz
*/
@Specialization(guards = { "ident.equals(cachedIdent)", "clazz==cachedClazz" })
public LLVMPointer doClassResolvingCached(LLVMPointer receiver, String ident, LLVMInteropType.Clazz clazz, @Cached(value = "ident", allowUncached = true) String cachedIdent, @Cached(value = "clazz", allowUncached = true) LLVMInteropType.Clazz cachedClazz, @Cached LLVMForeignVirtualSuperElemPtrNode virtualSuperElemPtrNode, @Cached LLVMForeignDirectSuperElemPtrNode directSuperElemPtrNode, @Cached(value = "clazz.getSuperOffsetInformation(ident)", allowUncached = true) Pair<long[], Struct> p, @Cached(value = "p.getLeft()") long[] offsetInformation) {
LLVMPointer curReceiver = receiver;
for (long val : offsetInformation) {
LLVMForeignGetSuperElemPtrNode access = (val & 1) == 1 ? virtualSuperElemPtrNode : directSuperElemPtrNode;
curReceiver = access.execute(curReceiver, val >> 1);
}
return curReceiver.export(p.getRight() == null ? clazz : p.getRight());
}
use of com.oracle.truffle.llvm.runtime.interop.export.LLVMForeignGetSuperElemPtrNode in project graal by oracle.
the class LLVMResolveForeignClassChainNode method doClazzResolving.
@Specialization(replaces = "doClassResolvingCached")
public LLVMPointer doClazzResolving(LLVMPointer receiver, String ident, LLVMInteropType.Clazz clazz, @Cached LLVMForeignVirtualSuperElemPtrNode virtualSuperElemPtrNode, @Cached LLVMForeignDirectSuperElemPtrNode directSuperElemPtrNode) throws UnknownIdentifierException {
LLVMPointer curReceiver = receiver;
Pair<long[], Struct> p = clazz.getSuperOffsetInformation(ident);
for (long val : p.getLeft()) {
LLVMForeignGetSuperElemPtrNode access = (val & 1) == 1 ? virtualSuperElemPtrNode : directSuperElemPtrNode;
curReceiver = access.execute(curReceiver, val >> 1);
}
return curReceiver.export(p.getRight() == null ? clazz : p.getRight());
}
Aggregations