Jul 3, 2019

[Go][Java]&[Clang] tail call optimization status in 2019

Go:
Not going to happen in Go2 as well.
https://github.com/golang/go/issues/22624

Java:
JVM doesn’t support Tail Call Optimization.
https://softwareengineering.stackexchange.com/a/272086
https://www.youtube.com/watch?v=2y5Pv4yN0b0&t=1h02m18s

Clang:
Tail call optimization, callee reusing the stack of the caller, is currently supported on x86/x86-64, PowerPC, and WebAssembly.
It is performed on x86/x86-64 and PowerPC if:
  • Caller and callee have the calling convention fastcc, cc 10 (GHC calling convention) or cc 11 (HiPE calling convention). 
  • The call is a tail call - in tail position (ret immediately follows call and ret uses value of call or is void). 
  • Option -tailcallopt is enabled. 
  • Platform-specific constraints are met. 

x86/x86-64 constraints: 
  • No variable argument lists are used. 
  • On x86-64 when generating GOT/PIC code only module-local calls (visibility = hidden or protected) are supported.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.