• bmeurer's avatar
    [stubs] Improve code generation for ToBoolean. · 0abba435
    bmeurer authored
    Introduce a proper CodeStubAssembler::BranchIfToBooleanIsTrue helper
    method, that branches to if_true/if_false labels depending on whether
    the value that is passed would yield true or false when fed to
    ToBoolean. Use this helper to implement the bytecode handlers w/o having
    to materialize the temporary booleans and essentially branching twice.
    The CodeStubAssembler::BranchIfToBooleanIsTrue helper favors the most
    likely case of a Boolean constant now.
    
    Also migrate the ToBooleanStub to a ToBoolean TurboFan builtin, that
    also uses the helper method under the hood.
    
    Remove the now obsolete Oddball::to_boolean field.
    
    R=hpayer@chromium.org, rmcilroy@chromium.org, yangguo@chromium.org
    
    Review-Url: https://codereview.chromium.org/2151163002
    Cr-Commit-Position: refs/heads/master@{#37849}
    0abba435
code-stub-assembler.cc 112 KB