use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class InstalledCodeBuilder method writeObjectConstantsToCode.
@Uninterruptible(reason = "Operates on raw pointers to objects")
private void writeObjectConstantsToCode(ObjectConstantsHolder objectConstants) {
boolean compressed = ReferenceAccess.singleton().haveCompressedReferences();
Pointer constantsStart = code.add(constantsOffset);
for (int i = 0; i < objectConstants.count; i++) {
Pointer address = constantsStart.add(objectConstants.offsets[i]);
ReferenceAccess.singleton().writeObjectAt(address, objectConstants.values[i], compressed);
}
/* From now on the constantsWalker will operate on the constants area. */
constantsWalker.pointerMapValid = true;
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class PosixCEntryPointSnippets method enterIsolateMT.
@Uninterruptible(reason = "Thread state not set up yet")
@SubstrateForeignCallTarget
private static int enterIsolateMT(Isolate isolate) {
int sanityError = PosixIsolates.checkSanity(isolate);
if (sanityError != Errors.NO_ERROR) {
return sanityError;
}
if (UseHeapBaseRegister.getValue()) {
setHeapBase(PosixIsolates.getHeapBase(isolate));
}
if (!PosixVMThreads.isInitialized()) {
return Errors.UNINITIALIZED_ISOLATE;
}
IsolateThread thread = PosixVMThreads.VMThreadTL.get();
if (VMThreads.isNullThread(thread)) {
return Errors.UNATTACHED_THREAD;
}
writeCurrentVMThread(thread);
return Errors.NO_ERROR;
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class MethodSafepointInsertionPhase method run.
@Override
protected void run(StructuredGraph graph) {
if (graph.method().getAnnotation(Uninterruptible.class) != null) {
/*
* If a method is annotated with {@link Uninterruptible}, then I do not want a test for
* a safepoint at the return.
*/
return;
}
if (graph.method().getAnnotation(CFunction.class) != null) {
/*
* If a method transfers from Java to C, then the return transition (if any) contains
* the safepoint test and one is not needed at the return of the transferring method.
*/
return;
}
if (((SharedMethod) graph.method()).isEntryPoint()) {
/*
* If a method is transferring from C to Java, then no safepoint test is needed at the
* return of the transferring method.
*/
return;
}
for (ReturnNode returnNode : graph.getNodes(ReturnNode.TYPE)) {
SafepointNode safepointNode = graph.add(new SafepointNode());
graph.addBeforeFixed(returnNode, safepointNode);
}
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class PosixOSInterface method writeBytes0Uninterruptibly.
@Uninterruptible(reason = "byte[] accessed without pinning")
private boolean writeBytes0Uninterruptibly(FileDescriptor descriptor, byte[] bytes, UnsignedWord length, UnsignedWord offsetOfArrayElement) {
final Pointer addressOfObject = Word.objectToUntrackedPointer(bytes);
final CCharPointer bytePointer = (CCharPointer) addressOfObject.add(offsetOfArrayElement);
return writeBytesUninterruptibly(descriptor, bytePointer, length);
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class PosixOSInterface method writeBytesUninterruptibly.
@Override
@Uninterruptible(reason = "Bytes might be from an Object.")
public boolean writeBytesUninterruptibly(FileDescriptor descriptor, CCharPointer bytes, UnsignedWord length) {
CCharPointer curBuf = bytes;
UnsignedWord curLen = length;
while (curLen.notEqual(0)) {
int fd = Util_java_io_FileDescriptor.getFD(descriptor);
if (fd == -1) {
return false;
}
SignedWord n = UnistdNoTransitions.write(fd, curBuf, curLen);
if (n.equal(-1)) {
return false;
}
curBuf = curBuf.addressOf(n);
curLen = curLen.subtract((UnsignedWord) n);
}
return true;
}
Aggregations