Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CompositeValueClassSubstitutions.java @ 18287:b7461f7fa8a0
added HotSpotObjectConstant.getCompositeValueClass()
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 06 Nov 2014 13:55:47 +0100 |
parents | f7d45e2426d4 |
children | f57d86eb036f |
comparison
equal
deleted
inserted
replaced
18286:ffcbc50063a3 | 18287:b7461f7fa8a0 |
---|---|
53 | 53 |
54 protected CompositeValueClassGetNode(Invoke invoke) { | 54 protected CompositeValueClassGetNode(Invoke invoke) { |
55 super(invoke); | 55 super(invoke); |
56 } | 56 } |
57 | 57 |
58 @SuppressWarnings("unchecked") | |
59 @Override | 58 @Override |
60 protected JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess) { | 59 protected JavaConstant evaluate(JavaConstant param, MetaAccessProvider metaAccess) { |
61 if (param.isNull() || ImmutableCode.getValue()) { | 60 if (param.isNull() || ImmutableCode.getValue()) { |
62 return null; | 61 return null; |
63 } | 62 } |
64 return HotSpotObjectConstantImpl.forObject(CompositeValueClass.get((Class<? extends CompositeValue>) HotSpotObjectConstantImpl.asObject(param))); | 63 HotSpotObjectConstant c = (HotSpotObjectConstant) param; |
64 return c.getCompositeValueClass(); | |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 @MacroSubstitution(isStatic = true, forced = true, macro = CompositeValueClassGetNode.class) | 68 @MacroSubstitution(isStatic = true, forced = true, macro = CompositeValueClassGetNode.class) |
69 private static native CompositeValueClass get(Class<?> c); | 69 private static native CompositeValueClass get(Class<?> c); |