• svenpanne's avatar
    Detect simple tail calls · 4b122b75
    svenpanne authored
    This CL contains the first steps towards tail call optimization:
    
      * Structurally detect tail calls during instruction selection,
        looking for special return/call combinations.
    
      * Added new architecture-specific instructions for tail calls which
        jump instead of call and take care of frame adjustment.
    
      * Moved some code around.
    
    Currently we restrict tail calls to callees which only use registers
    for arguments/return value and to call sites which are explicitly
    marked as being OK for tail calls. This excludes, among other things,
    call sites in sloppy JS functions and our IC machinery (both need in
    general to be able to access the caller's frame).
    
    All this is behind a flag --turbo-tail-calls, which is currently off
    by default, so it can easily be toggled.
    
    Review URL: https://codereview.chromium.org/1108563002
    
    Cr-Commit-Position: refs/heads/master@{#28150}
    4b122b75
linkage-impl.h 11.5 KB