use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class JDKProxyRedefinitionPlugin method collectExtraClassesToReload.
@Override
@TruffleBoundary
public synchronized void collectExtraClassesToReload(List<RedefineInfo> redefineInfos, List<RedefineInfo> additional) {
for (RedefineInfo redefineInfo : redefineInfos) {
KlassRef klass = redefineInfo.getKlass();
if (klass != null) {
List<ProxyCache> list = cache.getOrDefault(klass, Collections.emptyList());
for (ProxyCache proxyCache : list) {
StaticObject result = (StaticObject) proxyGeneratorMethodCallNode.call(proxyCache.proxyName, proxyCache.interfaces, proxyCache.classModifier);
byte[] proxyBytes = (byte[]) getContext().getMeta().toHostBoxed(result);
additional.add(new RedefineInfo(proxyCache.klass, proxyBytes));
}
}
}
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class ReferenceSupport method referenceRefersTo.
public static boolean referenceRefersTo(Reference<StaticObject> ref, StaticObject object) {
assert !(ref instanceof PhantomReference);
StaticObject value = ref.get();
value = value == null ? StaticObject.NULL : value;
return value == object;
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class ClassRedefinition method getLoadedKlass.
private static Klass getLoadedKlass(Symbol<Symbol.Type> klassType, ObjectKlass oldKlass) throws RedefintionNotSupportedException {
Klass klass;
klass = oldKlass.getContext().getRegistries().findLoadedClass(klassType, oldKlass.getDefiningClassLoader());
if (klass == null) {
// new super interface must be loaded eagerly then
StaticObject resourceGuestString = oldKlass.getMeta().toGuestString(Types.binaryName(klassType));
try {
StaticObject loadedClass = (StaticObject) oldKlass.getMeta().java_lang_ClassLoader_loadClass.invokeDirect(oldKlass.getDefiningClassLoader(), resourceGuestString);
klass = loadedClass.getMirrorKlass();
} catch (Throwable t) {
throw new RedefintionNotSupportedException(ErrorCodes.ABSENT_INFORMATION);
}
}
return klass;
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class JDKCacheRedefinitionPlugin method postClassRedefinition.
@Override
public void postClassRedefinition(ObjectKlass[] changedKlasses) {
synchronized (threadGroupContexts) {
for (ObjectKlass changedKlass : changedKlasses) {
if (flushFromCachesMethod != null) {
flushFromCachesMethod.invokeDirect(null, changedKlass.mirror());
}
Iterator<WeakReference<StaticObject>> iterator = threadGroupContexts.iterator();
while (iterator.hasNext()) {
WeakReference<StaticObject> ref = iterator.next();
StaticObject context = ref.get();
if (context != null) {
removeBeanInfoMethod.invokeDirect(context, changedKlass.mirror());
} else {
// clean up list when context was reclaimed
iterator.remove();
}
}
}
}
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class CharArrayLoadQuickNode method execute.
@Override
public int execute(VirtualFrame frame) {
int index = BytecodeNode.popInt(frame, top - 1);
StaticObject array = nullCheck(BytecodeNode.popObject(frame, top - 2));
BytecodeNode.putInt(frame, top - 2, charArrayLoad.execute(array, index));
return stackEffectOf_CALOAD;
}
Aggregations