aspose file tools
The moose likes Java in General and the fly likes stack inspection and tail call optimisation in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "stack inspection and tail call optimisation in java" Watch "stack inspection and tail call optimisation in java" New topic
Author

stack inspection and tail call optimisation in java

vaibhav vishal
Greenhorn

Joined: Nov 13, 2011
Posts: 10
Tail recursion optimisations are not implemented in java till now.
I read that because of its sophisticated stack inspection its not possible to implement this optimization.

can anybody tell why and how stack inspection mechanism in java prevents the above mentioned optimization???

Also is this anyhow related to the Sandbox model i.e. if stack inspection is a new and improved security model for java??
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

If you're asking us to comment on something that you read, you could at least post a link to it. Otherwise you're just asking us to speculate about rumours. Which can be fun, but it's really a waste of time if you were interested in useful comments. So: link?
vaibhav vishal
Greenhorn

Joined: Nov 13, 2011
Posts: 10
Paul Clapham wrote:If you're asking us to comment on something that you read, you could at least post a link to it. Otherwise you're just asking us to speculate about rumours. Which can be fun, but it's really a waste of time if you were interested in useful comments. So: link?



Here are the links where this topic was discussed :
http://stackoverflow.com/questions/3616483/why-does-the-jvm-still-not-support-tail-call-optimization
answer by Alex Miller


http://stackoverflow.com/questions/105834/does-the-jvm-prevent-tail-call-optimizations
answer by Michael Myers

http://www.frihost.com/forums/vt-127886.html
by gcca

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4726340
The way Java 2 security works, you need stack frames to keep track of protection domains. You cannot eliminate frames that cross protection domains unless you change how that works.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: stack inspection and tail call optimisation in java
 
Similar Threads
Tail Calls vs memoization
Recursion vs Nested loops.
java weakness
Discussion on recursion, stack overflows, & compiler optimization for tail recurssion
what is the multiprimitive approach in java?