Search in sources :

Example 1 with NoOptCompile

use of org.vmmagic.pragma.NoOptCompile in project JikesRVM by JikesRVM.

the class JNIHelpers method invokeWithDotDotVarArg.

/**
 * Common code shared by the JNI functions CallStatic<type>Method
 * (static method invocation)
 * @param methodID the method ID
 * @param expectReturnType the return type of the method to be invoked
 * @return an object that may be the return object or a wrapper for the primitive return value
 * @throws Exception if the return type doesn't match the expected return type
 */
@NoInline
@NoOptCompile
public static // expect a certain stack frame structure
Object invokeWithDotDotVarArg(int methodID, TypeReference expectReturnType) throws Exception {
    MethodReference mr = MemberReference.getMethodRef(methodID);
    Address varargAddress = getVarArgAddress(false);
    Object[] argObjectArray = packageParameterFromVarArg(mr, varargAddress);
    return callMethod(null, mr, argObjectArray, expectReturnType, true);
}
Also used : Address(org.vmmagic.unboxed.Address) MethodReference(org.jikesrvm.classloader.MethodReference) NoInline(org.vmmagic.pragma.NoInline) NoOptCompile(org.vmmagic.pragma.NoOptCompile)

Example 2 with NoOptCompile

use of org.vmmagic.pragma.NoOptCompile in project JikesRVM by JikesRVM.

the class JNIHelpers method invokeWithDotDotVarArg.

/**
 * Common code shared by the JNI functions Call<type>Method
 * (virtual method invocation)
 * @param obj the object instance
 * @param methodID the method ID
 * @param expectReturnType the return type for checking purpose
 * @param skip4Args  true if the calling JNI Function takes 4 args before the vararg
 *                   false if the calling JNI Function takes 3 args before the vararg
 * @return an object that may be the return object or a wrapper for the primitive return value
 * @throws Exception if the return type doesn't match the expected return type
 */
@NoInline
@NoOptCompile
public static // expect a certain stack frame structure
Object invokeWithDotDotVarArg(Object obj, int methodID, TypeReference expectReturnType, boolean skip4Args) throws Exception {
    MethodReference mr = MemberReference.getMethodRef(methodID);
    Address varargAddress = getVarArgAddress(skip4Args);
    Object[] argObjectArray = packageParameterFromVarArg(mr, varargAddress);
    return callMethod(obj, mr, argObjectArray, expectReturnType, skip4Args);
}
Also used : Address(org.vmmagic.unboxed.Address) MethodReference(org.jikesrvm.classloader.MethodReference) NoInline(org.vmmagic.pragma.NoInline) NoOptCompile(org.vmmagic.pragma.NoOptCompile)

Example 3 with NoOptCompile

use of org.vmmagic.pragma.NoOptCompile in project JikesRVM by JikesRVM.

the class RVMThread method yieldpointFromBackedge.

/**
 * Yieldpoint taken on backedge.
 */
@BaselineSaveLSRegisters
// Save all non-volatile registers in prologue
@NoOptCompile
@NoInline
// TODO fix this -- related to SaveVolatile
@Entrypoint
@Unpreemptible("Becoming another thread interrupts the current thread, avoid preemption in the process")
public static void yieldpointFromBackedge() {
    Address fp = Magic.getFramePointer();
    yieldpoint(BACKEDGE, fp);
}
Also used : Address(org.vmmagic.unboxed.Address) Unpreemptible(org.vmmagic.pragma.Unpreemptible) Entrypoint(org.vmmagic.pragma.Entrypoint) BaselineSaveLSRegisters(org.vmmagic.pragma.BaselineSaveLSRegisters) NoInline(org.vmmagic.pragma.NoInline) NoOptCompile(org.vmmagic.pragma.NoOptCompile)

Example 4 with NoOptCompile

use of org.vmmagic.pragma.NoOptCompile in project JikesRVM by JikesRVM.

the class RVMThread method yieldpointFromEpilogue.

/**
 * Yieldpoint taken in epilogue.
 */
@BaselineSaveLSRegisters
// Save all non-volatile registers in prologue
@NoOptCompile
@NoInline
// TODO fix this -- related to SaveVolatile
@Entrypoint
@Unpreemptible("Becoming another thread interrupts the current thread, avoid preemption in the process")
public static void yieldpointFromEpilogue() {
    Address fp = Magic.getFramePointer();
    yieldpoint(EPILOGUE, fp);
}
Also used : Address(org.vmmagic.unboxed.Address) Unpreemptible(org.vmmagic.pragma.Unpreemptible) Entrypoint(org.vmmagic.pragma.Entrypoint) BaselineSaveLSRegisters(org.vmmagic.pragma.BaselineSaveLSRegisters) NoInline(org.vmmagic.pragma.NoInline) NoOptCompile(org.vmmagic.pragma.NoOptCompile)

Example 5 with NoOptCompile

use of org.vmmagic.pragma.NoOptCompile in project JikesRVM by JikesRVM.

the class RVMThread method yieldpointFromPrologue.

/*
   * Support for yieldpoints
   */
/**
 * Yieldpoint taken in prologue.
 */
@BaselineSaveLSRegisters
// Save all non-volatile registers in prologue
@NoOptCompile
@NoInline
// TODO fix this -- related to SaveVolatile
@Entrypoint
@Unpreemptible("Becoming another thread interrupts the current thread, avoid preemption in the process")
public static void yieldpointFromPrologue() {
    Address fp = Magic.getFramePointer();
    yieldpoint(PROLOGUE, fp);
}
Also used : Address(org.vmmagic.unboxed.Address) Unpreemptible(org.vmmagic.pragma.Unpreemptible) Entrypoint(org.vmmagic.pragma.Entrypoint) BaselineSaveLSRegisters(org.vmmagic.pragma.BaselineSaveLSRegisters) NoInline(org.vmmagic.pragma.NoInline) NoOptCompile(org.vmmagic.pragma.NoOptCompile)

Aggregations

NoInline (org.vmmagic.pragma.NoInline)5 NoOptCompile (org.vmmagic.pragma.NoOptCompile)5 Address (org.vmmagic.unboxed.Address)5 BaselineSaveLSRegisters (org.vmmagic.pragma.BaselineSaveLSRegisters)3 Entrypoint (org.vmmagic.pragma.Entrypoint)3 Unpreemptible (org.vmmagic.pragma.Unpreemptible)3 MethodReference (org.jikesrvm.classloader.MethodReference)2