i guess nowadays javac translates almost literally the source code
into bytecode, leaving the hard work for JIT

On Wed, Aug 26, 2009 at 7:29 AM, Christian
Catchpole<christ...@catchpole.net> wrote:
>
> of course it's need a return if it's NOT being JITted... im talking a
> load of crap tonight.. aload_0 f crap.. get it! :)
>
> On Aug 26, 8:09 pm, Christian Catchpole <christ...@catchpole.net>
> wrote:
>> yeah, don't take too much notice of that.  i noticed that if you
>> disassemble a "throw", it doesn't have a return. but the a=a does.
>> maybe its requirement of bytecode that a method that does return,
>> finishes with return byte code.  but its like Java strings being a
>> char array with a size.  there's no need to terminate it.  it cant run
>> off the end.
>>
>> On Aug 26, 7:53 pm, Fabrizio Giudici <fabrizio.giud...@tidalwave.it>
>> wrote:
>>
>>
>>
>> > Christian Catchpole wrote:
>> > > Compile this..  (any package you like, or no package at all)
>>
>> > > public class Rethrow {
>> > >     public static void unchecked(Throwable t) {
>> > >         t=t;
>> > >     }
>> > > }
>>
>> > > javap reports the byte code as..
>>
>> > > public static void unchecked(java.lang.Throwable);
>> > >   Code:
>> > >    Stack=1, Locals=1, Args_size=1
>> > >    0:   aload_0
>> > >    1:   astore_0
>> > >    2:   return
>>
>> > I'm surprised - I expected that the compiler would optimize out the
>> > useless operation and only output the return...
>>
>> > --
>> > Fabrizio Giudici - Java Architect, Project Manager
>> > Tidalwave s.a.s. - "We make Java work. Everywhere."
>> > weblogs.java.net/blog/fabriziogiudici -www.tidalwave.it/blog
>> > fabrizio.giud...@tidalwave.it - mobile: +39 348.150.6941
> >
>



-- 
http://mapsdev.blogspot.com/
Marcelo Takeshi Fukushima

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to