• Andreas Haas's avatar
    [platform][cleanup] Fix --enable-tracing · 61367a25
    Andreas Haas authored
    The flag --enable-tracing can be used to measure how much time is spent
    in a scope. In d8 this flag did not work properly for the following
    reasons:
    
    * The tracing file is not written when the JavaScript code calls quit().
    
    * The tracing file is not written when the JavaScript code throws an
    uncaught exception, except if the --throws flag is passed to d8.
    
    The reason for these two issues is that both call Shell::Exit(), which
    end d8 immediately without calling any destructors. In addition I moved
    in a recent CL the destruction of the platform after the destruction of
    the file handle for the tracing file. Thereby the tracing file did not
    get filled with content even destructors were executed.
    
    With this CL I also call the destructors of the platform and of the file
    handle in the Shell::Exit() function. For this I make Shell::Exit()
    platform independent and let it call the platform dependent
    Shell::OSExit() at the end.
    
    R=rmcilroy@chromium.org
    
    Change-Id: I14425b6a5c25b757211bc8b9959a9cc8bfa0602c
    Reviewed-on: https://chromium-review.googlesource.com/789038Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#49659}
    61367a25
d8-windows.cc 640 Bytes