while loops and other protected constructs may require synthetic methods in the
compiler
----------------------------------------------------------------------------------------
Key: JRUBY-1395
URL: http://jira.codehaus.org/browse/JRUBY-1395
Project: JRuby
Issue Type: Bug
Components: Compiler
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Priority: Blocker
Fix For: JRuby 1.1.0
Because Java clears the stack when entering a try/catch block, any protected
constructs during Ruby compilation must occur in their own stack frames if
there's stack state to be maintained. For example, the following code:
{noformat}
foo(while false; end)
{noformat}
Should pass nil to foo; instead it raises a verification error, because the
while loop itself is protected (catches jumps and localjumperrors) and results
in part of the foo method call setup getting wiped off the stack.
We must examine all cases where try/catch is being emitted in the compiler and
move those instances to synthetic methods if they occur where stack state must
be maintained. NOTE: If there's no stack to be maintained, we do not need to
generate synthetic methods. This could be a future optimization for
rescue/ensure occurring when there's an empty stack.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email