Revert "[vm,dart2bytecode,modular_aot] Variable-length closure objects"

This reverts commit 88496ba1c3.

Reason for revert: crashes on arm64c

Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
>  - delayed type arguments;
>  - instantiator type arguments;
>  - function type arguments;
>  - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.
>
> TEST=ci
> Issue: https://github.com/dart-lang/sdk/issues/61572
> Issue: https://github.com/dart-lang/sdk/issues/61635
>
> Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>

Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I94c88f8922f6ea49251e942ba791fee714911e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494261
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov
2026-04-09 14:12:09 -07:00
committed by Commit Queue
parent 9fee4af302
commit 0dfaa16dc7
88 changed files with 1396 additions and 2797 deletions
+2 -18
View File
@@ -47,7 +47,7 @@ which reside in different sections such as libraries, classes, members, code, et
```
type BytecodeFile {
UInt32 magic = 0x44424333; // 'DBC3'
UInt32 formatVersion = 2;
UInt32 formatVersion = 1;
// Descriptors of the sections below.
// Each section has a fixed index in the descriptors array.
@@ -816,14 +816,6 @@ type ConstantDeferredLibraryPrefix extends ConstantPoolEntry {
PackedObject enclosingLibrary;
PackedObject targetLibrary;
}
// Occupies 2 entries in the constant pool
type ConstantAllocateClosure extends ConstantPoolEntry {
Byte tag = 18;
UInt closureIndex;
UInt numElements;
UInt flags = (hasDelayedTypeArguments, hasInstantiatorTypeArguments, hasFunctionTypeArguments);
}
```
### Exceptions table
@@ -1431,15 +1423,7 @@ SP[0] = SP[-1] <op> SP[0] ? true : false
#### AllocateClosure D
Allocate closure object described by ConstantAllocateClosure in ConstantPool[D].
#### LoadClosureElement D
Load element [D] from closure SP[0] and push it onto the stack.
#### StoreClosureElement D
Store object SP[0] into the element [D] of closure SP[-1].
Allocate closure object for closure function ConstantPool[D].
#### Nop