forked from dart-lang/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dart2wasm] Update typed list asUnmodifiableView methods
Getting unmodifiable view of a list via `UnmodifiableUint8ListView` (and other `...ListView` classes) is a bit indirect as the constructor runs a type test: @patch class UnmodifiableUint8ListView { @patch factory UnmodifiableUint8ListView(Uint8List list) { if (list is U8List) { return UnmodifiableU8List(list); } else { return UnmodifiableSlowU8List(list); } } } This updates `asUnmodifiableView` methods to return the right unmodifiable list type without a type test. I didn't check if this affects the final optimized code, but it doesn't hurt to generate good code straight away. Also removes dart2wasm-specific `immutable` method from `ByteDataBase` as the new `asUnmodifiableView` does the same thing. Change-Id: If28ff4e28f059cf915fe1422b6fe61456f9d6b5c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335464 Reviewed-by: Aske Simon Christensen <[email protected]> Commit-Queue: Ömer Ağacan <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters