Tabnine Logo
StructFieldInfo.getOffsetInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
getOffsetInfo
method
in
com.oracle.svm.hosted.c.info.StructFieldInfo

Best Java code snippets using com.oracle.svm.hosted.c.info.StructFieldInfo.getOffsetInfo (Showing top 7 results out of 315)

origin: com.oracle.substratevm/svm

@Override
public void visitStructFieldInfo(StructFieldInfo fieldInfo) {
  parseIntegerProperty(fieldInfo.getSizeInfo());
  parseIntegerProperty(fieldInfo.getOffsetInfo());
  if (fieldInfo.getKind() == ElementKind.INTEGER) {
    parseSignedness(fieldInfo.getSignednessInfo());
  }
}
origin: com.oracle.substratevm/library-support

for (HostedMethod method : methods) {
  StructFieldInfo field = findFieldFor(functionTableMetadata, method.getName());
  offsets[index] = field.getOffsetInfo().getProperty();
  pointers[index] = getStubFunctionPointer(access, method);
  index++;
  HostedMethod hostedMethod = access.getUniverse().lookup(analysisMethod);
  offsets[index] = field.getOffsetInfo().getProperty();
  pointers[index] = MethodPointer.factory(hostedMethod);
  index++;
    for (String prefix : prefixes) {
      StructFieldInfo field = findFieldFor(functionTableMetadata, prefix + kind.name() + "Method" + suffix);
      offsets[index] = field.getOffsetInfo().getProperty();
      pointers[index] = trampoline;
      index++;
    offsets[index] = field.getOffsetInfo().getProperty();
    pointers[index] = nonvirtualTrampoline;
    index++;
  offsets[index] = field.getOffsetInfo().getProperty();
  pointers[index] = trampoline;
  index++;
origin: com.oracle.substratevm/svm

/**
 * Compute the offsets of each field.
 */
private void planLayout(RawStructureInfo info) {
  /* Inherit from the parent type. */
  int currentOffset = info.getParentInfo() != null ? info.getParentInfo().getSizeInfo().getProperty() : 0;
  List<StructFieldInfo> fields = new ArrayList<>();
  for (ElementInfo child : info.getChildren()) {
    if (child instanceof StructFieldInfo) {
      fields.add((StructFieldInfo) child);
    } else if (child instanceof StructBitfieldInfo) {
      throw UserError.abort("StructBitfield is currently not supported by RawStructures!");
    }
  }
  /*
   * Sort fields in field size descending order. Note that prior to this, the fields are
   * already sorted in alphabetical order.
   */
  fields.sort((f1, f2) -> f2.getSizeInfo().getProperty() - f1.getSizeInfo().getProperty());
  for (StructFieldInfo finfo : fields) {
    assert findParentFieldInfo(finfo, info.getParentInfo()) == null;
    int fieldSize = finfo.getSizeInfo().getProperty();
    currentOffset = alignOffset(currentOffset, fieldSize);
    assert currentOffset % fieldSize == 0;
    finfo.getOffsetInfo().setProperty(currentOffset);
    currentOffset += fieldSize;
  }
  info.getSizeInfo().setProperty(currentOffset);
  info.setPlanned();
}
origin: com.oracle.substratevm/library-support

private JNIStructFunctionsInitializer<JNIInvokeInterface> buildInvokesInitializer(CompilationAccessImpl access, CFunctionPointer unimplemented) {
  HostedType invokes = access.getMetaAccess().lookupJavaType(JNIInvocationInterface.class);
  HostedMethod[] methods = invokes.getDeclaredMethods();
  int index = 0;
  int[] offsets = new int[methods.length];
  CFunctionPointer[] pointers = new CFunctionPointer[offsets.length];
  for (HostedMethod method : methods) {
    StructFieldInfo field = findFieldFor(invokeInterfaceMetadata, method.getName());
    offsets[index] = field.getOffsetInfo().getProperty();
    pointers[index] = getStubFunctionPointer(access, method);
    index++;
  }
  VMError.guarantee(index == offsets.length && index == pointers.length);
  JNIStructFunctionsInitializer<JNIInvokeInterface> initializer = new JNIStructFunctionsInitializer<>(JNIInvokeInterface.class, offsets, pointers, unimplemented);
  access.registerAsImmutable(pointers);
  access.registerAsImmutable(initializer);
  return initializer;
}
origin: com.oracle.substratevm/svm

@Override
protected void visitStructFieldInfo(StructFieldInfo fieldInfo) {
  printUnsignedLong(fieldInfo.getSizeInfo(), sizeOfField(fieldInfo));
  printUnsignedLong(fieldInfo.getOffsetInfo(), offsetOfField(fieldInfo));
  if (fieldInfo.getKind() == ElementKind.INTEGER) {
    String tempVar = getUniqueTempVarName(fieldInfo.getParent());
    registerElementForCurrentLine(fieldInfo.getParent().getAnnotatedElement());
    writer.indents().appendln("{");
    writer.indent();
    writer.indents().appendln(fieldInfo.getParent().getName() + " " + tempVar + ";");
    printIsUnsigned(fieldInfo.getSignednessInfo(), isUnsigned(tempVar + "." + fieldInfo.getName()));
    writer.outdent();
    writer.indents().appendln("}");
  }
}
origin: com.oracle.substratevm/svm

ElementInfo parentInfo = methodInfo.getParent();
if (parentInfo instanceof StructFieldInfo) {
  int offset = ((StructFieldInfo) parentInfo).getOffsetInfo().getProperty();
  if (((AccessorInfo) methodInfo).getAccessorKind() == AccessorKind.OFFSET) {
    return replaceOffsetOf(b, method, args, (AccessorInfo) methodInfo, offset);
origin: com.oracle.substratevm/library-support

JavaKind readKind = type.getJavaKind();
StructFieldInfo fieldInfo = getJNIValueOffsetOf(elementType, readKind);
int offset = i * elementSize + fieldInfo.getOffsetInfo().getProperty();
ConstantNode offsetConstant = kit.createConstant(JavaConstant.forInt(offset), providers.getWordTypes().getWordKind());
OffsetAddressNode address = kit.unique(new OffsetAddressNode(array, offsetConstant));
com.oracle.svm.hosted.c.infoStructFieldInfogetOffsetInfo

Popular methods of StructFieldInfo

  • getLocationIdentity
  • getName
  • <init>
  • adoptChild
  • adoptChildren
  • getAccessorInfo
  • getChildren
  • getKind
  • getParent
  • getSignednessInfo
  • getSizeInfo
  • isObject
  • getSizeInfo,
  • isObject,
  • mergeChildrenAndDelete,
  • setLocationIdentity

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Collectors (java.util.stream)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Table (org.hibernate.mapping)
    A relational table
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now