# HG changeset patch # User Doug Simon # Date 1416992447 -3600 # Node ID ef6076d83d179cd948c178ac2618abc1be4953b0 # Parent e888e28ac4bb52916f43745141e3f2a4b37fa3b5 removed static access to HotSpotGraalRuntime from HubGetClassNode diff -r e888e28ac4bb -r ef6076d83d17 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java Wed Nov 26 09:59:00 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java Wed Nov 26 10:00:47 2014 +0100 @@ -22,7 +22,6 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import com.oracle.graal.api.meta.*; @@ -38,20 +37,22 @@ import com.oracle.graal.nodes.spi.*; /** - * Read Klass::_java_mirror and incorporate non-null type information into stamp. This is also used - * by {@link ClassGetHubNode} to eliminate chains of klass._java_mirror._klass. + * Read {@code Klass::_java_mirror} and incorporate non-null type information into stamp. This is + * also used by {@link ClassGetHubNode} to eliminate chains of {@code klass._java_mirror._klass}. */ @NodeInfo public class HubGetClassNode extends FloatingGuardedNode implements Lowerable, Canonicalizable { @Input protected ValueNode hub; + protected final HotSpotVMConfig config; - public static HubGetClassNode create(ValueNode hub) { - return new HubGetClassNode(hub); + public static HubGetClassNode create(@InjectedNodeParameter MetaAccessProvider metaAccess, @InjectedNodeParameter HotSpotVMConfig config, ValueNode hub) { + return new HubGetClassNode(hub, metaAccess, config); } - protected HubGetClassNode(ValueNode hub) { - super(StampFactory.declaredNonNull(runtime().fromClass(Class.class)), null); + protected HubGetClassNode(ValueNode hub, MetaAccessProvider metaAccess, HotSpotVMConfig config) { + super(StampFactory.declaredNonNull(metaAccess.lookupJavaType(Class.class)), null); this.hub = hub; + this.config = config; } public ValueNode getHub() { @@ -80,7 +81,6 @@ return; } - HotSpotVMConfig config = runtime().getConfig(); LocationNode location = ConstantLocationNode.create(CLASS_MIRROR_LOCATION, Kind.Object, config.classMirrorOffset, graph()); assert !hub.isConstant(); FloatingReadNode read = graph().unique(FloatingReadNode.create(hub, location, null, stamp(), getGuard(), BarrierType.NONE));