use of com.oracle.truffle.llvm.runtime.pointer.LLVMPointer in project graal by oracle.
the class LLVMToDebugValueNode method fromGlobal.
@Specialization
protected LLVMDebugValue fromGlobal(LLVMDebugGlobalVariable value, @Cached BranchProfile exception) {
LLVMGlobal global = value.getDescriptor();
LLVMPointer target = getContext().getSymbol(global, exception);
if (LLVMManagedPointer.isInstance(target)) {
final LLVMManagedPointer managedPointer = LLVMManagedPointer.cast(target);
if (LLDBSupport.pointsToObjectAccess(LLVMManagedPointer.cast(target))) {
return new LLDBMemoryValue(managedPointer);
}
}
return new LLDBGlobalConstant(global);
}
use of com.oracle.truffle.llvm.runtime.pointer.LLVMPointer in project graal by oracle.
the class LLVMX86_64VaListStorage method getArgPtrFromNativePtr.
/**
* Calculate the number of argument shifts in the overflow area.
*
* @param srcVaList
* @param readLib
*/
private static long getArgPtrFromNativePtr(LLVMX86_64VaListStorage srcVaList, LLVMManagedReadLibrary readLib) {
long curAddr;
long baseAddr;
LLVMPointer overflowAreaPtr = readLib.readPointer(srcVaList, X86_64BitVarArgs.OVERFLOW_ARG_AREA);
if (LLVMNativePointer.isInstance(overflowAreaPtr)) {
curAddr = LLVMNativePointer.cast(overflowAreaPtr).asNative();
} else {
curAddr = LLVMManagedPointer.cast(overflowAreaPtr).getOffset();
}
if (LLVMNativePointer.isInstance(srcVaList.overflowArgAreaBaseNativePtr)) {
baseAddr = LLVMNativePointer.cast(srcVaList.overflowArgAreaBaseNativePtr).asNative();
} else {
baseAddr = LLVMManagedPointer.cast(srcVaList.overflowArgAreaBaseNativePtr).getOffset();
}
return curAddr - baseAddr;
}
use of com.oracle.truffle.llvm.runtime.pointer.LLVMPointer in project graal by oracle.
the class LLVMAarch64VaListStorage method getArgPtrFromNativePtr.
/**
* Calculate the number of argument shifts in the overflow area.
*
* @param srcVaList
* @param readLib
*/
private static long getArgPtrFromNativePtr(LLVMAarch64VaListStorage srcVaList, LLVMManagedReadLibrary readLib) {
long curAddr;
long baseAddr;
LLVMPointer overflowAreaPtr = readLib.readPointer(srcVaList, Aarch64BitVarArgs.OVERFLOW_ARG_AREA);
if (LLVMNativePointer.isInstance(overflowAreaPtr)) {
curAddr = LLVMNativePointer.cast(overflowAreaPtr).asNative();
} else {
curAddr = LLVMManagedPointer.cast(overflowAreaPtr).getOffset();
}
if (LLVMNativePointer.isInstance(srcVaList.overflowArgAreaBaseNativePtr)) {
baseAddr = LLVMNativePointer.cast(srcVaList.overflowArgAreaBaseNativePtr).asNative();
} else {
baseAddr = LLVMManagedPointer.cast(srcVaList.overflowArgAreaBaseNativePtr).getOffset();
}
return curAddr - baseAddr;
}
use of com.oracle.truffle.llvm.runtime.pointer.LLVMPointer in project graal by oracle.
the class AggregateLiteralInPlaceNode method writePrimitives.
private void writePrimitives(LLVMContext context, LLVMI8OffsetStoreNode storeI8, LLVMI64OffsetStoreNode storeI64, BranchProfile exception) {
int offset = 0;
int nextStore = 0;
for (int i = 0; i < descriptors.length; i++) {
LLVMPointer address = context.getSymbol(descriptors[i], exception);
int bufferOffset = bufferOffsets[i];
int bufferEnd = i == descriptors.length - 1 ? data.length : bufferOffsets[i + 1];
while (offset < bufferEnd) {
int nextStoreOffset = Math.min(offsets[nextStore], bufferEnd);
offset = initializePrimitiveBlock(address, storeI8, storeI64, offset, nextStoreOffset, bufferOffset);
if (offset < bufferEnd && nextStore < stores.length) {
offset += sizes[nextStore++];
}
}
}
}
use of com.oracle.truffle.llvm.runtime.pointer.LLVMPointer in project graal by oracle.
the class AggregateLiteralInPlaceNode method writeObjects.
@ExplodeLoop
private void writeObjects(VirtualFrame frame, LLVMContext context, BranchProfile exception) {
int offset = 0;
int nextStore = 0;
for (int i = 0; i < descriptors.length; i++) {
LLVMPointer address = context.getSymbol(descriptors[i], exception);
int bufferOffset = bufferOffsets[i];
int bufferEnd = i == descriptors.length - 1 ? data.length : bufferOffsets[i + 1];
while (offset < bufferEnd) {
offset = Math.min(offsets[nextStore], bufferEnd);
if (offset < bufferEnd && nextStore < stores.length) {
stores[nextStore].executeWithTarget(frame, address, offset - bufferOffset);
offset += sizes[nextStore++];
}
}
}
}
Aggregations