• Benedikt Meurer's avatar
    [turbofan] Strength reduce JSResolvePromise to JSFulfillPromise. · 98aaeed6
    Benedikt Meurer authored
    We can strength-reduce JSResolvePromise(p,v) to JSFulfillPromise(p,v)
    if the v is known to be a primitive. This not only avoids the dynamic
    checks for v inside JSResolvePromise, but also removes the need to
    have a frame state, as the JSFulfillPromise operation cannot call
    back into arbitrary JavaScript, and thus cannot deoptimize lazily.
    
    This triggers for example for async functions where the return value
    is known (to TurboFan) to be a primitive value.
    
    Bug: v8:7253
    Change-Id: I4698d6026e0632ab3e2fef6c7f4aaacf6c2a508c
    Reviewed-on: https://chromium-review.googlesource.com/c/1288449
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#56758}
    98aaeed6
js-typed-lowering.h 3.91 KB