jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • RVM
  • RVM-409

Improve throwable elimination

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Compiler: Optimizing
  • Labels:
    None

Description

Currently we can eliminate the throwable constructed in the following form:

int foo() {
int x = 0;
try { throw new Throwable(); } catch (Throwable t) { x = 2; }
}

but we can't handle the following:

static boolean z;
int foo() {
int x = 0;
try {
if (z) { throw new Throwable(); } else { throw new Throwable(); } }
} catch (Throwable t) { x = 2; } }
}

this is because there are two possible sets of the exception object and therefore no clear dominator. We should do better analysis to remove the redundant throwable construction.

Issue Links

is superceded by

Improvement - An improvement or enhancement to an existing feature or task. RVM-416 Explicit model of Exception Object dataflow

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Open - The issue is open and ready for the assignee to start work on it.
relates to

Bug - A problem which impairs or prevents the functions of the product. RVM-410 Problem with changes to stack walk

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
supercedes

Improvement - An improvement or enhancement to an existing feature or task. RVM-408 Simple elimination of stack traces

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Ian Rogers added a comment - 19/Mar/08 4:35 PM

r14060 allows elimination of the Throwable in the situation above. As of r14060 we eliminate set caught exception instructions if there are no get caught exception instructions that can read them. It would be better if we could eliminate the sets if there are no reachable (dominated) gets. It's not safe to remove set->gets with moves unless there are no PEIs that could also do the set ie:

try {
call ... // some PEI
throw new Throwable();
} catch (Throwable t) {
... = t; // use of t
}

we can't make it:

try {
call ... // some PEI
x = new Throwable();
} catch (Throwable t) {
t = x;
... = t; // use of t
}

as the PEI call could also have been setting t.

We could extend the current scheme to remember when sets are eliminated from a method, when compiling that method in the future we could avoid generating the sets. This may get around the problem that the simple optimization is likely to not optimize the code when we do a lot of inlining and have a number of unrelated try-catch blocks.

Show
Ian Rogers added a comment - 19/Mar/08 4:35 PM r14060 allows elimination of the Throwable in the situation above. As of r14060 we eliminate set caught exception instructions if there are no get caught exception instructions that can read them. It would be better if we could eliminate the sets if there are no reachable (dominated) gets. It's not safe to remove set->gets with moves unless there are no PEIs that could also do the set ie: try { call ... // some PEI throw new Throwable(); } catch (Throwable t) { ... = t; // use of t } we can't make it: try { call ... // some PEI x = new Throwable(); } catch (Throwable t) { t = x; ... = t; // use of t } as the PEI call could also have been setting t. We could extend the current scheme to remember when sets are eliminated from a method, when compiling that method in the future we could avoid generating the sets. This may get around the problem that the simple optimization is likely to not optimize the code when we do a lot of inlining and have a number of unrelated try-catch blocks.
Hide
Permalink
Ian Rogers added a comment - 09/May/08 10:41 AM

Superceded by issue RVM-416.

Show
Ian Rogers added a comment - 09/May/08 10:41 AM Superceded by issue RVM-416.
Hide
Permalink
David Grove added a comment - 26/Aug/08 8:52 AM

reopening to change fix-for version.

Show
David Grove added a comment - 26/Aug/08 8:52 AM reopening to change fix-for version.

People

  • Assignee:
    Unassigned
    Reporter:
    Ian Rogers
Vote (0)
Watch (0)

Dates

  • Created:
    18/Mar/08 6:49 PM
    Updated:
    26/Aug/08 8:52 AM
    Resolved:
    26/Aug/08 8:52 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.