Please, review the fix for:
  https://bugs.openjdk.java.net/browse/JDK-8013942


Open webrev:
http://cr.openjdk.java.net/~sspitsyn/webrevs/2014/hotspot/8013942-JVMTI-lobj.1


Summary:

  This is a Nightly Stabilization issue.

The problem is that the JVMTI GetLocalObject() function is hitting the assert
  as the type of the local at current bci is not T_OBJECT as expected.
It is because this local is alive only in a narrow scope of one condition in the method but current bci is out of this csope.

  A fragment from the target method:

    static Class<?> canonicalize(Class<?> t, int how) {
        Class<?> ct;                                 <== The local
        if (t == Object.class) {
            // no change, ever
        } else if (!t.isPrimitive()) {
            switch (how) {
                case UNWRAP:
                    ct = Wrapper.asPrimitiveType(t); <== Initialized here
                    if (ct != t) return ct;
                    break;
                case RAW_RETURN:
                case ERASE:
                    return Object.class;
            }
} else if (t == void.class) { <== The GetLocalObject() is called with bci in this block
            // no change, usually
            switch (how) {
                case RAW_RETURN:
                    return int.class;
                case WRAP:
                    return Void.class;
            }
        } else {
        . . .

The local 'ct' is only alive in the block of condition "if (!t.isPrimitive())".
  However, it is dead local in the next block.

The fix suggested in the webrev above is to use the oop_mask for the method's current bci.
  It tells when the local is dead in the scope of this bci.
  Return the JVMTI_ERROR_INVALID_SLOT error in such a case.

The fix also includes the tweeks which are necessary to enable the InterpreterOopMap.is_dead() function in the product mode as it was originally defined only under "#ifdef ENABLE_ZAP_DEAD_LOCALS".
  This makes the code in the oopMapCache.?pp a little bit more simple.


Testing:
  Running the failing tests: vm.mlvm.indy.func.jvmti
  In progress: nsk.jvmti, nsk.jdi, nsk.jdwp test runs on sparcv9 and amd64


Thanks,
Serguei

Reply via email to