[L] Change in dart/sdk[main]: [dart2wasm] Use M / M<id> for module names

0 views
Skip to first unread message

Nate Biggs (Gerrit)

unread,
Jun 22, 2026, 12:14:09 PM (2 days ago) Jun 22
to Martin Kustermann, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Martin Kustermann

Nate Biggs voted and added 3 comments

Votes added by Nate Biggs

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Nate Biggs . resolved

Thanks!

File pkg/dart2wasm/test/record_use_test.dart
Line 79, Patchset 5 (Latest): final id = unit == 'M' ? 0 : int.parse(unit.substring(1));
Nate Biggs . unresolved

Can we use `'${moduleNameToId(unit) + 1}'` here?

File tests/web/wasm/source_map_simple_lib.dart
Line 138, Patchset 5 (Latest): final moduleId = moduleIdString == 'M'
Nate Biggs . unresolved

Ditto use `moduleNameToId`

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 5
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Comment-Date: Mon, 22 Jun 2026 16:14:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Jun 23, 2026, 3:54:20 AM (20 hours ago) Jun 23
to Nate Biggs, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org

Martin Kustermann voted and added 3 comments

Votes added by Martin Kustermann

Commit-Queue+2

3 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Martin Kustermann . resolved

Thanks, Nate!

File pkg/dart2wasm/test/record_use_test.dart
Line 79, Patchset 5: final id = unit == 'M' ? 0 : int.parse(unit.substring(1));
Nate Biggs . resolved

Can we use `'${moduleNameToId(unit) + 1}'` here?

Martin Kustermann

Done

File tests/web/wasm/source_map_simple_lib.dart
Line 138, Patchset 5: final moduleId = moduleIdString == 'M'
Nate Biggs . resolved

Ditto use `moduleNameToId`

Martin Kustermann

Done

Open in Gerrit

Related details

Attention set is empty
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 8
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 07:54:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nate Biggs <nate...@google.com>
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Jun 23, 2026, 4:32:10 AM (19 hours ago) Jun 23
to Nate Biggs, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org

Martin Kustermann voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 9
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 08:32:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Jun 23, 2026, 6:54:50 AM (17 hours ago) Jun 23
to Nate Biggs, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Nate Biggs

Martin Kustermann added 1 comment

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Martin Kustermann . resolved

PTAL, it lost the +1 bit after addressing comments & rebasing

Open in Gerrit

Related details

Attention is currently required from:
  • Nate Biggs
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 10
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Attention: Nate Biggs <nate...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 10:54:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nate Biggs (Gerrit)

unread,
Jun 23, 2026, 11:09:32 AM (13 hours ago) Jun 23
to Martin Kustermann, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Martin Kustermann

Nate Biggs voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 10
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 15:09:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Jun 23, 2026, 1:59:50 PM (10 hours ago) Jun 23
to Nate Biggs, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart2wasm-t...@google.com, rev...@dartlang.org

Martin Kustermann voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
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: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 10
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 17:59:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jun 23, 2026, 2:00:20 PM (10 hours ago) Jun 23
to Martin Kustermann, Nate Biggs, dart2wasm-t...@google.com, rev...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change

Change information

Commit message:
[dart2wasm] Use M / M<id> for module names

The module names can appear in stack traces (**). In order to make
stack trace parsing safe and allow recognizing the module name in
stack trace frames we are limited by the characters we can use.

At the bare minimum we should use url-safe characters instead of
what we do now. But the names aren't so important, because
a) it's one char in a wasm module
b) deferred modules only import main module (never other
deferred modules)

So whether we can save an extra 1-3 bytes in the name isn't so
important. We only really care about the main module's
import name, as deferred modules use that.

This CL switches us to use
* `M` (main module)
* `M<id>` (deferred modules)
naming convention

We no longer distinguish `--minify` from `--no-minify`.

=> Easy to see module id by looking at a name
=> Easy to parse

(**) Wasm runtimes that don't know where the wasm module bytes
come from (i.e. no known uri / file name) will fallback to
show module names in stack traces.
Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Commit-Queue: Martin Kustermann <kuste...@google.com>
Reviewed-by: Nate Biggs <nate...@google.com>
Files:
  • M pkg/dart2wasm/lib/modules.dart
  • M pkg/dart2wasm/lib/util.dart
  • M pkg/dart2wasm/test/ir_tests/always_throws.wat
  • M pkg/dart2wasm/test/ir_tests/constant_string_ops.wat
  • M pkg/dart2wasm/test/ir_tests/constructor.wat
  • M pkg/dart2wasm/test/ir_tests/covariance_check.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.multi_module_use.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.multi_module_use_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.multi_module_use_module2.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.type_use.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.type_use_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.constant_module2.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained.devirtualized.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained.devirtualized_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module2.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module3.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module4.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module5.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module6.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module7.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module8.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.fine_grained_module9.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.init_at_startup.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.init_at_startup_module1.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.type_checks.wat
  • M pkg/dart2wasm/test/ir_tests/deferred.type_checks_module1.wat
  • M pkg/dart2wasm/test/ir_tests/dispatch_table_reuse.wat
  • M pkg/dart2wasm/test/ir_tests/dispatch_table_reuse_module1.wat
  • M pkg/dart2wasm/test/ir_tests/dyn_closure.wat
  • M pkg/dart2wasm/test/ir_tests/dyn_closure_function_apply.wat
  • M pkg/dart2wasm/test/ir_tests/dyn_closure_function_apply_named.wat
  • M pkg/dart2wasm/test/ir_tests/dynamic_call.wat
  • M pkg/dart2wasm/test/ir_tests/external_effect.wat
  • M pkg/dart2wasm/test/ir_tests/globals.wat
  • M pkg/dart2wasm/test/ir_tests/hello.wat
  • M pkg/dart2wasm/test/ir_tests/import_name.wat
  • M pkg/dart2wasm/test/ir_tests/import_name_module1.wat
  • M pkg/dart2wasm/test/ir_tests/interop.bool.wat
  • M pkg/dart2wasm/test/ir_tests/interop.double.wat
  • M pkg/dart2wasm/test/ir_tests/interop.int.wat
  • M pkg/dart2wasm/test/ir_tests/interop.num.wat
  • M pkg/dart2wasm/test/ir_tests/interop.string.wat
  • M pkg/dart2wasm/test/ir_tests/js_inline.wat
  • M pkg/dart2wasm/test/ir_tests/math_min_max.wat
  • M pkg/dart2wasm/test/ir_tests/memory_use.wat
  • M pkg/dart2wasm/test/ir_tests/pure_function.wat
  • M pkg/dart2wasm/test/ir_tests/standalone.wat
  • M pkg/dart2wasm/test/ir_tests/try_blocks.wat
  • M pkg/dart2wasm/test/ir_tests/type_brand.wat
  • M pkg/dart2wasm/test/ir_tests/type_nobrand.wat
  • M pkg/dart2wasm/test/ir_tests/wasm_function_from_function.wat
  • M pkg/dart2wasm/test/record_use_test.dart
  • M tests/web/wasm/source_map_simple_lib.dart
  • M tests/web/wasm/source_map_simple_optimized_deferred_test.dart
  • M tests/web/wasm/source_map_simple_optimized_test.dart
  • M tests/web/wasm/source_map_simple_test.dart
Change size: L
Delta: 60 files changed, 246 insertions(+), 245 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Nate Biggs
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Id89d2a8f4a0150156f4c59e0feba0cd5af36ab57
Gerrit-Change-Number: 514840
Gerrit-PatchSet: 11
Gerrit-Owner: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages