< prev index next >

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

Print this page

        

@@ -34,11 +34,10 @@
 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;

@@ -101,22 +100,22 @@
         try {
             Field field = reflectionClass.getDeclaredField("slot");
             field.setAccessible(true);
             return field;
         } catch (NoSuchFieldException | SecurityException e) {
-            throw new JVMCIError(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 JVMCIError(e);
+            throw new InternalError(e);
         }
     }
 
     public ResolvedJavaField lookupJavaField(Field reflectionField) {
         Class<?> fieldHolder = reflectionField.getDeclaringClass();

@@ -136,11 +135,11 @@
                     return field;
                 }
             }
         }
 
-        throw new JVMCIError("unresolved field %s", reflectionField);
+        throw new InternalError("unresolved field " + reflectionField);
     }
 
     private static int intMaskRight(int n) {
         assert n <= 32;
         return n == 32 ? -1 : (1 << n) - 1;

@@ -189,11 +188,11 @@
             case InvalidateRecompile:
                 return config.deoptActionMakeNotEntrant;
             case InvalidateStopCompiling:
                 return config.deoptActionMakeNotCompilable;
             default:
-                throw new JVMCIError("%s", action);
+                throw new InternalError(action.toString());
         }
     }
 
     public DeoptimizationAction convertDeoptAction(int action) {
         HotSpotVMConfig config = runtime.getConfig();

@@ -210,11 +209,11 @@
             return DeoptimizationAction.InvalidateRecompile;
         }
         if (action == config.deoptActionMakeNotCompilable) {
             return DeoptimizationAction.InvalidateStopCompiling;
         }
-        throw new JVMCIError("%d", action);
+        throw new InternalError(String.valueOf(action));
     }
 
     public int convertDeoptReason(DeoptimizationReason reason) {
         HotSpotVMConfig config = runtime.getConfig();
         switch (reason) {

@@ -249,11 +248,11 @@
             case Aliasing:
                 return config.deoptReasonAliasing;
             case TransferToInterpreter:
                 return config.deoptReasonTransferToInterpreter;
             default:
-                throw new JVMCIError("%s", reason);
+                throw new InternalError(reason.toString());
         }
     }
 
     public DeoptimizationReason convertDeoptReason(int reason) {
         HotSpotVMConfig config = runtime.getConfig();

@@ -303,11 +302,11 @@
             return DeoptimizationReason.Aliasing;
         }
         if (reason == config.deoptReasonTransferToInterpreter) {
             return DeoptimizationReason.TransferToInterpreter;
         }
-        throw new JVMCIError("%x", reason);
+        throw new InternalError(String.format("%x", reason));
     }
 
     @Override
     public long getMemorySize(JavaConstant constant) {
         if (constant.getJavaKind() == JavaKind.Object) {
< prev index next >