Bug 373355 - Allow a compiler option to enable optimizations to occur after pass-1 generation
Summary: Allow a compiler option to enable optimizations to occur after pass-1 generation
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-06 07:44 EST by Jeff Douglas CLA
Modified: 2017-02-23 14:06 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Douglas CLA 2012-03-06 07:44:09 EST
This defect is to hold ideas for possible optimizations. We need a compiler option, that the user can select if desired, to allow post pass-1 optimizations to occur. That way the generated java can be modified to make it more readable. 

Please add any suggestions as comments in this defect.
Comment 1 Jeff Douglas CLA 2012-03-06 07:45:40 EST
Will asked to have his comments added:

I noticed the code generated for a simple literal number is fairly complex. For
example, I have a library with these 2 functions:

    function test()
        testFunction(3, "Hey");
    end

    function testFunction(intVal int in, stringVal string in) returns (int)
        // do something
        return (0);
    end


The generated code is:

    public void test() {
        int eze$Temp1;
        eze$Temp1 = (int)(short)((short) 3);
        testFunction(eze$Temp1, "Hey");
    }
    public int testFunction(Integer intVal, String stringVal) {
        return (int)(short)((short) 0);
    }

eze$Temp1 seems unnecessary and "3" could be passed directly (like "Hey" is
getting passed) instead. Also note that "return (0)" is getting expanded more
than necessary.