• Benedikt Meurer's avatar
    [turbofan] Properly optimize calls to promise extras. · 13ca9a0f
    Benedikt Meurer authored
    Add TurboFan inlining support for the following V8 Extras:
    
     - v8.createPromise
     - v8.rejectPromise
     - v8.resolvePromise
    
    These are used by the streams implementation in Chrome currently, and
    were previously not inlined into TurboFan, although TurboFan already
    had all the necessary functionality (namely the JSCreatePromise,
    JSRejectPromise and JSResolvePromise operators). We might eventually
    want to use these functions in Node core as well (at least short-term
    for Node 10), to replace the C++ internal API functions with the same
    name that are currently being used by parts of Node core.
    
    For this to work, the rejectPromise and resolvePromise builtins had
    to be moved back to CSA, as for JavaScript builtins we still have the
    policy that the optimizing compiler must not inline them. But that's
    straight-forward since the CSA has all the necessary functionality
    available anyways.
    
    Bug: v8:7253
    Change-Id: I39ab015c379956cd58ace866e17f8ec23b2257b2
    Reviewed-on: https://chromium-review.googlesource.com/924146Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#51332}
    13ca9a0f
test-extra.js 3.81 KB