You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2007/10/04 14:01:50 UTC

[jira] Commented: (HARMONY-2679) [drlvm][jit][jet] Combination of ldc2_w and dup2 instructions works incorrectly

    [ https://issues.apache.org/jira/browse/HARMONY-2679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532397 ] 

Alexey Varlamov commented on HARMONY-2679:
------------------------------------------

Evaluation shows there is no specific on "wide" opcodes, simpler reproducer is:

    ldc 1.0f
    dup
    getstatic java/lang/System/err Ljava/io/PrintStream;
    dup_x1
    pop
    invokevirtual java/io/PrintStream/println(F)V
    getstatic java/lang/System/err Ljava/io/PrintStream;
    dup_x1
    pop
    invokevirtual java/io/PrintStream/println(F)V
    return

The reason is that in some circumstances (probably any) registers can be not saved before making a call and used spoiled afterwards.
There is a flag "m_surviveCalls" which is set for immediate values but may be not reset after assiging value to a register (or memory), which effectively disables spilling the register.

> [drlvm][jit][jet] Combination of ldc2_w and dup2 instructions works incorrectly
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2679
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2679
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows, Linux x86 (32 bit only)
>            Reporter: Vera Petrashkova
>            Priority: Minor
>         Attachments: dupTest.zip
>
>
> The following synthetic test shows incorrect behavior of  ldc2_w and dup2  Instructions
> on jitrino/jet:
> -------------dupTest.jj--------------------
> .class public dupTest
> .super java/lang/Object
> .method public static main([Ljava/lang/String;)V
>     .limit stack 44
>     .limit locals 22
>     ldc2_w 1.0
>     dup2
>     getstatic java/lang/System/err Ljava/io/PrintStream;
>     dup_x2
>     pop
>     invokevirtual java/io/PrintStream/println(D)V
>     getstatic java/lang/System/err Ljava/io/PrintStream;
>     dup_x2
>     pop
>     invokevirtual java/io/PrintStream/println(D)V
>     ldc2_w 1.0
>     ldc2_w 1.0
>     getstatic java/lang/System/err Ljava/io/PrintStream;
>     dup_x2
>     pop
>     invokevirtual java/io/PrintStream/println(D)V
>     getstatic java/lang/System/err Ljava/io/PrintStream;
>     dup_x2
>     pop
>     invokevirtual java/io/PrintStream/println(D)V
>     return
> .end method
> -------------------------
> To reproduce:
> - create dupTest class using jasmin.jar or use attached class file
>   java -jar jasmine.jar dupTest
> - run dupTest
> Output on Jitrino/JET:
> 1.0
> 5.304989477E-315
> 1.0
> 1.0
> Output on interpreter and Jitrino/OPT:
> 1.0
> 1.0
> 1.0
> 1.0

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