• Benedikt Meurer's avatar
    [async-generators] Add fast-path to skip "then" lookup in AsyncGeneratorResolve. · cf080aeb
    Benedikt Meurer authored
    This extends the Promise#then protector to also guard the intrinsic
    %ObjectPrototype%, making it usable for fast-path logic in the
    AsyncGeneratorResolve operation, where we can skip the "then" lookup
    on the iteratorResult in that case. We also add a corresponding fast-
    path to the ResolvePromise builtin itself, which avoids the second
    "then" lookup on the async iterator side.
    
    This reduces execution time of the fibonacci-async-es2017-native test
    from 298.16ms to 280.55ms, which corresponds to an improvement of ~6%
    in this case.
    
    This is a rebased reland of
    
      https://chromium-review.googlesource.com/967203
    
    which landed earlier, but had to be reverted as part of the mega-revert
    that was necessary to fix the async_hooks breakage in Node 10.
    
    Bug: v8:7253
    Change-Id: Id9dd1ddc4a8285d64e92cd2030f3168a12e4b509
    Reviewed-on: https://chromium-review.googlesource.com/1130523
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54352}
    cf080aeb
builtins-promise-gen.cc 92.3 KB