use of com.oracle.truffle.espresso.substitutions.JavaType in project graal by oracle.
the class JniEnv method NewObjectArray.
@JniImpl
@JavaType(Object[].class)
public StaticObject NewObjectArray(int length, @JavaType(Class.class) StaticObject elementClass, @JavaType(Object.class) StaticObject initialElement) {
assert !elementClass.getMirrorKlass().isPrimitive();
StaticObject arr = elementClass.getMirrorKlass().allocateReferenceArray(length);
if (length > 0) {
// Single store check
getInterpreterToVM().setArrayObject(initialElement, 0, arr);
Arrays.fill(arr.unwrap(), initialElement);
}
return arr;
}
use of com.oracle.truffle.espresso.substitutions.JavaType in project graal by oracle.
the class Management method GetPeakMemoryPoolUsage.
@ManagementImpl
@JavaType(Object.class)
public StaticObject GetPeakMemoryPoolUsage(@JavaType(Object.class) StaticObject pool) {
if (StaticObject.isNull(pool)) {
return StaticObject.NULL;
}
Method init = getMeta().java_lang_management_MemoryUsage.lookupDeclaredMethod(Symbol.Name._init_, getSignatures().makeRaw(Symbol.Type._void, Symbol.Type._long, Symbol.Type._long, Symbol.Type._long, Symbol.Type._long));
StaticObject instance = getMeta().java_lang_management_MemoryUsage.allocateInstance();
init.invokeDirect(instance, 0L, 0L, 0L, 0L);
return instance;
}
use of com.oracle.truffle.espresso.substitutions.JavaType in project graal by oracle.
the class Management method GetMemoryPoolUsage.
@ManagementImpl
@JavaType(Object.class)
public StaticObject GetMemoryPoolUsage(@JavaType(Object.class) StaticObject pool) {
if (StaticObject.isNull(pool)) {
return StaticObject.NULL;
}
Method init = getMeta().java_lang_management_MemoryUsage.lookupDeclaredMethod(Symbol.Name._init_, getSignatures().makeRaw(Symbol.Type._void, Symbol.Type._long, Symbol.Type._long, Symbol.Type._long, Symbol.Type._long));
StaticObject instance = getMeta().java_lang_management_MemoryUsage.allocateInstance();
init.invokeDirect(instance, 0L, 0L, 0L, 0L);
return instance;
}
Aggregations