Hi John,

Thanks for your comments. Very helpful indeed.

I see remove_dead_region sprinkled in a number of node.cpp classes. That in 
turn makes a call to kill_dead_code. That answers that question. How the code 
became unreachable is a different question but one I'll leave for later.

FYI, when using integers it appears as if the code is eliminated where as if I 
use long instead, the loop appears to not be eliminated. I've not yet dumped 
the assembler and without direct evidence, it's speculating.

Again, thanks,
Kirk

On Dec 19, 2010, at 9:06 AM, John Rose wrote:

> On Dec 18, 2010, at 3:17 PM, Kirk wrote:
> 
>> I wasn't able to find anything that said, total is dead, get rid of it.. and 
>> then loop is empty, get rid of it. But, if it's not there.. I didn't miss 
>> anything.
> 
> The hotspot optimizer is designed so that dead code elimination happens when 
> a part of the sea-of-nodes graph becomes unreachable and is "garbage 
> collected".  So there's no "kill this code" step that will reliably show up 
> in the log.  The code's graph nodes just stop being reachable.
> 
>>> Given that 'total' is a dead value, you will end up with an empty loop.  
>>> The loop probably disappears also.  So your dead method will have an empty 
>>> body.  Perhaps it will deopt at the end of the loop, if the exit branch is 
>>> not taken until after compilation.
>>> 
>>>> 1%   com.kodewerk.mbm.DeadCode::deadMethod @ 12 (33 bytes)
>>> = compilation task 1, type = osr, osr entry point = bci:12
>> 
>> Out of curiosity, the first compile_id tag was for java/lang/String hashCode 
>> and it's id was 1. The inlining compile_id also started with an id of 1. Is 
>> this because two threads are at work? The code is single threaded.
> 
> For no particularly good reason, the OSR tasks are numbered separately from 
> the regular ones.  It's one of those deformities that is never quite annoying 
> enough to fix.
> 
> For using +PrintAssembly on Mac, try putting this on your $DYLD_LIBRARY_PATH:
>  http://kenai.com/projects/base-hsdis/downloads/download/hsdis-i386.dylib
> 
> I think it needs to be named "hsdis.so" or "hsdis.0.so".
> 
> -- John
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JVM Languages" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/jvm-languages?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to