< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java

Print this page
rev 52509 : [mq]: graal2


  76             ObjectStamp objectStamp = (ObjectStamp) object.stamp(view);
  77             if (objectStamp.isExactType()) {
  78                 return ConstantNode.forConstant(constantReflection.asJavaClass(objectStamp.type()), metaAccess);
  79             }
  80         }
  81         return null;
  82     }
  83 
  84     @Override
  85     public ValueNode canonical(CanonicalizerTool tool) {
  86         NodeView view = NodeView.from(tool);
  87         ValueNode folded = tryFold(tool.getMetaAccess(), tool.getConstantReflection(), view, getObject());
  88         return folded == null ? this : folded;
  89     }
  90 
  91     @Override
  92     public void virtualize(VirtualizerTool tool) {
  93         ValueNode alias = tool.getAlias(getObject());
  94         if (alias instanceof VirtualObjectNode) {
  95             VirtualObjectNode virtual = (VirtualObjectNode) alias;
  96             Constant javaClass = tool.getConstantReflectionProvider().asJavaClass(virtual.type());
  97             tool.replaceWithValue(ConstantNode.forConstant(stamp(NodeView.DEFAULT), javaClass, tool.getMetaAccessProvider(), graph()));
  98         }
  99     }
 100 }


  76             ObjectStamp objectStamp = (ObjectStamp) object.stamp(view);
  77             if (objectStamp.isExactType()) {
  78                 return ConstantNode.forConstant(constantReflection.asJavaClass(objectStamp.type()), metaAccess);
  79             }
  80         }
  81         return null;
  82     }
  83 
  84     @Override
  85     public ValueNode canonical(CanonicalizerTool tool) {
  86         NodeView view = NodeView.from(tool);
  87         ValueNode folded = tryFold(tool.getMetaAccess(), tool.getConstantReflection(), view, getObject());
  88         return folded == null ? this : folded;
  89     }
  90 
  91     @Override
  92     public void virtualize(VirtualizerTool tool) {
  93         ValueNode alias = tool.getAlias(getObject());
  94         if (alias instanceof VirtualObjectNode) {
  95             VirtualObjectNode virtual = (VirtualObjectNode) alias;
  96             Constant javaClass = tool.getConstantReflection().asJavaClass(virtual.type());
  97             tool.replaceWithValue(ConstantNode.forConstant(stamp(NodeView.DEFAULT), javaClass, tool.getMetaAccess(), graph()));
  98         }
  99     }
 100 }
< prev index next >