Files
sdk/pkg/dart2wasm/test/ir_tests/deferred.constant.multi_module_use_module2.wat
T
Simon Binder 58f9d88fb2 [dart2wasm, standalone] Migrate String
This migrates the `String` implementation from using JS interop to
explicit host imports for the standalone target.

This moves a few helper methods shared between the JS and standalone
targets to `dart:_string_helper`. This also moves the embedder regexp
implementation to `dart:_string` to be able to access internals in some
string methods (similar to how the JS implementation special-cases
`JSSyntaxRegExp`).

This removes the final real use of JS-interop in the standalone target.
So, we can:

 - Remove internal JS helper libraries from the target.
 - Skip JS-interop transformations in the compiler.
 - Stop emitting a helper module and support script.

Because `js_interop` is imported in `dart:_wasm`, we can't remove the
library entirely. This replaces it with a stub to avoid compilation
errors, a proper removal is tracked in dartbug.com/63166.

Change-Id: Ide495c210c3a272438deebf8fe4f3f44ba314ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501960
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-20 00:22:27 -07:00

36 lines
1.1 KiB
WebAssembly Text Format

(module $module2
(type $#Top (struct
(field $field0 i32)))
(type $JSExternWrapper (sub $Object (struct
(field $field0 i32)
(field $field1 (mut i32))
(field $_externRef externref))))
(type $MyConstClass (sub final $Object (struct
(field $field0 i32)
(field $field1 (mut i32))
(field $b (ref $JSExternWrapper)))))
(type $Object (sub $#Top (struct
(field $field0 i32)
(field $field1 (mut i32)))))
(global $.h0-nonshared-const (import "" "h0-nonshared-const") (ref extern))
(table $module0.cross-module-funcs-0 (import "module0" "cross-module-funcs-0") 17 funcref)
(global $MyConstClass (ref $MyConstClass)
(i32.const 108)
(i32.const 0)
(i32.const 60)
(i32.const 0)
(global.get $.h0-nonshared-const)
(struct.new $JSExternWrapper)
(struct.new $MyConstClass))
(elem $module0.cross-module-funcs-0
(set 3 (ref.func $"modH0Use <noInline>")))
(func $"modH0Use <noInline>" (param $var0 i32) (result (ref $MyConstClass))
local.get $var0
if (result (ref $MyConstClass))
global.get $MyConstClass
else
i32.const 16
call_indirect (result (ref $MyConstClass))
end
)
)