< prev index next >

src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java

Print this page

        

*** 34,44 **** import java.lang.reflect.Method; import java.lang.reflect.Modifier; import jdk.vm.ci.code.CodeUtil; import jdk.vm.ci.code.TargetDescription; - import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; --- 34,43 ----
*** 101,122 **** try { Field field = reflectionClass.getDeclaredField("slot"); field.setAccessible(true); return field; } catch (NoSuchFieldException | SecurityException e) { ! throw new JVMCIError(e); } } public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod) { try { Class<?> holder = reflectionMethod.getDeclaringClass(); Field slotField = reflectionMethod instanceof Constructor ? reflectionConstructorSlot : reflectionMethodSlot; final int slot = slotField.getInt(reflectionMethod); return runtime.getCompilerToVM().getResolvedJavaMethodAtSlot(holder, slot); } catch (IllegalArgumentException | IllegalAccessException e) { ! throw new JVMCIError(e); } } public ResolvedJavaField lookupJavaField(Field reflectionField) { Class<?> fieldHolder = reflectionField.getDeclaringClass(); --- 100,121 ---- try { Field field = reflectionClass.getDeclaredField("slot"); field.setAccessible(true); return field; } catch (NoSuchFieldException | SecurityException e) { ! throw new InternalError(e); } } public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod) { try { Class<?> holder = reflectionMethod.getDeclaringClass(); Field slotField = reflectionMethod instanceof Constructor ? reflectionConstructorSlot : reflectionMethodSlot; final int slot = slotField.getInt(reflectionMethod); return runtime.getCompilerToVM().getResolvedJavaMethodAtSlot(holder, slot); } catch (IllegalArgumentException | IllegalAccessException e) { ! throw new InternalError(e); } } public ResolvedJavaField lookupJavaField(Field reflectionField) { Class<?> fieldHolder = reflectionField.getDeclaringClass();
*** 136,146 **** return field; } } } ! throw new JVMCIError("unresolved field %s", reflectionField); } private static int intMaskRight(int n) { assert n <= 32; return n == 32 ? -1 : (1 << n) - 1; --- 135,145 ---- return field; } } } ! throw new InternalError("unresolved field " + reflectionField); } private static int intMaskRight(int n) { assert n <= 32; return n == 32 ? -1 : (1 << n) - 1;
*** 189,199 **** case InvalidateRecompile: return config.deoptActionMakeNotEntrant; case InvalidateStopCompiling: return config.deoptActionMakeNotCompilable; default: ! throw new JVMCIError("%s", action); } } public DeoptimizationAction convertDeoptAction(int action) { HotSpotVMConfig config = runtime.getConfig(); --- 188,198 ---- case InvalidateRecompile: return config.deoptActionMakeNotEntrant; case InvalidateStopCompiling: return config.deoptActionMakeNotCompilable; default: ! throw new InternalError(action.toString()); } } public DeoptimizationAction convertDeoptAction(int action) { HotSpotVMConfig config = runtime.getConfig();
*** 210,220 **** return DeoptimizationAction.InvalidateRecompile; } if (action == config.deoptActionMakeNotCompilable) { return DeoptimizationAction.InvalidateStopCompiling; } ! throw new JVMCIError("%d", action); } public int convertDeoptReason(DeoptimizationReason reason) { HotSpotVMConfig config = runtime.getConfig(); switch (reason) { --- 209,219 ---- return DeoptimizationAction.InvalidateRecompile; } if (action == config.deoptActionMakeNotCompilable) { return DeoptimizationAction.InvalidateStopCompiling; } ! throw new InternalError(String.valueOf(action)); } public int convertDeoptReason(DeoptimizationReason reason) { HotSpotVMConfig config = runtime.getConfig(); switch (reason) {
*** 249,259 **** case Aliasing: return config.deoptReasonAliasing; case TransferToInterpreter: return config.deoptReasonTransferToInterpreter; default: ! throw new JVMCIError("%s", reason); } } public DeoptimizationReason convertDeoptReason(int reason) { HotSpotVMConfig config = runtime.getConfig(); --- 248,258 ---- case Aliasing: return config.deoptReasonAliasing; case TransferToInterpreter: return config.deoptReasonTransferToInterpreter; default: ! throw new InternalError(reason.toString()); } } public DeoptimizationReason convertDeoptReason(int reason) { HotSpotVMConfig config = runtime.getConfig();
*** 303,313 **** return DeoptimizationReason.Aliasing; } if (reason == config.deoptReasonTransferToInterpreter) { return DeoptimizationReason.TransferToInterpreter; } ! throw new JVMCIError("%x", reason); } @Override public long getMemorySize(JavaConstant constant) { if (constant.getJavaKind() == JavaKind.Object) { --- 302,312 ---- return DeoptimizationReason.Aliasing; } if (reason == config.deoptReasonTransferToInterpreter) { return DeoptimizationReason.TransferToInterpreter; } ! throw new InternalError(String.format("%x", reason)); } @Override public long getMemorySize(JavaConstant constant) { if (constant.getJavaKind() == JavaKind.Object) {
< prev index next >