Tracing in compiler / Tracing AOT compiled code (w/ patch)
----------------------------------------------------------

                 Key: JRUBY-1531
                 URL: http://jira.codehaus.org/browse/JRUBY-1531
             Project: JRuby
          Issue Type: Bug
            Reporter: Peter Brant
            Assignee: Thomas E Enebo
         Attachments: tracing.patch

(related to JRUBY-1286 and JRUBY-1475)

Attached is the first version of the compiler tracing patch.  If 
-Djruby.tracing.enabled=true, invokers get an additional MethodVisitor that 
adds c-call/c-return or call/return events to the generated code.  Along the 
same line, compiled methods get line events and class/end events.  If the 
property isn't set, the generated bytecode is the same as today.

For AOT compiled code, the same transformations are done at class load time 
with the addition that methods that use stack-based local variables are 
rewritten to use heap-based local variables.  

The online/JIT side of things should be pretty solid.  All tests pass with 
tracing enabled (or at least the ones that did before do).  The AOT side of 
things is more experimental and needs more discussion.  I'm not sure what the 
repercussions are of loading in Scripts via a custom classloader vs. the 
calling classloader as before.  The bytecode rewriting is a bit fragile 
inasmuch as it depends on internal compiler details (although I'm not sure much 
can be done about this).

It does work for me though (actually pretty cool to step into .class files...)

Also, tracing in the interpreter is still broken if jruby.tracing.enabled is 
not set.  IMO, either tracing should work out of the box with the interpreter 
or jruby.tracing.enabled=false should disable all events, not just some (i.e. 
c-call/c-return) like now.



-- 
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

Reply via email to