Le 18 déc. 2009 à 21:01, Patrick Wright a écrit :

>> Sorry to ask such a naive question, but why is it the responsibility
>> of the bytecode emitter to mark a call as "tail" ?
>> It seems fairly easy for HotSpot to decide whether a call is tail or not.
>> 
>> Does this mean that some language implementers would like to have
>> their calls unoptimized even when they could be ? The only reason I
>> can think of is to have full stack trace. However, in this case, I would
>> expect to just have a "-XX" flag to disable tailcall optimization when
>> one wishes to have full stack traces.
> 
> see http://blogs.sun.com/jrose/entry/tail_calls_in_the_vm, "hard"
> versus "soft" tail calls.

Thanks for the pointer.
If I understand correctly, tailcall information will be emitted by the compiler
for the sole purpose of being sure that HotSpot will actually perform the
optimization (and raise an exception if not).

While ensuring that the optimization is actually performed is very important,
it seems to be a novelty in the JVM: to the best of my knowledge, there is no
other way to guarantee that any optimization will actually occur.
Is this correct ?


Xavier Clerc

--

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