harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3658) [drlvm][jit] Incorrect class resolution / initialization order in JET and OPT compilers
Date Mon, 16 Apr 2007 07:24:15 GMT
[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.


Mime
View raw message