Exemple #1
0
        static MethodHandleNatives()
        {
            registerNatives();
            COUNT_GWT = getConstant(Constants.GC_COUNT_GWT) != 0;

            // The JVM calls MethodHandleNatives.<clinit>.  Cascade the <clinit> calls as needed:
            MethodHandleImpl.InitStatics();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int HR_MASK = ((1 << REF_getField) | (1 << REF_putField) | (1 << REF_invokeVirtual) | (1 << REF_invokeSpecial) | (1 << REF_invokeInterface));
            int HR_MASK = ((1 << REF_getField) | (1 << REF_putField) | (1 << REF_invokeVirtual) | (1 << REF_invokeSpecial) | (1 << REF_invokeInterface));

            for (sbyte refKind = REF_NONE + 1; refKind < REF_LIMIT; refKind++)
            {
                assert(RefKindHasReceiver(refKind) == (((1 << refKind) & HR_MASK) != 0)) : refKind;
            }
            assert(VerifyConstants());
        }
Exemple #2
0
 static CallSite()
 {
     MethodHandleImpl.InitStatics();
     try
     {
         GET_TARGET = IMPL_LOOKUP.findVirtual(typeof(CallSite), "getTarget", MethodType.MethodType(typeof(MethodHandle)));
         THROW_UCS  = IMPL_LOOKUP.findStatic(typeof(CallSite), "uninitializedCallSite", MethodType.MethodType(typeof(Object), typeof(Object[])));
     }
     catch (ReflectiveOperationException e)
     {
         throw newInternalError(e);
     }
     try
     {
         TARGET_OFFSET = UNSAFE.objectFieldOffset(typeof(CallSite).getDeclaredField("target"));
     }
     catch (Exception ex)
     {
         throw new Error(ex);
     }
 }