[wasm interpreter] Call wasm function directly in CallRef [v8/v8 : main]

3 views
Skip to first unread message

王忠齐 (Gerrit)

unread,
Dec 8, 2025, 9:25:08 AM12/8/25
to Paolo Severini, Daniel Lehmann, v8-re...@googlegroups.com, was...@google.com
Attention needed from Paolo Severini

王忠齐 added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
王忠齐 . resolved

Please help to review this CL.

Open in Gerrit

Related details

Attention is currently required from:
  • Paolo Severini
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
Gerrit-Change-Number: 7190209
Gerrit-PatchSet: 6
Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
Gerrit-Comment-Date: Mon, 08 Dec 2025 14:25:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Daniel Lehmann (Gerrit)

unread,
Dec 8, 2025, 9:57:10 AM12/8/25
to 王忠齐, Paolo Severini, v8-re...@googlegroups.com, was...@google.com
Attention needed from Paolo Severini and 王忠齐

Daniel Lehmann voted and added 1 comment

Votes added by Daniel Lehmann

Code-Review+1

1 comment

Patchset-level comments
Daniel Lehmann . resolved

Rubber stamping interpreter-only change, I'll let Paolo comment on the actual review.

Open in Gerrit

Related details

Attention is currently required from:
  • Paolo Severini
  • 王忠齐
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
Gerrit-Change-Number: 7190209
Gerrit-PatchSet: 6
Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
Gerrit-Attention: 王忠齐 <wzq225...@gmail.com>
Gerrit-Comment-Date: Mon, 08 Dec 2025 14:57:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Paolo Severini (Gerrit)

unread,
Dec 9, 2025, 10:00:26 AM12/9/25
to 王忠齐, V8 LUCI CQ, Daniel Lehmann, v8-re...@googlegroups.com, was...@google.com
Attention needed from 王忠齐

Paolo Severini added 4 comments

Patchset-level comments
Paolo Severini . resolved

Looks very good to me, with two comments.

File src/wasm/interpreter/wasm-interpreter-runtime.cc
Line 1926, Patchset 6 (Latest): DirectHandle<WasmFuncRef> wasm_func_ref = Cast<WasmFuncRef>(func_ref);
Tagged<WasmInternalFunction> internal = wasm_func_ref->internal(isolate_);
DirectHandle<Object> object_implicit_arg{internal->implicit_arg(), isolate_};
Paolo Severini . resolved

Thanks! This simplify the logic a lot!

Line 2291, Patchset 6 (Latest):ExternalCallResult WasmInterpreterRuntime::CallExternalWasmFunction(
Paolo Severini . unresolved

This is all good but maybe just the function name is confusing because we do not always call an external Wasm function, we might also call a function in the same instance.

File test/mjsunit/mjsunit.status
Line 893, Patchset 6 (Parent): 'wasm/nan-constant': [SKIP],
Paolo Severini . unresolved

This test contains the directive:
```
%WasmTierUpFunction(wasm.main);
```
which cannot work with the interpreter, so it will still fail, I believe, even though for a different reason.

Open in Gerrit

Related details

Attention is currently required from:
  • 王忠齐
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
    Gerrit-Change-Number: 7190209
    Gerrit-PatchSet: 6
    Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
    Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
    Gerrit-Attention: 王忠齐 <wzq225...@gmail.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 15:00:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    王忠齐 (Gerrit)

    unread,
    Dec 9, 2025, 12:03:05 PM12/9/25
    to V8 LUCI CQ, Paolo Severini, Daniel Lehmann, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Daniel Lehmann and Paolo Severini

    王忠齐 added 2 comments

    File src/wasm/interpreter/wasm-interpreter-runtime.cc
    Line 2291, Patchset 6:ExternalCallResult WasmInterpreterRuntime::CallExternalWasmFunction(
    Paolo Severini . resolved

    This is all good but maybe just the function name is confusing because we do not always call an external Wasm function, we might also call a function in the same instance.

    王忠齐

    Currently only CallRef may call into this function with the same instance. And I have see a TODO mentioned that we can call directly when the current wasm instance is same with instance in the wasm FuncRef. So I planned fix the return_call_ref in wasm-spec-test by this way. After it, a DCHECK will be add into CallExternalWasmFunction to keep the wasm function is external. Maybe I can add a TODO in ExecuteCallRef before I do it in my next CL.

    File test/mjsunit/mjsunit.status
    Line 893, Patchset 6 (Parent): 'wasm/nan-constant': [SKIP],
    Paolo Severini . resolved

    This test contains the directive:
    ```
    %WasmTierUpFunction(wasm.main);
    ```
    which cannot work with the interpreter, so it will still fail, I believe, even though for a different reason.

    王忠齐

    Thanks, add this test case into "Tests using %WasmTierUpFunction()" is a good choice.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Lehmann
    • Paolo Severini
    Submit Requirements:
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Gerrit-Change-Number: 7190209
      Gerrit-PatchSet: 7
      Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
      Gerrit-Comment-Date: Tue, 09 Dec 2025 17:02:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Paolo Severini <paol...@microsoft.com>
      unsatisfied_requirement
      open
      diffy

      Daniel Lehmann (Gerrit)

      unread,
      Dec 9, 2025, 2:43:18 PM12/9/25
      to 王忠齐, V8 LUCI CQ, Paolo Severini, v8-re...@googlegroups.com, was...@google.com
      Attention needed from Paolo Severini and 王忠齐

      Daniel Lehmann voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Paolo Severini
      • 王忠齐
      Submit Requirements:
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Gerrit-Change-Number: 7190209
      Gerrit-PatchSet: 7
      Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Comment-Date: Tue, 09 Dec 2025 19:43:13 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      open
      diffy

      Paolo Severini (Gerrit)

      unread,
      Dec 9, 2025, 4:32:31 PM12/9/25
      to 王忠齐, Daniel Lehmann, V8 LUCI CQ, v8-re...@googlegroups.com, was...@google.com
      Attention needed from 王忠齐

      Paolo Severini voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • 王忠齐
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Gerrit-Change-Number: 7190209
      Gerrit-PatchSet: 7
      Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Comment-Date: Tue, 09 Dec 2025 21:32:27 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Paolo Severini (Gerrit)

      unread,
      Dec 9, 2025, 4:32:40 PM12/9/25
      to 王忠齐, Daniel Lehmann, V8 LUCI CQ, v8-re...@googlegroups.com, was...@google.com
      Attention needed from 王忠齐

      Paolo Severini voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • 王忠齐
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Gerrit-Change-Number: 7190209
      Gerrit-PatchSet: 7
      Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
      Gerrit-Attention: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Comment-Date: Tue, 09 Dec 2025 21:32:36 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      V8 LUCI CQ (Gerrit)

      unread,
      Dec 9, 2025, 4:34:35 PM12/9/25
      to 王忠齐, Paolo Severini, Daniel Lehmann, v8-re...@googlegroups.com, was...@google.com

      V8 LUCI CQ submitted the change

      Change information

      Commit message:
      [wasm interpreter] Call wasm function directly in CallRef

      To pass the test case in nan-constant.js, we cannt't call a wasm func
      ref by its JSFunction entry. Because the has f32 nan bitset been changed
      after we call into JSFunction.
      Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Commit-Queue: Paolo Severini <paol...@microsoft.com>
      Reviewed-by: Daniel Lehmann <dleh...@chromium.org>
      Reviewed-by: Paolo Severini <paol...@microsoft.com>
      Cr-Commit-Position: refs/heads/main@{#104215}
      Files:
      • M src/wasm/interpreter/wasm-interpreter-runtime.cc
      • M src/wasm/interpreter/wasm-interpreter-runtime.h
      • M test/mjsunit/mjsunit.status
      Change size: L
      Delta: 3 files changed, 133 insertions(+), 150 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Paolo Severini, +1 by Daniel Lehmann
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Id381bbc336c84b78c870c89f7504480c897ebf9b
      Gerrit-Change-Number: 7190209
      Gerrit-PatchSet: 8
      Gerrit-Owner: 王忠齐 <wzq225...@gmail.com>
      Gerrit-Reviewer: Daniel Lehmann <dleh...@chromium.org>
      Gerrit-Reviewer: Paolo Severini <paol...@microsoft.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages