comparison jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @ 23393:1d4ce2d19e52

clean up and minimize JVMCI (JDK-8156835)
author Doug Simon <doug.simon@oracle.com>
date Thu, 12 May 2016 20:57:31 +0200
parents b3a816d3b844
children 3e8ce13f4e12
comparison
equal deleted inserted replaced
23392:b3a816d3b844 23393:1d4ce2d19e52
35 import jdk.vm.ci.meta.ResolvedJavaType; 35 import jdk.vm.ci.meta.ResolvedJavaType;
36 36
37 /** 37 /**
38 * HotSpot implementation of {@link ConstantReflectionProvider}. 38 * HotSpot implementation of {@link ConstantReflectionProvider}.
39 */ 39 */
40 public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider, HotSpotProxified { 40 public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider {
41 41
42 protected final HotSpotJVMCIRuntimeProvider runtime; 42 protected final HotSpotJVMCIRuntimeProvider runtime;
43 protected final HotSpotMethodHandleAccessProvider methodHandleAccess; 43 protected final HotSpotMethodHandleAccessProvider methodHandleAccess;
44 protected final HotSpotMemoryAccessProviderImpl memoryAccess; 44 protected final HotSpotMemoryAccessProviderImpl memoryAccess;
45 45
129 } 129 }
130 } 130 }
131 131
132 @Override 132 @Override
133 public JavaConstant boxPrimitive(JavaConstant source) { 133 public JavaConstant boxPrimitive(JavaConstant source) {
134 if (!source.getJavaKind().isPrimitive() || !isBoxCached(source)) { 134 if (source == null || !source.getJavaKind().isPrimitive() || !isBoxCached(source)) {
135 return null; 135 return null;
136 } 136 }
137 return HotSpotObjectConstantImpl.forObject(source.asBoxedPrimitive()); 137 return HotSpotObjectConstantImpl.forObject(source.asBoxedPrimitive());
138 } 138 }
139 139
140 @Override 140 @Override
141 public JavaConstant unboxPrimitive(JavaConstant source) { 141 public JavaConstant unboxPrimitive(JavaConstant source) {
142 if (!source.getJavaKind().isObject()) { 142 if (source == null || !source.getJavaKind().isObject()) {
143 return null; 143 return null;
144 } 144 }
145 if (source.isNull()) { 145 if (source.isNull()) {
146 return null; 146 return null;
147 } 147 }