コード例 #1
0
  /** >2do> that doesn't take care of class init yet */
  @MJI
  public int getType____Ljava_lang_Class_2(MJIEnv env, int objRef, FeatureExpr ctx) {
    ThreadInfo ti = env.getThreadInfo();
    FieldInfo fi = getFieldInfo(ctx, env, objRef);

    ClassInfo ci = fi.getTypeClassInfo();
    if (!ci.isRegistered()) {
      ci.registerClass(ctx, ti);
    }

    return ci.getClassObjectRef();
  }
コード例 #2
0
  static ClassInfo getDataRepresentationClassInfo(MJIEnv env, FeatureExpr ctx) {
    ThreadInfo ti = env.getThreadInfo();
    //    Instruction insn = ti.getPC().getValue();

    ClassInfo ci = ClassLoaderInfo.getSystemResolvedClassInfo(DataRepresentation);
    if (ci.pushRequiredClinits(ctx, ti)) {
      env.repeatInvocation();
      return null;
    }

    return ci;
  }
コード例 #3
0
  /** >2do> that doesn't take care of class init yet */
  public static int getType____Ljava_lang_Class_2(MJIEnv env, int objRef) {
    ThreadInfo ti = env.getThreadInfo();
    FieldInfo fi = getFieldInfo(env, objRef);

    try {
      ClassInfo ci = fi.getTypeClassInfo();
      if (!ci.isRegistered()) {
        ci.registerClass(ti);
      }

      return ci.getClassObjectRef();

    } catch (NoClassInfoException cx) {
      env.throwException("java.lang.NoClassDefFoundError", cx.getMessage());
      return MJIEnv.NULL;
    }
  }
コード例 #4
0
  static boolean isAvailable(MJIEnv env, FieldInfo fi, int fobjRef) {
    if (fi.isStatic()) {
      ClassInfo fci = fi.getClassInfo();
      if (fci.requiresClinitExecution(env.getThreadInfo())) {
        env.repeatInvocation();
        return false;
      }

    } else {
      if (fobjRef == MJIEnv.NULL) {
        env.throwException("java.lang.NullPointerException");
        return false;
      }
      // class had obviously been initialized, otherwise we won't have an instance of it
    }

    return true;
  }