use of jdk.vm.ci.hotspot.HotSpotResolvedObjectType in project graal by oracle.
the class HotSpotGraalMBean method optionsFor.
public OptionValues optionsFor(OptionValues initialValues, ResolvedJavaMethod forMethod) {
ensureRegistered(true);
if (forMethod instanceof HotSpotResolvedJavaMethod) {
HotSpotResolvedObjectType type = ((HotSpotResolvedJavaMethod) forMethod).getDeclaringClass();
if (type instanceof HotSpotResolvedJavaType) {
Class<?> clazz = ((HotSpotResolvedJavaType) type).mirror();
Reference<ClassLoader> addNewRef = new WeakReference<>(clazz.getClassLoader());
if (!loaders.contains(addNewRef)) {
EconomicSet<Reference<ClassLoader>> newLoaders = EconomicSet.create(RefEquivalence.INSTANCE, loaders);
newLoaders.add(addNewRef);
this.loaders = newLoaders;
}
}
}
return currentMap(initialValues, forMethod);
}
use of jdk.vm.ci.hotspot.HotSpotResolvedObjectType in project graal by oracle.
the class KlassLayoutHelperNode method canonical.
private static ValueNode canonical(KlassLayoutHelperNode klassLayoutHelperNode, GraalHotSpotVMConfig config, ValueNode klass, Stamp stamp, ConstantReflectionProvider constantReflection, MetaAccessProvider metaAccess) {
KlassLayoutHelperNode self = klassLayoutHelperNode;
if (klass.isConstant()) {
if (!klass.asConstant().isDefaultForKind()) {
Constant constant = stamp.readConstant(constantReflection.getMemoryAccessProvider(), klass.asConstant(), config.klassLayoutHelperOffset);
return ConstantNode.forConstant(stamp, constant, metaAccess);
}
}
if (klass instanceof LoadHubNode) {
LoadHubNode hub = (LoadHubNode) klass;
Stamp hubStamp = hub.getValue().stamp(NodeView.DEFAULT);
if (hubStamp instanceof ObjectStamp) {
ObjectStamp ostamp = (ObjectStamp) hubStamp;
HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) ostamp.type();
if (type != null && type.isArray() && !type.getComponentType().isPrimitive()) {
// The layout for all object arrays is the same.
Constant constant = stamp.readConstant(constantReflection.getMemoryAccessProvider(), type.klass(), config.klassLayoutHelperOffset);
return ConstantNode.forConstant(stamp, constant, metaAccess);
}
}
}
if (self == null) {
self = new KlassLayoutHelperNode(config, klass);
}
return self;
}
Aggregations