[wasm] Enter V8 before running foreground work [v8/v8 : main]

1 view
Skip to first unread message

Clemens Backes (Gerrit)

unread,
Oct 15, 2025, 11:40:39 AM (11 days ago) Oct 15
to Jakob Kummerow, V8 LUCI CQ, AyeAye, Toon Verwaest, v8-re...@googlegroups.com, was...@google.com
Attention needed from Toon Verwaest

Clemens Backes added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Clemens Backes . resolved

Toon, I don't know exactly what I'm doing here, so please check if this is a reasonable fix.
+Jakob for a second pair of eyes.

Open in Gerrit

Related details

Attention is currently required from:
  • Toon Verwaest
Submit Requirements:
  • requirement 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
Gerrit-Change-Number: 7046058
Gerrit-PatchSet: 1
Gerrit-Owner: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 15:40:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Toon Verwaest (Gerrit)

unread,
Oct 16, 2025, 5:02:36 AM (10 days ago) Oct 16
to Clemens Backes, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
Attention needed from Clemens Backes

Toon Verwaest added 1 comment

File src/wasm/module-compiler.cc
Line 2405, Patchset 2 (Latest): EnterV8InternalScope<HandleScope, false> v8_scope{
Toon Verwaest . unresolved

This is basically `EnterV8NoScriptScope` (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api-inl.h;l=322;drc=9d6f972e353f541f4f3261fa971d20fa61d839bd;bpv=1;bpt=1). You probably don't want this given that you're explicitly mentioning that user code could run?

What about a regular `EnterV8Scope`?

Open in Gerrit

Related details

Attention is currently required from:
  • Clemens Backes
Submit Requirements:
    • requirement 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 2
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-Attention: Clemens Backes <clem...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Oct 2025 09:02:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Clemens Backes (Gerrit)

    unread,
    Oct 16, 2025, 5:30:31 AM (10 days ago) Oct 16
    to Jakob Kummerow, V8 LUCI CQ, AyeAye, Toon Verwaest, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Toon Verwaest

    Clemens Backes added 1 comment

    File src/wasm/module-compiler.cc
    Line 2405, Patchset 2 (Latest): EnterV8InternalScope<HandleScope, false> v8_scope{
    Toon Verwaest . unresolved

    This is basically `EnterV8NoScriptScope` (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api-inl.h;l=322;drc=9d6f972e353f541f4f3261fa971d20fa61d839bd;bpv=1;bpt=1). You probably don't want this given that you're explicitly mentioning that user code could run?

    What about a regular `EnterV8Scope`?

    Clemens Backes

    Yes, we need to run user code.
    `EnterV8Scope` is what I used in PS1, and it fails one debugging test. I could fix it by having a `MicrotasksScope` plus an `EnterV8Scope`. Would that be better than the `EnterV8InternalScope`?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Toon Verwaest
    Submit Requirements:
    • requirement 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 2
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Oct 2025 09:30:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Clemens Backes (Gerrit)

    unread,
    Oct 16, 2025, 5:32:00 AM (10 days ago) Oct 16
    to Jakob Kummerow, V8 LUCI CQ, AyeAye, Toon Verwaest, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Toon Verwaest

    Clemens Backes added 1 comment

    File src/wasm/module-compiler.cc
    Line 2405, Patchset 2: EnterV8InternalScope<HandleScope, false> v8_scope{
    Toon Verwaest . unresolved

    This is basically `EnterV8NoScriptScope` (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api-inl.h;l=322;drc=9d6f972e353f541f4f3261fa971d20fa61d839bd;bpv=1;bpt=1). You probably don't want this given that you're explicitly mentioning that user code could run?

    What about a regular `EnterV8Scope`?

    Clemens Backes

    Yes, we need to run user code.
    `EnterV8Scope` is what I used in PS1, and it fails one debugging test. I could fix it by having a `MicrotasksScope` plus an `EnterV8Scope`. Would that be better than the `EnterV8InternalScope`?

    Clemens Backes

    I did that in PS3 now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Toon Verwaest
    Submit Requirements:
    • requirement 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-Attention: Toon Verwaest <verw...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Oct 2025 09:31:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
    Comment-In-Reply-To: Clemens Backes <clem...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Toon Verwaest (Gerrit)

    unread,
    Oct 17, 2025, 4:23:42 AM (9 days ago) Oct 17
    to Clemens Backes, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Clemens Backes

    Toon Verwaest voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Clemens Backes
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-Attention: Clemens Backes <clem...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Oct 2025 08:23:37 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Toon Verwaest (Gerrit)

    unread,
    Oct 17, 2025, 4:25:20 AM (9 days ago) Oct 17
    to Clemens Backes, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Clemens Backes

    Toon Verwaest added 1 comment

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Toon Verwaest . resolved

    Not executing things in a microtask scope is a bit weird. It would make sense to figure out the expected semantics. Not having a microtaskscope (or not executing them) means that async code won't make progress.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Clemens Backes
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-Attention: Clemens Backes <clem...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Oct 2025 08:25:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leszek Swirski (Gerrit)

    unread,
    Oct 17, 2025, 4:41:29 AM (9 days ago) Oct 17
    to Clemens Backes, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Clemens Backes

    Leszek Swirski added 1 comment

    File src/wasm/module-compiler.cc
    Line 2403, Patchset 3 (Latest): // Enter V8 before running synchronous work (which might involve callbacks
    // to user code).
    MicrotasksScope microtasks_scope{
    reinterpret_cast<v8::Isolate*>(job->isolate_),
    job->native_context_->microtask_queue(),
    v8::MicrotasksScope::kDoNotRunMicrotasks};
    EnterV8Scope<> v8_scope{job->isolate_,
    Utils::ToLocal(job->native_context_),
    RuntimeCallCounterId::kWasmAsyncCompilation};
    Leszek Swirski . unresolved

    do all foreground jobs need this? if not, could it be moved into the RunForeground method of each job that does need it?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Clemens Backes
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-Attention: Clemens Backes <clem...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Oct 2025 08:41:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leszek Swirski (Gerrit)

    unread,
    Oct 17, 2025, 5:29:32 AM (9 days ago) Oct 17
    to Clemens Backes, Andreas Haas, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Clemens Backes

    Leszek Swirski added 1 comment

    Patchset-level comments
    Leszek Swirski . resolved

    Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Clemens Backes
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Andreas Haas <ah...@google.com>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-Attention: Clemens Backes <clem...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Oct 2025 09:29:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Clemens Backes (Gerrit)

    unread,
    Oct 17, 2025, 6:20:25 AM (9 days ago) Oct 17
    to Andreas Haas, Leszek Swirski, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Leszek Swirski

    Clemens Backes added 1 comment

    Patchset-level comments
    Leszek Swirski . resolved

    Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

    Clemens Backes

    Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Leszek Swirski
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
    Gerrit-Change-Number: 7046058
    Gerrit-PatchSet: 3
    Gerrit-Owner: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
    Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
    Gerrit-CC: Andreas Haas <ah...@google.com>
    Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
    Gerrit-CC: Leszek Swirski <les...@chromium.org>
    Gerrit-Attention: Leszek Swirski <les...@chromium.org>
    Gerrit-Comment-Date: Fri, 17 Oct 2025 10:20:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Clemens Backes (Gerrit)

    unread,
    Oct 24, 2025, 10:47:59 AM (2 days ago) Oct 24
    to Andreas Haas, Leszek Swirski, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
    Attention needed from Leszek Swirski

    Clemens Backes added 3 comments

    Patchset-level comments
    Leszek Swirski . resolved

    Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

    Clemens Backes

    Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

    Clemens Backes

    I discussed this with Andreas. While implementing this properly via two promises is probably the better fix, it's also a lot more involved, and potentially introduces security risks by storing intermediate data on the JS heap.

    For now I opened a tracking bug and put it on our backlog: https://crbug.com/454827127

    In the meantime I'll to ahead and land this CL.

    File src/wasm/module-compiler.cc
    Line 2405, Patchset 2: EnterV8InternalScope<HandleScope, false> v8_scope{
    Toon Verwaest . resolved

    This is basically `EnterV8NoScriptScope` (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api-inl.h;l=322;drc=9d6f972e353f541f4f3261fa971d20fa61d839bd;bpv=1;bpt=1). You probably don't want this given that you're explicitly mentioning that user code could run?

    What about a regular `EnterV8Scope`?

    Clemens Backes

    Yes, we need to run user code.
    `EnterV8Scope` is what I used in PS1, and it fails one debugging test. I could fix it by having a `MicrotasksScope` plus an `EnterV8Scope`. Would that be better than the `EnterV8InternalScope`?

    Clemens Backes

    I did that in PS3 now.

    Clemens Backes

    Done

    Line 2403, Patchset 3: // Enter V8 before running synchronous work (which might involve callbacks

    // to user code).
    MicrotasksScope microtasks_scope{
    reinterpret_cast<v8::Isolate*>(job->isolate_),
    job->native_context_->microtask_queue(),
    v8::MicrotasksScope::kDoNotRunMicrotasks};
    EnterV8Scope<> v8_scope{job->isolate_,
    Utils::ToLocal(job->native_context_),
    RuntimeCallCounterId::kWasmAsyncCompilation};
    Leszek Swirski . resolved

    do all foreground jobs need this? if not, could it be moved into the RunForeground method of each job that does need it?

    Clemens Backes

    We only have two foreground tasks (after removing the third one in https://crrev.com/c/6973469): `Fail` and `FinishCompilation`. Both need this, so I think we should leave it here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Leszek Swirski
    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: I27863a33e3505e3f73ea7b9e353b53267893a79c
      Gerrit-Change-Number: 7046058
      Gerrit-PatchSet: 4
      Gerrit-Owner: Clemens Backes <clem...@chromium.org>
      Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
      Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
      Gerrit-CC: Andreas Haas <ah...@google.com>
      Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
      Gerrit-CC: Leszek Swirski <les...@chromium.org>
      Gerrit-Attention: Leszek Swirski <les...@chromium.org>
      Gerrit-Comment-Date: Fri, 24 Oct 2025 14:47:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Toon Verwaest <verw...@chromium.org>
      Comment-In-Reply-To: Clemens Backes <clem...@chromium.org>
      Comment-In-Reply-To: Leszek Swirski <les...@chromium.org>
      satisfied_requirement
      open
      diffy

      Leszek Swirski (Gerrit)

      unread,
      Oct 24, 2025, 10:52:10 AM (2 days ago) Oct 24
      to Clemens Backes, Andreas Haas, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
      Attention needed from Clemens Backes

      Leszek Swirski added 1 comment

      Patchset-level comments
      File-level comment, Patchset 3:
      Leszek Swirski . unresolved

      Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

      Clemens Backes

      Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

      Clemens Backes

      I discussed this with Andreas. While implementing this properly via two promises is probably the better fix, it's also a lot more involved, and potentially introduces security risks by storing intermediate data on the JS heap.

      For now I opened a tracking bug and put it on our backlog: https://crbug.com/454827127

      In the meantime I'll to ahead and land this CL.

      Leszek Swirski

      Entering V8 scopes in tasks that didn't previously expect it is also a potential security risk though...

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clemens Backes
      Submit Requirements:
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
        Gerrit-Change-Number: 7046058
        Gerrit-PatchSet: 4
        Gerrit-Owner: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
        Gerrit-CC: Andreas Haas <ah...@google.com>
        Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
        Gerrit-CC: Leszek Swirski <les...@chromium.org>
        Gerrit-Attention: Clemens Backes <clem...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Oct 2025 14:52:03 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Clemens Backes (Gerrit)

        unread,
        Oct 24, 2025, 11:05:53 AM (2 days ago) Oct 24
        to Andreas Haas, Leszek Swirski, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
        Attention needed from Leszek Swirski

        Clemens Backes added 1 comment

        Patchset-level comments
        Leszek Swirski . unresolved

        Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

        Clemens Backes

        Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

        Clemens Backes

        I discussed this with Andreas. While implementing this properly via two promises is probably the better fix, it's also a lot more involved, and potentially introduces security risks by storing intermediate data on the JS heap.

        For now I opened a tracking bug and put it on our backlog: https://crbug.com/454827127

        In the meantime I'll to ahead and land this CL.

        Leszek Swirski

        Entering V8 scopes in tasks that didn't previously expect it is also a potential security risk though...

        Clemens Backes

        Hm. So you are voting for *not* landing this and instead plan to work on the backlog issue ASAP?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Leszek Swirski
        Submit Requirements:
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
        Gerrit-Change-Number: 7046058
        Gerrit-PatchSet: 4
        Gerrit-Owner: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
        Gerrit-CC: Andreas Haas <ah...@google.com>
        Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
        Gerrit-CC: Leszek Swirski <les...@chromium.org>
        Gerrit-Attention: Leszek Swirski <les...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Oct 2025 15:05:47 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Leszek Swirski (Gerrit)

        unread,
        Oct 24, 2025, 11:07:50 AM (2 days ago) Oct 24
        to Clemens Backes, Andreas Haas, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
        Attention needed from Clemens Backes

        Leszek Swirski added 1 comment

        Patchset-level comments
        Leszek Swirski . unresolved

        Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

        Clemens Backes

        Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

        Clemens Backes

        I discussed this with Andreas. While implementing this properly via two promises is probably the better fix, it's also a lot more involved, and potentially introduces security risks by storing intermediate data on the JS heap.

        For now I opened a tracking bug and put it on our backlog: https://crbug.com/454827127

        In the meantime I'll to ahead and land this CL.

        Leszek Swirski

        Entering V8 scopes in tasks that didn't previously expect it is also a potential security risk though...

        Clemens Backes

        Hm. So you are voting for *not* landing this and instead plan to work on the backlog issue ASAP?

        Leszek Swirski

        I'm tempted to suggest this yes, because this is kind of a weird task and things like kDoNotRunMicrotasks make it weirder

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Clemens Backes
        Submit Requirements:
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • 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: I27863a33e3505e3f73ea7b9e353b53267893a79c
        Gerrit-Change-Number: 7046058
        Gerrit-PatchSet: 4
        Gerrit-Owner: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
        Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
        Gerrit-CC: Andreas Haas <ah...@google.com>
        Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
        Gerrit-CC: Leszek Swirski <les...@chromium.org>
        Gerrit-Attention: Clemens Backes <clem...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Oct 2025 15:07:46 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Clemens Backes (Gerrit)

        unread,
        Oct 24, 2025, 11:08:44 AM (2 days ago) Oct 24
        to Andreas Haas, Leszek Swirski, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com
        Attention needed from Leszek Swirski

        Clemens Backes added 1 comment

        Patchset-level comments
        File-level comment, Patchset 3:
        Leszek Swirski . resolved

        Andreas and I spoke about this, it looks like our implementation is using custom tasks and pseudo promise-like resolution because of a misunderstanding when reading the Wasm spec, which specifies real (separate) promises for the module compilation and instantiation. If we used real promises here, and instantiation was just a reaction to the module compilation promise resolving, then we wouldn't need a custom task here, it would just execute in a normal (micro)task.

        Clemens Backes

        Let's talk about this next week then when I am back in the office. I don't understand the microtasks and promises business enough to understand the difference in observable behaviour between the different options.

        Clemens Backes

        I discussed this with Andreas. While implementing this properly via two promises is probably the better fix, it's also a lot more involved, and potentially introduces security risks by storing intermediate data on the JS heap.

        For now I opened a tracking bug and put it on our backlog: https://crbug.com/454827127

        In the meantime I'll to ahead and land this CL.

        Leszek Swirski

        Entering V8 scopes in tasks that didn't previously expect it is also a potential security risk though...

        Clemens Backes

        Hm. So you are voting for *not* landing this and instead plan to work on the backlog issue ASAP?

        Leszek Swirski

        I'm tempted to suggest this yes, because this is kind of a weird task and things like kDoNotRunMicrotasks make it weirder

        Clemens Backes

        Ack, abandoning this then and blocking the DCHECK failure on the refactoring task.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Leszek Swirski
        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: I27863a33e3505e3f73ea7b9e353b53267893a79c
          Gerrit-Change-Number: 7046058
          Gerrit-PatchSet: 4
          Gerrit-Owner: Clemens Backes <clem...@chromium.org>
          Gerrit-Reviewer: Clemens Backes <clem...@chromium.org>
          Gerrit-Reviewer: Toon Verwaest <verw...@chromium.org>
          Gerrit-CC: Andreas Haas <ah...@google.com>
          Gerrit-CC: Jakob Kummerow <jkum...@chromium.org>
          Gerrit-CC: Leszek Swirski <les...@chromium.org>
          Gerrit-Attention: Leszek Swirski <les...@chromium.org>
          Gerrit-Comment-Date: Fri, 24 Oct 2025 15:08:39 +0000
          satisfied_requirement
          open
          diffy

          Clemens Backes (Gerrit)

          unread,
          Oct 24, 2025, 11:09:03 AM (2 days ago) Oct 24
          to Andreas Haas, Leszek Swirski, Toon Verwaest, Jakob Kummerow, V8 LUCI CQ, AyeAye, v8-re...@googlegroups.com, was...@google.com

          Clemens Backes abandoned this change

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: abandon
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages