You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Fursov (JIRA)" <ji...@apache.org> on 2007/04/16 09:24:15 UTC

[jira] Created: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

[drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
---------------------------------------------------------------------------------------

                 Key: HARMONY-3658
                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Mikhail Fursov


While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
For the test below:
public class Hello {
    public static void main(String[] args) {

        int x = 1;
        try {
            new Foo(x=0);
        } catch (Error e) {
            System.out.println(x);
        }
    }
}

class Foo {
    static {
        exception();
    }

    static void exception() {
        throw new RuntimeException();
    }

    Foo(int x) {
        System.out.println("FAILED!");
    }
}


RI and interpreter print '0'
while JET and OPT print '1'

    public static void main(String args[])
    {
        int i = 1;
    //    0    0:iconst_1        
    //    1    1:istore_1        
        try
        {
            new Foo(i = 0);
    //    2    2:new             #2   <Class Foo>
    //    3    5:dup             
    //    4    6:iconst_0        
    //    5    7:dup             
    //    6    8:istore_1        
    //    7    9:invokespecial   #3   <Method void Foo(int)>
    //    8   12:pop             
        }
    //*   9   13:goto            24
        catch(Error error)
    //*  10   16:astore_2        
        {
            System.out.println(i);
    //   11   17:getstatic       #5   <Field PrintStream System.out>
    //   12   20:iload_1         
    //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
        }
    //   14   24:return          
    }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov updated HARMONY-3658:
-------------------------------------

    Patch Info:   (was: [Patch Available])

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Patch Info: [Patch Available]

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff, static_init3.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Attachment: static_init.diff

the fix contains both JET and OPT fixes and regression test.

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Attachments: static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov reassigned HARMONY-3658:
----------------------------------------

    Assignee: Alexey Varlamov

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Attachment: static_init3.diff

static_init3.diff: em64t issue fixed.

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff, static_init3.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499552 ] 

Alexey Varlamov commented on HARMONY-3658:
------------------------------------------

Mikhail, the second patch crashes EHWA on JET and Eclipse startup become painfully slow in client mode

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495975 ] 

Alexey Varlamov commented on HARMONY-3658:
------------------------------------------

One more interesting thing, the patch stably hangs perf.SeveralThreads smoke test on SLES9@x64 with gc_gen but does not affect old gc_cc (on the same test).

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Patch Info: [Patch Available]

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Description: 
While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
For the test below:

public class Hello {
    public static void main(String[] args) {
        int x = 1;
        try {
            new Foo(x=0);
        } catch (Error e) {
            System.out.println(x);
        }
    }
}

class Foo {
    static {
        exception();
    }

    static void exception() {
        throw new RuntimeException();
    }

    Foo(int x) {
        System.out.println("FAILED!");
    }
}


RI and interpreter print '0'
while JET and OPT print '1'



Disassembly:

    public static void main(String args[])
    {
        int i = 1;
    //    0    0:iconst_1        
    //    1    1:istore_1        
        try
        {
            new Foo(i = 0);
    //    2    2:new             #2   <Class Foo>
    //    3    5:dup             
    //    4    6:iconst_0        
    //    5    7:dup             
    //    6    8:istore_1        
    //    7    9:invokespecial   #3   <Method void Foo(int)>
    //    8   12:pop             
        }
    //*   9   13:goto            24
        catch(Error error)
    //*  10   16:astore_2        
        {
            System.out.println(i);
    //   11   17:getstatic       #5   <Field PrintStream System.out>
    //   12   20:iload_1         
    //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
        }
    //   14   24:return          
    }


  was:
While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
For the test below:
public class Hello {
    public static void main(String[] args) {

        int x = 1;
        try {
            new Foo(x=0);
        } catch (Error e) {
            System.out.println(x);
        }
    }
}

class Foo {
    static {
        exception();
    }

    static void exception() {
        throw new RuntimeException();
    }

    Foo(int x) {
        System.out.println("FAILED!");
    }
}


RI and interpreter print '0'
while JET and OPT print '1'

    public static void main(String args[])
    {
        int i = 1;
    //    0    0:iconst_1        
    //    1    1:istore_1        
        try
        {
            new Foo(i = 0);
    //    2    2:new             #2   <Class Foo>
    //    3    5:dup             
    //    4    6:iconst_0        
    //    5    7:dup             
    //    6    8:istore_1        
    //    7    9:invokespecial   #3   <Method void Foo(int)>
    //    8   12:pop             
        }
    //*   9   13:goto            24
        catch(Error error)
    //*  10   16:astore_2        
        {
            System.out.println(i);
    //   11   17:getstatic       #5   <Field PrintStream System.out>
    //   12   20:iload_1         
    //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
        }
    //   14   24:return          
    }



> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499554 ] 

Alexey Varlamov commented on HARMONY-3658:
------------------------------------------

The above comment is for SLES9@x64, sorry.

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov updated HARMONY-3658:
-------------------------------------

    Attachment: gdb.txt

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov resolved HARMONY-3658.
--------------------------------------

    Resolution: Fixed

Applied at revision: 545153 regtest and latest fix.
Still there is incorrect order of class initialization and object allocation in OPT, added FIXME.


> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff, static_init3.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500388 ] 

Mikhail Fursov commented on HARMONY-3658:
-----------------------------------------

Alexey, I didn't check client mode startup performance yet, will do tomorrow

> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>            Assignee: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff, static_init3.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-3658:
------------------------------------

    Attachment: static_init2.diff

static_init2.diff - updated diff


> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff, static_init2.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495966 ] 

Alexey Varlamov commented on HARMONY-3658:
------------------------------------------

Mikhail, the patch hangs OPT on kernel tests on Linuxes, both 32/64. (Server mode passes ok)
To reproduce:
sh build.sh -DBUILD_CFG=debug kernel.test -Dtest.mode=opt -Dtest.case=java.lang.ClassHierarchyTest

It might be another problem though, Jitrino loops infinitely in hashvaluenumberer - I've attached typical backtraces.


> [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3658
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3658
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Mikhail Fursov
>         Assigned To: Alexey Varlamov
>         Attachments: gdb.txt, static_init.diff
>
>
> While working on lazy resolution support in JIT I found the problem that both JET and OPT process 'new' bytecode incorrectly:
> For the test below:
> public class Hello {
>     public static void main(String[] args) {
>         int x = 1;
>         try {
>             new Foo(x=0);
>         } catch (Error e) {
>             System.out.println(x);
>         }
>     }
> }
> class Foo {
>     static {
>         exception();
>     }
>     static void exception() {
>         throw new RuntimeException();
>     }
>     Foo(int x) {
>         System.out.println("FAILED!");
>     }
> }
> RI and interpreter print '0'
> while JET and OPT print '1'
> Disassembly:
>     public static void main(String args[])
>     {
>         int i = 1;
>     //    0    0:iconst_1        
>     //    1    1:istore_1        
>         try
>         {
>             new Foo(i = 0);
>     //    2    2:new             #2   <Class Foo>
>     //    3    5:dup             
>     //    4    6:iconst_0        
>     //    5    7:dup             
>     //    6    8:istore_1        
>     //    7    9:invokespecial   #3   <Method void Foo(int)>
>     //    8   12:pop             
>         }
>     //*   9   13:goto            24
>         catch(Error error)
>     //*  10   16:astore_2        
>         {
>             System.out.println(i);
>     //   11   17:getstatic       #5   <Field PrintStream System.out>
>     //   12   20:iload_1         
>     //   13   21:invokevirtual   #6   <Method void PrintStream.println(int)>
>         }
>     //   14   24:return          
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.