• Manos Koukoutos's avatar
    [wasm-gc][turbofan] Speculative direct calls for call_ref · 5a7d7de9
    Manos Koukoutos authored
    Behind the --wasm-inlining flag, we introduce speculative direct calls
    as an alternative to invoking functions through references.
    In pseudocode, call_ref(func_ref, args...) reduces to
      if (func_ref == function_reference_at(expected_index)) {
        call_direct(expected_index, args...)
      } else call_ref(func_ref, args...)
    The introduced direct call can later get inlined in WasmInliningPhase.
    Currently, we always speculate that the reference is the function at
    index 0. Proper heuristics, based on liftoff runtime feedback, will come
    later.
    
    Bug: v8:12166, v8:7748
    Change-Id: Icd1319d3091b436e71906717fd8a2662bfbb8481
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162602
    Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
    Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#76884}
    5a7d7de9
inlining.js 10.5 KB