< prev index next >

test/hotspot/jtreg/runtime/LocalLong/LocalLongHelper.java

Print this page




  59 
  60     private static void setupReflectionStatics() throws Throwable {
  61         Class<?> liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
  62         primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot");
  63 
  64         getLocals = liveStackFrameClass.getDeclaredMethod("getLocals");
  65         getLocals.setAccessible(true);
  66 
  67         longValue = primitiveValueClass.getDeclaredMethod("longValue");
  68         longValue.setAccessible(true);
  69 
  70         Class<?> stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo");
  71         memberName = stackFrameInfoClass.getDeclaredField("memberName");
  72         memberName.setAccessible(true);
  73         offset = stackFrameInfoClass.getDeclaredField("bci");
  74         offset.setAccessible(true);
  75         getMethodType = Class.forName("java.lang.invoke.MemberName").getDeclaredMethod("getMethodType");
  76         getMethodType.setAccessible(true);
  77 
  78         Class<?> extendedOptionClass = Class.forName("java.lang.StackWalker$ExtendedOption");
  79         Method ewsNI = StackWalker.class.getDeclaredMethod("newInstance", Set.class, extendedOptionClass);
  80         ewsNI.setAccessible(true);
  81         Field f = extendedOptionClass.getDeclaredField("LOCALS_AND_OPERANDS");
  82         f.setAccessible(true);
  83         Object localsAndOperandsOption = f.get(null);
  84 
  85         primitiveSize = primitiveValueClass.getDeclaredMethod("size");
  86         primitiveSize.setAccessible(true);
  87         sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption);
  88     }
  89 }


  59 
  60     private static void setupReflectionStatics() throws Throwable {
  61         Class<?> liveStackFrameClass = Class.forName("java.lang.LiveStackFrame");
  62         primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot");
  63 
  64         getLocals = liveStackFrameClass.getDeclaredMethod("getLocals");
  65         getLocals.setAccessible(true);
  66 
  67         longValue = primitiveValueClass.getDeclaredMethod("longValue");
  68         longValue.setAccessible(true);
  69 
  70         Class<?> stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo");
  71         memberName = stackFrameInfoClass.getDeclaredField("memberName");
  72         memberName.setAccessible(true);
  73         offset = stackFrameInfoClass.getDeclaredField("bci");
  74         offset.setAccessible(true);
  75         getMethodType = Class.forName("java.lang.invoke.MemberName").getDeclaredMethod("getMethodType");
  76         getMethodType.setAccessible(true);
  77 
  78         Class<?> extendedOptionClass = Class.forName("java.lang.StackWalker$ExtendedOption");
  79         Method ewsNI = StackWalker.class.getDeclaredMethod("newInstance", Set.class, extendedOptionClass, ContinuationScope.class);
  80         ewsNI.setAccessible(true);
  81         Field f = extendedOptionClass.getDeclaredField("LOCALS_AND_OPERANDS");
  82         f.setAccessible(true);
  83         Object localsAndOperandsOption = f.get(null);
  84 
  85         primitiveSize = primitiveValueClass.getDeclaredMethod("size");
  86         primitiveSize.setAccessible(true);
  87         sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption, null);
  88     }
  89 }
< prev index next >