use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class JniEnv method CallStaticLongMethodVarargs.
@JniImpl
public long CallStaticLongMethodVarargs(@JavaType(Class.class) StaticObject clazz, @Handle(Method.class) long methodId, @Pointer TruffleObject varargsPtr) {
Method method = methodIds.getObject(methodId);
assert method.isStatic();
assert (clazz.getMirrorKlass()) == method.getDeclaringKlass();
Object result = method.invokeDirect(null, popVarArgs(varargsPtr, method.getParsedSignature()));
return getMeta().asLong(result, true);
}
use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class JniEnv method CallNonvirtualFloatMethodVarargs.
@JniImpl
public float CallNonvirtualFloatMethodVarargs(@JavaType(Object.class) StaticObject receiver, @JavaType(Class.class) StaticObject clazz, @Handle(Method.class) long methodId, @Pointer TruffleObject varargsPtr) {
Method method = methodIds.getObject(methodId);
assert !method.isStatic();
assert (clazz.getMirrorKlass()) == method.getDeclaringKlass();
Object result = method.invokeDirect(receiver, popVarArgs(varargsPtr, method.getParsedSignature()));
return getMeta().asFloat(result, true);
}
use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class JniEnv method CallStaticShortMethodVarargs.
@JniImpl
public short CallStaticShortMethodVarargs(@JavaType(Class.class) StaticObject clazz, @Handle(Method.class) long methodId, @Pointer TruffleObject varargsPtr) {
Method method = methodIds.getObject(methodId);
assert method.isStatic();
assert (clazz.getMirrorKlass()) == method.getDeclaringKlass();
Object result = method.invokeDirect(null, popVarArgs(varargsPtr, method.getParsedSignature()));
return getMeta().asShort(result, true);
}
use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class JniEnv method FromReflectedMethod.
/**
* <h3>jmethodID FromReflectedMethod(JNIEnv *env, jobject method);</h3>
* <p>
* Converts a java.lang.reflect.Method or java.lang.reflect.Constructor object to a method ID.
*/
@JniImpl
@Handle(Method.class)
public long FromReflectedMethod(@JavaType(java.lang.reflect.Executable.class) StaticObject method) {
assert InterpreterToVM.instanceOf(method, getMeta().java_lang_reflect_Method) || InterpreterToVM.instanceOf(method, getMeta().java_lang_reflect_Constructor);
Method guestMethod;
if (InterpreterToVM.instanceOf(method, getMeta().java_lang_reflect_Method)) {
guestMethod = Method.getHostReflectiveMethodRoot(method, getMeta());
} else if (InterpreterToVM.instanceOf(method, getMeta().java_lang_reflect_Constructor)) {
guestMethod = Method.getHostReflectiveConstructorRoot(method, getMeta());
} else {
throw EspressoError.shouldNotReachHere();
}
guestMethod.getDeclaringKlass().initialize();
return methodIds.handlify(guestMethod);
}
use of com.oracle.truffle.espresso.impl.Method in project graal by oracle.
the class JniEnv method CallStaticIntMethodVarargs.
@JniImpl
public int CallStaticIntMethodVarargs(@JavaType(Class.class) StaticObject clazz, @Handle(Method.class) long methodId, @Pointer TruffleObject varargsPtr) {
Method method = methodIds.getObject(methodId);
assert method.isStatic();
assert (clazz.getMirrorKlass()) == method.getDeclaringKlass();
Object result = method.invokeDirect(null, popVarArgs(varargsPtr, method.getParsedSignature()));
return getMeta().asInt(result, true);
}
Aggregations