Mercurial > hg > truffle
changeset 10011:e65727799325
LoadJavaMirrorWithKlassPhase: replace if with an assertion
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 12 Jun 2013 13:18:49 +0200 |
parents | 893bc1dbb58c |
children | b2f1168ee37f |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Wed Jun 12 16:04:42 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Wed Jun 12 13:18:49 2013 +0200 @@ -40,18 +40,18 @@ Constant constant = node.asConstant(); if (constant.getKind() == Kind.Object && constant.asObject() instanceof Class<?>) { ResolvedJavaType type = context.getRuntime().lookupJavaType((Class<?>) constant.asObject()); - if (type instanceof HotSpotResolvedObjectType) { - HotSpotRuntime runtime = (HotSpotRuntime) context.getRuntime(); + assert type instanceof HotSpotResolvedObjectType; - Constant klass = ((HotSpotResolvedObjectType) type).klass(); - ConstantNode klassNode = ConstantNode.forConstant(klass, runtime, graph); + HotSpotRuntime runtime = (HotSpotRuntime) context.getRuntime(); - Stamp stamp = StampFactory.exactNonNull(runtime.lookupJavaType(Class.class)); - LocationNode location = graph.unique(ConstantLocationNode.create(FINAL_LOCATION, stamp.kind(), runtime.config.classMirrorOffset, graph)); - FloatingReadNode freadNode = graph.add(new FloatingReadNode(klassNode, location, null, stamp)); + Constant klass = ((HotSpotResolvedObjectType) type).klass(); + ConstantNode klassNode = ConstantNode.forConstant(klass, runtime, graph); - graph.replaceFloating(node, freadNode); - } + Stamp stamp = StampFactory.exactNonNull(runtime.lookupJavaType(Class.class)); + LocationNode location = graph.unique(ConstantLocationNode.create(FINAL_LOCATION, stamp.kind(), runtime.config.classMirrorOffset, graph)); + FloatingReadNode freadNode = graph.add(new FloatingReadNode(klassNode, location, null, stamp)); + + graph.replaceFloating(node, freadNode); } } }