Tabnine Logo
CGlobalData.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
com.oracle.svm.core.c.CGlobalData

Best Java code snippets using com.oracle.svm.core.c.CGlobalData.get (Showing top 20 results out of 315)

origin: com.oracle.substratevm/svm

static void initializeSimpleTypes(Target_com_oracle_truffle_nfi_impl_NFIContext context) {
  // it's important to initialize POINTER first, since the primitive array types depend on it
  initializeNativeSimpleType(context, NativeSimpleType.POINTER, ffi_type_pointer.get());
  initializeNativeSimpleType(context, NativeSimpleType.VOID, ffi_type_void.get());
  initializeNativeSimpleType(context, NativeSimpleType.UINT8, ffi_type_uint8.get());
  initializeNativeSimpleType(context, NativeSimpleType.SINT8, ffi_type_sint8.get());
  initializeNativeSimpleType(context, NativeSimpleType.UINT16, ffi_type_uint16.get());
  initializeNativeSimpleType(context, NativeSimpleType.SINT16, ffi_type_sint16.get());
  initializeNativeSimpleType(context, NativeSimpleType.UINT32, ffi_type_uint32.get());
  initializeNativeSimpleType(context, NativeSimpleType.SINT32, ffi_type_sint32.get());
  initializeNativeSimpleType(context, NativeSimpleType.UINT64, ffi_type_uint64.get());
  initializeNativeSimpleType(context, NativeSimpleType.SINT64, ffi_type_sint64.get());
  initializeNativeSimpleType(context, NativeSimpleType.FLOAT, ffi_type_float.get());
  initializeNativeSimpleType(context, NativeSimpleType.DOUBLE, ffi_type_double.get());
  initializeNativeSimpleType(context, NativeSimpleType.STRING, ffi_type_pointer.get());
  initializeNativeSimpleType(context, NativeSimpleType.OBJECT, ffi_type_pointer.get());
}
origin: com.oracle.substratevm/svm

  static void leave() {
    int code = CEntryPointActions.leaveDetachThread();
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  @Override
  @Uninterruptible(reason = "Called during isolate tear-down.")
  public int tearDown(PointerBase heapBase) {
    Word size = Isolates.IMAGE_HEAP_END.get().subtract(Isolates.IMAGE_HEAP_BEGIN.get());
    if (VirtualMemoryProvider.get().free(heapBase, size) != 0) {
      return CEntryPointErrors.MAP_HEAP_FAILED;
    }
    return CEntryPointErrors.NO_ERROR;
  }
}
origin: com.oracle.substratevm/svm

  static void leave() {
    int code = CEntryPointActions.leave();
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  static void leave() {
    int code = CEntryPointActions.leaveTearDownIsolate();
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  static void enter(Isolate isolate) {
    int code = CEntryPointActions.enterIsolate(isolate);
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  @Uninterruptible(reason = "Thread state not set up.")
  @Override
  public void failFatally(int code, CCharPointer message) {
    FILE stderr = fdopen(2, FAIL_FATALLY_FDOPEN_MODE.get());
    fprintfSD(stderr, FAIL_FATALLY_MESSAGE_FORMAT.get(), message, code);
    LibC.exit(code);
  }
}
origin: com.oracle.substratevm/svm

@Uninterruptible(reason = "Thread state not yet set up.")
public static PointerBase getHeapBase(Isolate isolate) {
  if (!SubstrateOptions.SpawnIsolates.getValue()) {
    return IMAGE_HEAP_BEGIN.get();
  }
  return isolate;
}
origin: com.oracle.substratevm/svm

  static void enter(IsolateThread thread) {
    int code = CEntryPointActions.enter(thread);
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  static void enter() {
    int code = CEntryPointActions.enterCreateIsolate(WordFactory.nullPointer());
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  @SuppressWarnings("unused")
  static void enter(ThreadStartData data) {
    int code = CEntryPointActions.enterAttachThread(data.getIsolate());
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

  @SuppressWarnings("unused")
  static void enter(WindowsThreadStartData data) {
    int code = CEntryPointActions.enterAttachThread(data.getIsolate());
    if (code != 0) {
      CEntryPointActions.failFatally(code, errorMessage.get());
    }
  }
}
origin: com.oracle.substratevm/svm

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public static UnsignedWord getPageSize() {
  Word value = CACHED_PAGE_SIZE.get().read();
  if (value.equal(WordFactory.zero())) {
    initCaches();
    value = CACHED_PAGE_SIZE.get().read();
  }
  return value;
}
origin: com.oracle.substratevm/svm

@Override
@Uninterruptible(reason = "May be called from uninterruptible code.", mayBeInlined = true)
public UnsignedWord getGranularity() {
  Word value = CACHED_ALLOC_GRAN.get().read();
  if (value.equal(WordFactory.zero())) {
    initCaches();
    value = CACHED_ALLOC_GRAN.get().read();
  }
  return value;
}
origin: com.oracle.substratevm/svm

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public static UnsignedWord getPageSize() {
  Word value = CACHED_PAGE_SIZE.get().read();
  if (value.equal(WordFactory.zero())) {
    long queried = sysconf(_SC_PAGE_SIZE());
    value = WordFactory.unsigned(queried);
    CACHED_PAGE_SIZE.get().write(value);
  }
  return value;
}
origin: com.oracle.substratevm/svm

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
private static void initCaches() {
  WinBase.SYSTEM_INFO sysInfo = StackValue.get(WinBase.SYSTEM_INFO.class);
  WinBase.GetSystemInfo(sysInfo);
  int pageSize = sysInfo.dwPageSize();
  Word value = WordFactory.unsigned(pageSize);
  CACHED_PAGE_SIZE.get().write(value);
  int granularity = sysInfo.dwAllocationGranularity();
  value = WordFactory.unsigned(granularity);
  CACHED_ALLOC_GRAN.get().write(value);
}
origin: com.oracle.substratevm/library-support

/** Remove an entry. */
public static boolean removeJavaVM(JNIJavaVM javavm) {
  WordPointer p = HEAD.get().readWord(0);
  while (p.isNonNull()) {
    Word capacity = p.read(0);
    for (Word i = unsigned(1); i.belowOrEqual(capacity); i = i.add(1)) {
      JNIJavaVM entry = p.read(i);
      if (entry.equal(javavm)) {
        p.write(i, nullPointer());
        return true;
      }
    }
    p = p.read(capacity.add(1)); // next
  }
  return false;
}
origin: com.oracle.substratevm/svm

@Uninterruptible(reason = UNINTERRUPTIBLE_REASON)
@CEntryPoint(name = "get_isolate", documentation = {
        "Given an isolate thread structure, determines to which isolate it belongs and returns",
        "the address of its isolate structure. If an error occurs, returns NULL instead."})
@CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, nameTransformation = NameTransformation.class)
public static Isolate getIsolate(IsolateThread thread) {
  Isolate isolate = WordFactory.nullPointer();
  if (thread.isNull()) {
    // proceed to return null
  } else if (SubstrateOptions.MultiThreaded.getValue()) {
    long offset = ISOLATETHREAD_ISOLATE_OFFSET.get().read();
    isolate = ((Pointer) thread).readWord(WordFactory.unsigned(offset));
  } else if (SubstrateOptions.SpawnIsolates.getValue() || thread.equal(CEntryPointSetup.SINGLE_THREAD_SENTINEL)) {
    isolate = (Isolate) ((Pointer) thread).subtract(CEntryPointSetup.SINGLE_ISOLATE_TO_SINGLE_THREAD_ADDEND);
  }
  return isolate;
}
origin: com.oracle.substratevm/library-support

  /** Gather non-null entries in a buffer and provide the total number of non-null entries. */
  @Uninterruptible(reason = "Called from uninterruptible code.")
  public static void gather(JNIJavaVMPointer buffer, int bufferLength, CIntPointer totalCountPointer) {
    int totalCount = 0;
    WordPointer p = HEAD.get().readWord(0);
    while (p.isNonNull()) {
      Word capacity = p.read(0);
      for (Word i = unsigned(1); i.belowOrEqual(capacity); i = i.add(1)) {
        JNIJavaVM entry = p.read(i);
        if (entry.isNonNull()) {
          if (totalCount < bufferLength) {
            buffer.write(totalCount, entry);
          }
          totalCount++;
        }
      }
      p = p.read(capacity.add(1)); // next
    }
    totalCountPointer.write(totalCount);
  }
}
origin: com.oracle.substratevm/svm

  @Override
  public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
    if (SubstrateUtil.HOSTED) {
      // AOT compilation: record patch that is fixed up later
      int before = masm.position();
      AMD64Address address = masm.getPlaceholder(before);
      if (dataInfo.isSymbolReference()) {
        // Pure symbol reference: the data contains the symbol's address, load it
        masm.movq(asRegister(result), address);
      } else {
        // Data: load its address
        masm.leaq(asRegister(result), address);
      }
      crb.compilationResult.recordDataPatch(before, new CGlobalDataReference(dataInfo));
    } else {
      // Runtime compilation: compute the actual address
      Pointer globalsBase = CGlobalDataInfo.CGLOBALDATA_RUNTIME_BASE_ADDRESS.get();
      Pointer address = globalsBase.add(dataInfo.getOffset());
      masm.movq(asRegister(result), address.rawValue());
      if (dataInfo.isSymbolReference()) { // load data, which contains symbol's address
        masm.movq(asRegister(result), new AMD64Address(asRegister(result)));
      }
    }
  }
}
com.oracle.svm.core.cCGlobalDataget

Popular methods of CGlobalData

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getResourceAsStream (ClassLoader)
    • getExternalFilesDir (Context)
    • getApplicationContext (Context)
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • Proxy (java.net)
      This class represents proxy server settings. A created instance of Proxy stores a type and an addres
    • ConcurrentHashMap (java.util.concurrent)
      A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
    • Stream (java.util.stream)
      A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
    • Cipher (javax.crypto)
      This class provides access to implementations of cryptographic ciphers for encryption and decryption
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • CodeWhisperer alternatives
    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