You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Cornwall (JIRA)" <ji...@apache.org> on 2007/12/11 01:42:42 UTC

[jira] Created: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

[pack200][classlib] Added code to support tableswitch/lookupswitch
------------------------------------------------------------------

                 Key: HARMONY-5289
                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
             Project: Harmony
          Issue Type: New Feature
          Components: Classlib
         Environment: All Pack200
            Reporter: Andrew Cornwall
            Priority: Minor


I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.


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


[jira] Commented: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Andrew Cornwall commented on HARMONY-5289:
------------------------------------------

Sian, I'm not sure how to retrieve the case_values using your code. I tried the obvious:

        int case_values[] = new int[case_count];
        System.out.println("Using case_count=" + case_count);
        for(int index=0; index < case_count; index++) {
            System.out.println("Using case_values[" + index + "]=" + case_values[index]);
            case_values[index] = operandManager.nextCaseValues();
        }

but with that I get two case_values of 0 with a 3-case tableswitch.


> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Updated: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Andrew Cornwall updated HARMONY-5289:
-------------------------------------

    Attachment: test.patch
                main.patch

Changes to source (main.patch) and tests (test.patch) to add support for lookupswitch/tableswitch.

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Commented: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Sian January commented on HARMONY-5289:
---------------------------------------

Andrew - with tableswitch I would expect there to be one case value - the initial one.  Then with lookupswitch I would expect case_count case values.  So using your test case (pasted below) I get one value of 97 in BcBands.bcCaseValue, which I think should be correct.  I noticed in your code above you're printing out the value before you actually assign it, so it would always be 0 in the println.  Can you swap lines 4 and 5 (above) around and see what happens?


Test case:

public class SimpleHelloWorld {
    public static void main(String[] args) {
        switch (args[0].charAt(0)) {
            case 'a': {
                System.out.println("A");
            }
            case 'b': {
                System.out.println("B");
            }
            case 'c': {
                System.out.println("C");
            }
            default: {
                System.out.println("Default");
            }
        }
    }
}

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Updated: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Sian January updated HARMONY-5289:
----------------------------------

    Attachment: BcBands.java.patch

I'm attaching a patch with the required fixes to BcBands to calculate case_values correctly, but this is for Andrew's benefit only, and is not ready to be committed yet because it changes BcBands.bcCaseValue from an int[][] to an int[], which causes compilation errors elsewhere.

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Commented: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Sian January commented on HARMONY-5289:
---------------------------------------

No problem :-)

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Closed: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Tim Ellison closed HARMONY-5289.
--------------------------------


Verified by Andrew.


> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Assigned: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Tim Ellison reassigned HARMONY-5289:
------------------------------------

    Assignee: Tim Ellison

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Commented: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Andrew Cornwall commented on HARMONY-5289:
------------------------------------------

Sigh. I'm an idiot. Yes, your code works properly. Sorry for the trouble.



> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Resolved: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Tim Ellison resolved HARMONY-5289.
----------------------------------

    Resolution: Fixed

Thanks Andrew.

Apologies for the delay applying your patch due to the code freeze and holidays.

Patch applied to PACK200 module at repo revision r608472.  Please check it was applied as you expected.


> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Updated: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

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

Sian January updated HARMONY-5289:
----------------------------------

    Attachment: BcBandsTest.java.patch

Also attached a patch to get BcBandsTest passing as we're reading different numbers of values from the bands now we understand tableswitch and lookupswitch better.

> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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


[jira] Commented: (HARMONY-5289) [pack200][classlib] Added code to support tableswitch/lookupswitch

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555676#action_12555676 ] 

Andrew Cornwall commented on HARMONY-5289:
------------------------------------------

Patch was applied correctly. Thanks!


> [pack200][classlib] Added code to support tableswitch/lookupswitch
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5289
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5289
>             Project: Harmony
>          Issue Type: New Feature
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: BcBands.java.patch, BcBandsTest.java.patch, main.patch, test.patch
>
>
> I have added some code to support the lookupswitch and tableswitch bytecodes. This code is currently turned off (there's a boolean in SwitchForm) but can be enabled as soon as BcBands is calculating case_values correctly.

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