use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropAccessNode.AccessLocation in project sulong by graalvm.
the class LLVMInteropWriteNode method doUnknownType.
@Fallback
void doUnknownType(@SuppressWarnings("unused") LLVMInteropType.Structured type, TruffleObject foreign, long offset, Object value) {
if (getSize == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
getSize = insert(GetValueSizeNodeGen.create());
}
// type unknown: fall back to "array of unknown value type"
int elementAccessSize = getSize.execute(value);
AccessLocation location = new AccessLocation(foreign, Long.divideUnsigned(offset, elementAccessSize), null);
write(location, value);
}
use of com.oracle.truffle.llvm.runtime.interop.access.LLVMInteropAccessNode.AccessLocation in project sulong by graalvm.
the class LLVMInteropWriteNode method doKnownType.
@Specialization(guards = "type != null")
void doKnownType(LLVMInteropType.Structured type, TruffleObject foreign, long offset, Object value, @Cached("create()") LLVMInteropAccessNode access) {
AccessLocation location = access.execute(type, foreign, offset);
write(location, value);
}
Aggregations