-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable] [dart2wasm] Fix partial instantiation constants
Partial instantiation constants are closures. Those closures have vtables with all entries needed for the closure representation corresponding to the instantiated closure. The entries of those vtables have to either call the corresponding method of the generic closure, or are unreachable dummy entries. Dummy entries can be required due to clustering callees/callers together where a particular target doesn't support the name combination. The case that was incorrect is if the particular name combination did not get clustered with anything for the generic closure representation. Issue #56372 TEST=web/wasm/regress_56372_test Bug: #56372 Change-Id: I7a219237519c39d982b89ce272f33fb4d90cd173 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/380100 Cherry-pick-request: #56440 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380120 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
- Loading branch information
1 parent
475c337
commit c12bc56
Showing
4 changed files
with
68 additions
and
27 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
void main() { | ||
final funs = <String Function({Object? shared})>[ | ||
foo, | ||
bar, | ||
]; | ||
|
||
final one = int.parse('1'); | ||
final barS = funs[one] as String Function({Object? barSpecific}); | ||
if (barS(barSpecific: 1) != 'bar(null, 1)') { | ||
throw 'failed: ${barS(barSpecific: 1)}'; | ||
} | ||
} | ||
|
||
String foo<T>({Object? shared, Object? fooSpecific}) => | ||
'foo<$T>($shared, $fooSpecific)'; | ||
|
||
String bar({Object? shared, Object? barSpecific}) => | ||
'bar($shared, $barSpecific)'; |