This bypasses the hoisting of record elements in constant record literals.
The created let variables would otherwise interfere with the constant
evaluation.
Closes#49915
Change-Id: Ia70387a0f0c435373dc5fcf5cdd526104db8f394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258363
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Changes the representation of closures to include a vtable with entry
points for the various ways in which the function can be called.
For each combination of type parameter count and positional parameter
count, the names of named parameters occurring together with that
combination are partitioned into clusters such that any combination of
names that occurs together is contained within a single cluster.
Each combination of type parameter count and positional parameter
count gets a vtable layout for signatures without named parameters,
plus one for each cluster of parameter names belonging to the
combination.
Each vtable layout will have an entry for each number of positional
arguments from 0 up to the maximum number for the signature, followed
by an entry for each (non-empty) combination of argument names from
its cluster that occurs in a function call in the program.
This layout scheme is consistent with function subtyping in the sense
that if signature B is a subtype of signature A, then the Wasm struct
for the vtable layout corresponding to B is a subtype of the Wasm struct for the vtable layout corresponding to A, i.e. the fields in the layout
for A is a prefix of the fields in the layout for B.
Change-Id: I36569be5251cc0cca4373b08c48d37c214478c3c
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256822
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Instead of using top types for the parameters and return of the
implementation function for a function expression or local function,
use precise types and generate a wrapper function with top types that
casts the parameters and calls the implementation function.
This unifies the wrapper function generation with tear-offs, setting
the stage for the upcoming generalization to support type parameters
and optional parameters.
The change also brings some benefits in its own right:
- Arguments to closures are converted once instead of at every use
- Direct calls to local functions avoid the conversion of arguments
Also add source location to closure function names and generally avoid
parentheses in function names, as they are confusing in stack traces.
Change-Id: If83073bb2e2dd17554ffa03fa2596e79d730fb67
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256665
Reviewed-by: Joshua Litt <joshualitt@google.com>
* Merge ClassTable and SharedClassTable back together;
* Simplify handling of multiple arrays growing in sync;
* Refactor how reload deals with ClassTable.
The last change is the most important because it makes it
much easier to reason about the code. We move away from
copying bits and pieces of the class table and shared
class table into reload contexts.
Having two class table fields in the isolate group makes
it easier to reason about. One field contains program
class table (one modified by kernel loader and accessed
by various program structure cid lookups) and heap
walk class table (used by GC visitors). Normally these
two fields point to the same class table, but during
hot reload we temporary split them apart: original
class table is kept as a heap walk class table, while
program class table is replaced by a clone and updated
by reload.
If reload succeeds we drop original class table and
set program class table as heap walk one.
If reload fails we drop the program class table and
restore original one from heap walk table.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-linux-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-rollback-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try
Change-Id: I8b66259fcc474dea7dd2af063e4772df99be06c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258361
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
While the work is incomplete (see the TODOs), this fixes an exception
that I saw this morning and is, I believe, a step in the right direction.
Change-Id: I6adc0e0df4ea9b64ea0c5d1dcd42a078d30c4a9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258507
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
These methods create new sets, whose implementation must match the
target platform. Thus, they should be specialized for the VM and
dart2wasm instead of being implemented in the shared mixin.
Change-Id: I102a45686e3eb373463f2fcdf84ee861e202ecc0
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258362
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Rename `_CompactLinkedHashSet` to `_InternalLinkedHashSet` and
`_CompactImmutableLinkedHashSet` to `_InternalImmutableLinkedHashSet`
to make the names consistent with the corresponding `Map` class names
and to distinguish them from the non-VM-specific hash maps and sets,
which are generally named starting with `_Compact`.
Tested: ci
Change-Id: Ic1ebc44ba8beba34ceab382a4edddc6624fe3fb3
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258002
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This should prevent new code using old syntax.
Change-Id: I0620369a34b3838fb4555f5264c93bccf92acc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256213
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This gets rid of some occurrences of `dynamic` and makes the
associated implicit conversions explicit.
Based on https://dart-review.googlesource.com/c/sdk/+/237582
Tested: ci
Change-Id: I7faeffab395c916800b29ea7e56bd3f7d15aac54
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258242
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Ensure that instructions that may throw and also have unknown side effects still load from all places.
Also since this optimization concerns AOT only, instructions that don't deopt but may throw(and don't have unknown side effects), still only load escaping stores.
Follow-up to 88fc8b65d2.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/49657
Change-Id: I55b1347badcd74b4c334bb7b37571e91ebb310a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Visitor support is underway.
Change-Id: If4e54515650d21a202635973e2ce63b686bb98f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I270c6fa43f53cda0816dfb63f2379302c2cfda0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258322
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
The fragment emitter already tries to skip the call to `addRules` if the
ruleset is empty, but this occurs too early. The ruleset encoder strips
tautologies like `T <: T` and `InterfaceType <: Object`, but this occurs
after the empty check.
This CL removes the preprocessing from the encoder and instead performs
checks when entries are added to the ruleset, fixing the issue.
Change-Id: I62f937e0ff6abac12973f82b2c89d8ea6f3162b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258040
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
I believe that this is a change we had wanted to make but that I forgot
about until after I'd committed the earlier CL. If that's not the case,
please let me know.
Change-Id: Ida7c70f8b6f5c7e8c2369fd7b709c68ce4322ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>