harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bu qi cheng" <buqi.ch...@gmail.com>
Subject Re: Enable the MACRO _DEBUG_CHECK_NULL_
Date Mon, 17 Nov 2008 03:21:28 GMT
Hi Mikhail:

      I can not find there is magic for the monitorEnter monitorExit. A test
case is done like following:

public class Btest5710 {

    Object obj;
    int j = 0;
    public static void main(String [] args) {
        (new Btest5710()).test();
    }
    public void test() {
     int i;
        System.err.println("Start Btest5710 test...");
        try {
            for (i = 0; i < 10000000; i++) {
             sync();
            }
            System.err.println("FAILED: NullPointerException was expected");
            System.exit(-99);
        } catch (NullPointerException e) {
            System.err.println("PASSED: " + e);
        } catch (Throwable e) {
            System.err.println("Unexpected exception was thrown:");
            e.printStackTrace();
            System.err.println("FAILED");
            System.exit(-99);
        }
    }
    void sync() {
     int i;
 //chknull
 for (i = 0; i < 10; i++) {
     j++;
     if (j == 90000000) {
              synchronized (obj) {
                obj = new Object();
              }
            }
 }
    }
}

Command  is like following:

$ ../harmony/working_vm/build/windows_x86_msvc_debug/deploy/jdk/jre/bin/java
-Xem:client -XX:jit.p.filter=Btest5710. -XX:jit.p.arg.log=ct,irdump,info
Btest5710
Same bug will happen and we see no magic code is generated.  SD2 code for
sync() is generated also, and we can see that the chknull is still not work,
same as the monenter.


Regards!

Buqi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message