Skip to content

Commit f057e13

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2wasm] Add BoxedInt immutable array cache to support dart:convert.
https://github.com/dart-lang/sdk/blob/main/sdk/lib/_internal/wasm/lib/convert_patch.dart#L1110 Change-Id: I00fb812af9818c566e72360b5744699a50e3eb67 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412860 Commit-Queue: Nate Biggs <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
1 parent 7d7af3b commit f057e13

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/dart2wasm/lib/kernel_nodes.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ mixin KernelNodes {
428428
index.getTopLevelField('dart:_internal', 'i32ConstArray');
429429
late final Field i64ConstImmutableArrayCache =
430430
index.getTopLevelField('dart:_internal', 'i64ConstImmutableArray');
431+
late final Field boxedIntImmutableArrayCache =
432+
index.getTopLevelField('dart:_internal', 'boxedIntImmutableArray');
431433

432434
// Debugging
433435
late final Procedure printToConsole =
@@ -450,6 +452,7 @@ mixin KernelNodes {
450452
_makeElementType(coreTypes.stringClass): stringConstImmutableArrayCache,
451453
_makeElementType(wasmI8Class): i8ConstImmutableArrayCache,
452454
_makeElementType(wasmI64Class): i64ConstImmutableArrayCache,
455+
_makeElementType(boxedIntClass): boxedIntImmutableArrayCache,
453456
};
454457

455458
InterfaceType _makeElementType(Class c,

sdk/lib/_internal/wasm/lib/dynamic_module.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ final i8ConstImmutableArray = WasmArrayConstCache();
113113
final i32ConstArray = WasmArrayConstCache();
114114
@pragma('dyn-module:callable')
115115
final i64ConstImmutableArray = WasmArrayConstCache();
116+
@pragma('dyn-module:callable')
117+
final boxedIntImmutableArray = WasmArrayConstCache();
116118

117119
class WasmArrayConstCache {
118120
// Guaranteed by construction to contain only arrays with the same type.

0 commit comments

Comments
 (0)