c84edaefe9e457e9cc975c050019479b2d94dea2
133 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3a6daede9a |
Reland "[vm/compiler] Unify methods for UnboxIntegerOpInstr subclasses."
This is a reland of commit
|
||
|
|
ee89886bde |
Revert "[vm/compiler] Unify methods for UnboxIntegerOpInstr subc..."
Revert submission 332340 Reason for revert: Failures on SIMARM (not SIMARM_X64 though). Reverted changes: /q/submissionid:332340 Change-Id: Ie87adb065b8dd61896392bffee3b2f4bcd397b3d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333081 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> |
||
|
|
baa18e6d29 |
[vm/compiler] Unify methods for UnboxIntegerOpInstr subclasses.
Unify the Canonicalize() methods on subclasses of UnboxIntegerOp so that there aren't subtle differences between canonicalizing UnboxInt32 and UnboxUint32 instructions. Also unify the ComputeCanDeoptimize() methods for similar reasons. If canonicalizing a truncating unbox of a constant, then create an unboxed constant of the truncated value instead of an unboxed constant of the original untruncated value. Previously, a subclass of Definition that didn't override InferRange got a default range solely based on its type. Now, if the representation of the definition is an unboxed integer, the default range is the intersection of the range inferred from its type with the range inferred from its representation. TEST=ci Change-Id: Ib022c366904ee6f8a81995bd4c16b87bd876176d Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-win-release-x64-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332400 Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
93b84b5b52 |
[vm/compiler] Simplify range analysis for IntConverter.
We can simplify and improve the range analysis in IntConverter if we generalize based on the sizes and signs of the source and target representations and whether the operation truncates or deoptimizes. Adds RepresentationUtils::MinValue() and ::MaxValue(), which return the minimum and maximum value (as an int64_t) for an unboxed integer representation. TEST=ci Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-win-release-x64-try,vm-gcc-linux-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try Change-Id: Ic8dc0d58059e30d85fb2816e15ab3c19fbee461c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332203 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
3a41ee6d8d |
Revert "[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr."
This reverts commit
|
||
|
|
5c4fd50667 |
[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr.
Also if converting an unboxed int with only non-negative values that fit in 32 bits to a uint32, then keep the range from the value. TEST=regress_306327173_il_test Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try Change-Id: Id9e7c2d5f477e560822a02574739c57d77b5a6d1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332202 Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com> |
||
|
|
87f62aedad |
[vm/compiler] Fix range analysis for IntConverter.
Before, converting a Uint32 to a Int32 would just clamp the range to be within the possible Int32 range. However, that's not what the IntConverterInstr represents in this case: in this case, it's just a reinterpretation of the bits as signed instead of unsigned. For simplicity's sake, the initial fix for this is to keep the range [x, y] if it is 0 <= x <= y <= kMaxInt32, and otherwise just use the full Int32 range. Also add a version of Range::Full that takes a Representation instead of a RangeSize, so that the ranges for unsigned unboxed ints can be made more precise. Previously, they'd be overapproximated by the next largest signed representation instead. Also check that we're never trying to create a range for x->untagged, and that untagged->x just uses the full range for x. TEST=vm/dart/regress_306327173_il_test Fixes: b/306327173 Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try Change-Id: Ic60d24be016844deda56ee477a6950a315b8506f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332040 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
4d1bdaaca9 |
Reland "[vm/compiler] Change MemoryCopy to also take untagged addresses."
This is a reland of commit
|
||
|
|
5362d9536b |
Revert "[vm/compiler] Change MemoryCopy to also take untagged addresses."
This reverts commit
|
||
|
|
06d7a2352e |
[vm/compiler] Change MemoryCopy to also take untagged addresses.
This CL adds the ability to pass the payload address of the source and destination directly to the MemoryCopy instruction as an untagged value. The new translation of the _TypedListBase._memMoveN methods use the new MemoryCopy constructor, retrieving the untagged value of the data field of both the source and destination. This way, if inlining exposes the allocation of the object from which the data field is being retrieved, then allocation sinking can remove the intermediate allocation if there are no escaping uses of the object. Since Pointer.asTypedList allocates such ExternalTypedData objects, this CL makes that method inlined if at all possible, which removes the intermediate allocation if the only use of the TypedData object is to call setRange for memory copying purposes. This CL also separates unboxed native slots into two groups: those that contain untagged addresses and those that do not. The former group now have the kUntagged representation, which mimics the old use of LoadUntagged for the PointerBase data field and also ensures that any arithmetic operations on untagged addresses must first be explicitly converted to an unboxed integer and then explicitly converted back to untagged before being stored in a slot that contains untagged addresses. When a unboxed native slot that contains untagged addresses is defined, the definition also includes a boolean which represents whether addresses that may be moved by the GC can be stored in this slot or not. The redundancy eliminator uses this to decide whether it is safe to eliminate a duplicate load, replace a load with the value originally stored in the slot, or lift a load out of a loop. In particular, the PointerBase data field may contain GC-moveable addresses, but only for internal TypedData objects and views, not for external TypedData objects or Pointers. To allow load optimizations involving the latter, the LoadField and StoreField instructions now take boolean flags for whether loads or stores from the slot are guaranteed to not be GC-moveable, to override the information from the slot argument. Notable benchmark changes on x64 (similar for other archs unless noted): JIT: * FfiMemory.PointerPointer: 250.7% * FfiStructCopy.Copy1Bytes: -26.73% (only x64) * FfiStructCopy.Copy32Bytes: -25.18% (only x64) * MemoryCopy.64.setRange.Pointer.Uint8: 19.36% * MemoryCopy.64.setRange.Pointer.Double: 18.96% * MemoryCopy.8.setRange.Pointer.Double: 17.59% * MemoryCopy.8.setRange.Pointer.Uint8: 19.46% AOT: * FfiMemory.PointerPointer: 323.5% * FfiStruct.FieldLoadStore: 483.3% * FileIO_readwrite_64kb: 15.39% * FileIO_readwrite_512kb (Intel Xeon): 46.22% * MemoryCopy.512.setRange.Pointer.Uint8: 35.20% * MemoryCopy.64.setRange.Pointer.Uint8: 55.40% * MemoryCopy.512.setRange.Pointer.Double: 29.45% * MemoryCopy.64.setRange.Pointer.Double: 60.37% * MemoryCopy.8.setRange.Pointer.Double: 59.54% * MemoryCopy.8.setRange.Pointer.Uint8: 55.40% * FfiStructCopy.Copy32Bytes: 398.3% * FfiStructCopy.Copy1Bytes: 1233% TEST=vm/dart/address_local_pointer, vm/dart/pointer_as_typed_list Issue: https://github.com/dart-lang/sdk/issues/42072 Fixes: https://github.com/dart-lang/sdk/issues/53124 Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-arm-try,vm-eager-optimization-linux-release-x64-try,vm-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try Change-Id: I563e0bfac5b1ac6cf1111649934067c12891b631 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324820 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
|
|
b5ac3034e7 |
[vm, compiler] Apply range analysis to TestRangeInstr.
TEST=ci Bug: https://github.com/dart-lang/sdk/issues/53608 Change-Id: I591edd5aaa588829db2ba9d112123508fc3e0b74 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327906 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
|
|
bc4235b94a |
[vm, compiler] Consistently use OriginalDefinition in range analysis for GenericCheckBound.
TEST=vm/dart/regress_53295_test Bug: https://github.com/dart-lang/sdk/issues/53295 Change-Id: Ie186a8ed988486e2f49eef48d07ebf63f6c534d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327320 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> |
||
|
|
c562719814 |
[vm/test] Add IL matching of abstract instructions.
Also marks CheckBoundBase as an abstract instruction, instead of it being treated specially. Now when matching IL graphs that use bounds check instructions, which differ in JIT vs. AOT, the matcher can match the abstract base instruction (CheckBoundBase) instead of having to separately match the concrete subclasses on JIT (CheckArrayBound) and AOT (GenericCheckBound). TEST=ci Change-Id: I73dd6bf6711a99cc2c52a69cf31f22ba4850f2b3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327001 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com> |
||
|
|
f7e26c508d |
[vm] Add support for hash-based caches in SubtypeNTestCache stubs.
This also lowers the threshold for converting from a linear cache to a hash-based cache from 100 to 30 on non-IA32 architectures. (IA32 still goes to runtime if there's a hash-based cache.) For SubtypeTestCache benchmarks above this threshold, we see an improvement varying from ~50-100% to ~700-800% on all architectures, from lowest number of checks (50) to highest (1000). For SubtypeTestCache benchmarks below this threshold, no major changes are seen: generally <5% improvement or <5% regression per check at most. TEST=vm/cc/TTS Change-Id: I83aa7c085ab5a411e944ec660d6b8eba7a788ee0 Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-simarm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-x64c-try,vm-aot-tsan-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-release-ia32-try,vm-linux-debug-x64c-try,vm-linux-debug-x64-try,vm-linux-debug-simriscv64-try,vm-linux-release-simarm64-try,vm-linux-release-simarm-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-tsan-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308941 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com> |
||
|
|
2ee6fcf514 |
[vm] Remove TypeRef
TypeRef type wraps around another type and it was used to represent a graph of recursive types. After [0], the only use of TypeRef is for TypeParameter.bound which may indirectly reference the same TypeParameter. This change replaces TypeParameter.bound with TypeParameter.owner and removes TypeRef entirely. Various parts of the VM no longer need to handle and support TypeRefs. TypeParameter.owner can reference a FunctionType, Class, or, as an optimization, it can be set to null in order to share class type parameters among different classes. With the exception of the 'TypeParameter.owner' back pointer, VM types are now not recursive and can be visited without additional tracking. Caveats: * Generic FunctionType cannot be cloned in a shallow way: when copying a FunctionType, type parameters should be cloned too and their owners should be updated. For that reason, a mapping between 'from' and 'to' function types (FunctionTypeMapping) is maintained during type transformations such as InstantiateFrom. FunctionType::Clone is used instead of Object::Clone where appropriate. * When testing types for subtyping and equivalence, mapping between function types is passed to make sure type parameters belong to the equivalent function types. * IL serializer needs to serialize function types as a whole before serializing any types potentially pointing into the middle of a function type (such as return type 'List<Y0>' pointing into the middle of a function type 'List<Y0> Function<Y0>()'). [0] https://dart-review.googlesource.com/c/sdk/+/296300 TEST=ci Change-Id: I67c2fd0117c6183a45e183919a7847fd1af70b3e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294165 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
7247a1b3b7 |
Reland "[vm] Avoid expanding/flattening type arguments vectors in Type objects"
This is a reland of commit
|
||
|
|
3e2d3bc77f |
Revert "[vm] Avoid expanding/flattening type arguments vectors in Type objects"
This reverts commit
|
||
|
|
135443706b |
[vm] Avoid expanding/flattening type arguments vectors in Type objects
Previously, vectors of type arguments were expanded to include type arguments corresponding to superclasses both in the instances of generic classes and in Type objects (after type finalization). As a result, Type objects after finalization could be recursive and need to use extra TypeRef objects to break loops. The finalization of types was very complex and sometimes slow. This change simplifies the representation of Type objects: now they always have short type argument vectors, corresponding only to the type parameters of their own classes (both before and after finalization). Vectors of type arguments in the instances of generic classes are still expanded/flattened. This greatly simplifies type finalization, makes Type objects non-recursive and removes the need to create and handle excessive TypeRefs for type arguments corresponding to superclasses, as those type arguments are no longer included into types. The only remaining use of TypeRefs is for bounds of type parameters. In order to expand/flatten type arguments, new methods Type::GetInstanceTypeArguments / Class::GetInstanceTypeArguments are introduced. They build canonical declaration type arguments once (for each class), and then instantiate them as needed. There are also simple helper methods to shrink type arguments (TypeArguments::FromInstanceTypeArguments) and expand type arguments without filling type arguments corresponding to superclasses (TypeArguments::ToInstantiatorTypeArguments). Time of edge case 'regress_51960_test' 15min -> 300ms. TEST=ci, runtime/tests/vm/dart/regress_51960_test.dart Fixes https://github.com/dart-lang/sdk/issues/52022 Fixes https://github.com/dart-lang/sdk/issues/51960 Change-Id: I75b466b74698a33c0bb5e1dcbd29542e413812a1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295060 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
de2abc6091 |
[vm] Update NULL to nullptr in runtime/vm/compiler.
TEST=build Change-Id: I54cd75bbc942e11c4d719edcc64640da67077634 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291965 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> |
||
|
|
63e6041ca9 |
[vm] Update to variadic FATAL.
TEST=ci Change-Id: Ic6bc784605e10760bb28ea6df34242336a33b4d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286947 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> |
||
|
|
7c0a694668 |
[vm] Avoid a second map lookup when dispatching isolate messages.
- Use the currently-unused ReceivePort.handler field instead of a second map. - Recognize ReceivePort's fields instead of using natives. This also has the effect that if one discovers that a port handler is holding onto a large amount of memory via its context, the receive port along with its debug name will appear in the retaining path. TEST=ci Change-Id: I4b8d0764a41729a3b397b85bc4603e4d6b0ca9a7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285403 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> |
||
|
|
23d3e86f95 |
[vm/compiler] Ensure the compiler runs without an active isolate
The compiler should not depend on isolate specific details since compiled code is shared across isolates in an isolate group. TEST=ci Change-Id: I77332c2dea6b5a8e75c1a3be544d1b73a7a69497 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278900 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com> |
||
|
|
3675fd25f4 |
[vm] Packed representation of record shape
The representation of record shape in record instances and record types is changed from a pair int num_fields Array field_names to a single integer - packed bitfield int num_fields(16) int field_names_index(kSmiBits-16) where field names index is an index in the array available from ObjectStore. With the new representation of record shapes: 1) Size of record instances is reduced. 2) Number of comparisons for a shape test reduced from 2 to 1 (shape test is used during type checks). 3) A few operations removed from Record.hashCode. 4) Type testing stubs (TTS) are now supported for record types with named fields. Previously it was not possible to check shape of records with named fields in TTS as TTS cannot access object pool and cannot load field names array). TEST=existing Issue: https://github.com/dart-lang/sdk/issues/49719 Change-Id: I7cdcbb53938aba5d561cd24dc99530395dbbea7e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276201 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
1aeece5e31 |
Spelling runtime vm compiler
Closes https://github.com/dart-lang/sdk/pull/50784 Co-authored-by: Josh Soref 2119212+jsoref@users.noreply.github.com TEST=ci GitOrigin-RevId: dbb20e7ee532a3490e86a633b5164ebab54bd38d Change-Id: I9bd29543c4417efd4f338ff1c0e45c4ddbcc044d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276622 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Erik Ernst <eernst@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
49f998dc31 |
[vm/compiler] Handle hash caches in the InstantiateTypeArguments stubs.
Lower the threshold for converting from a linear to a hash-based cache
on most architectures from 500 to 10.
Due to register pressure, the InstantiateTypeArguments stub on IA32
continues to go to the runtime for hash caches, and so we do not
lower the threshold for converting to a hash-based cache there.
The following are benchmark results for those benchmark that use enough
Instantiations to trigger the use of hash-based caches. In the following
tables, "Results 1" denotes the benchmark results from only this change,
whereas "Results 2" include from comparing to the results prior to
|
||
|
|
10e9606861 |
[vm] More efficient 'is' tests for record types
'is' tests against record types are split into series of 'is' tests of record fields. This is more efficient as record instances cannot be added to subtype test caches (because type of a record instance depends on types of its fields). This change also adds canonicalization and constant evaluation of LoadFieldInstr for record fields. Performance on a trivial micro-benchmark (on x64): JIT (RunTime): 4519104.5 -> 20031.5 AOT (RunTime): 4352583.0 -> 26281.6 TEST=ci Issue: https://github.com/dart-lang/sdk/issues/49719 Change-Id: I2ed464cd3b31f365b17805f4e7debe1d6d1051fa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268080 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
ed593585cc |
[vm] Record operator== and hashCode
TEST=language/records/simple/equals_and_hashcode_test TEST=co19/LanguageFeatures/Records/equality_* Issue: https://github.com/dart-lang/sdk/issues/49719 Change-Id: I63842f980389d63650d00638f1cb1501db88b025 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260442 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> |
||
|
|
3ec7cf9c34 |
[vm] Record literals
TEST=language/record_literal_test Issue: https://github.com/dart-lang/sdk/issues/49719 Change-Id: I287586c0adb19fe401d76c7a586133a1fe9f1d1d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257264 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> |
||
|
|
5f985eb3e6 |
Reland "[vm/compiler] Initial implementation of IL binary serialization"
This is a reland of commit
|
||
|
|
17311c94d1 |
Revert "[vm/compiler] Initial implementation of IL binary serialization"
This reverts commit
|
||
|
|
9700458975 |
[vm/compiler] Initial implementation of IL binary serialization
This change adds binary serialization/deserialization of flow graphs. It supports all IL instructions and certain objects which can be referenced from IL instructions. IL binary serialization is a useful machanism which would allow us to split compilation into multiple parts in order to parallelize AOT compilation. The program structure (libraries/classes/functions/fields) is not serialized. It is assumed that reader and writer use the same program structure. Caveats: * FFI callbacks are not supported yet. * Closure functions are not re-created when reading flow graph. * Flow graph should be in SSA form (unoptimized flow graphs are not supported). * JIT mode is not supported (serializer currently assumes lazy linking of native methods and empty ICData). In order to test IL serialization, --test_il_serialization VM option is added to serialize and deserialize flow graph before generating code. TEST=vm/dart/splay_test now runs with --test_il_serialization. TEST=Manual run of vm-kernel-precomp-linux-debug-x64-try with --test_il_serialization enabled (only ffi tests failed). Issue: https://github.com/dart-lang/sdk/issues/43299 Change-Id: I7bbfd9e3a301e00c9cfbffa06b8f1f6c78a78470 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254941 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
4075e8b3f9 |
[vm] New async*/yield/yield* implementation based on suspend/resume stubs
TEST=ci Issue: https://github.com/dart-lang/sdk/issues/48378 Change-Id: I0c2ca9269b2c8f008a79c139a0ce10231996732d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242923 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
|
|
bf4bb95308 |
[vm] New async/await implementation in the VM, part 2 - vm
The new implementation moves away from desugaring of async functions on kernel AST, state machine generated in the flow graph and capturing all local variables in the context. Instead, async/await is implemented using a few stubs (InitSuspendableFunction, Suspend, Resume, Return and AsyncExceptionHandler). The stubs are implemented in a platform-independent way using (macro-)assembler helpers. When suspending a function, its frame is copied into a SuspendState object, and when resuming a function it is copied back onto the stack. No extra code is generated for accessing local variables. Callback closures are created lazily on the first await. Design doc: go/compact-async-await. Part 1 (kernel): https://dart-review.googlesource.com/c/sdk/+/241842 TEST=ci Issue: https://github.com/dart-lang/sdk/issues/48378 Change-Id: Ibad757035b7cc438ebdff80b460728b1d3eff1f5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242000 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
532c116cd2 |
[vm] Implement NativeFinalizer
This CL implements `NativeFinalizer` in the GC. `FinalizerEntry`s are extended to track `external_size` and in which `Heap::Space` the finalizable value is. On attaching a native finalizer, the external size is added to the relevant heap. When the finalizable value is promoted from new to old space, the external size is promoted as well. And when a native finalizer is run or is detached, the external size is removed from the relevant heap again. In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate shutdown. When the `NativeFinalizer`s themselves are collected, the finalizers are not run. Users should stick the native finalizer in a global variable to ensure finalization. We will revisit this design when we add send and exit support, because there is a design space to explore what to do in that case. This current solution promises the least to users. In this implementation native finalizers have a Dart entry to clean up the entries from the `all_entries` field of the finalizer. We should consider using another data structure that avoids the need for this Dart entry. See the TODO left in the code. Bug: https://github.com/dart-lang/sdk/issues/47777 TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart TEST=runtime/vm/object_test.cc TEST=tests/ffi(_2)/vmspecific_native_finalizer_* Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121 Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
|
|
e151a81108 |
Reland "[vm] Implement Finalizer"
Original CL in patchset 1. Split-off https://dart-review.googlesource.com/c/sdk/+/238341 And pulled in fix https://dart-review.googlesource.com/c/sdk/+/238582 (Should merge cleanly when this lands later.) This CL implements the `Finalizer` in the GC. The GC is specially aware of two types of objects for the purposes of running finalizers. 1) `FinalizerEntry` 2) `Finalizer` (`FinalizerBase`, `_FinalizerImpl`) A `FinalizerEntry` contains the `value`, the optional `detach` key, and the `token`, and a reference to the `finalizer`. An entry only holds on weakly to the value, detach key, and finalizer. (Similar to how `WeakReference` only holds on weakly to target). A `Finalizer` contains all entries, a list of entries of which the value is collected, and a reference to the isolate. When a the value of an entry is GCed, the enry is added over to the collected list. If any entry is moved to the collected list, a message is sent that invokes the finalizer to call the callback on all entries in that list. When a finalizer is detached by the user, the entry token is set to the entry itself and is removed from the all entries set. This ensures that if the entry was already moved to the collected list, the finalizer is not executed. To speed up detaching, we use a weak map from detach keys to list of entries. This ensures entries can be GCed. Both the scavenger and marker tasks process finalizer entries in parallel. Parallel tasks use an atomic exchange on the head of the collected entries list, ensuring no entries get lost. The mutator thread is guaranteed to be stopped when processing entries. This ensures that we do not need barriers for moving entries into the finalizers collected list. Dart reads and replaces the collected entries list also with an atomic exchange, ensuring the GC doesn't run in between a load/store. When a finalizer gets posted a message to process finalized objects, it is being kept alive by the message. An alternative design would be to pre-allocate a `WeakReference` in the finalizer pointing to the finalizer, and send that itself. This would be at the cost of an extra object. Send and exit is not supported in this CL, support will be added in a follow up CL. Trying to send will throw. Bug: https://github.com/dart-lang/sdk/issues/47777 TEST=runtime/tests/vm/dart/finalizer/* TEST=runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart TEST=runtime/vm/object_test.cc Change-Id: Ibdfeadc16d5d69ade50aae5b9f794284c4c4dbab Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-analyze-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238086 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
|
|
37526fc8d7 |
Revert "[vm] Implement Finalizer"
This reverts commit
|
||
|
|
7dca34c235 |
[vm] Implement Finalizer
This CL implements the `Finalizer` in the GC. (This CL does not yet implement `NativeFinalizer`.) The GC is specially aware of two types of objects for the purposes of running finalizers. 1) `FinalizerEntry` 2) `Finalizer` (`FinalizerBase`, `_FinalizerImpl`) A `FinalizerEntry` contains the `value`, the optional `detach` key, and the `token`, and a reference to the `finalizer`. An entry only holds on weakly to the value, detach key, and finalizer. (Similar to how `WeakReference` only holds on weakly to target). A `Finalizer` contains all entries, a list of entries of which the value is collected, and a reference to the isolate. When a the value of an entry is GCed, the enry is added over to the collected list. If any entry is moved to the collected list, a message is sent that invokes the finalizer to call the callback on all entries in that list. When a finalizer is detached by the user, the entry token is set to the entry itself and is removed from the all entries set. This ensures that if the entry was already moved to the collected list, the finalizer is not executed. To speed up detaching, we use a weak map from detach keys to list of entries. This ensures entries can be GCed. Both the scavenger and marker tasks process finalizer entries in parallel. Parallel tasks use an atomic exchange on the head of the collected entries list, ensuring no entries get lost. The mutator thread is guaranteed to be stopped when processing entries. This ensures that we do not need barriers for moving entries into the finalizers collected list. Dart reads and replaces the collected entries list also with an atomic exchange, ensuring the GC doesn't run in between a load/store. When a finalizer gets posted a message to process finalized objects, it is being kept alive by the message. An alternative design would be to pre-allocate a `WeakReference` in the finalizer pointing to the finalizer, and send that itself. This would be at the cost of an extra object. Send and exit is not supported in this CL, support will be added in a follow up CL. Trying to send will throw. Bug: https://github.com/dart-lang/sdk/issues/47777 TEST=runtime/tests/vm/dart/finalizer/* TEST=runtime/tests/vm/dart_2/isolates/fast_object_copy_test.dart TEST=runtime/vm/object_test.cc Change-Id: I03e6b4a46212316254bf46ba3f2df333abaa686c Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-analyze-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229544 Reviewed-by: Lasse Nielsen <lrn@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
|
|
828dcd00e8 |
[vm] Implement WeakReference in the VM
This CL implements `WeakReference` in the VM. * This reduces the size of weak references from 2 objects using 8 words to 1 object using 4 words. * This makes loads of weak reference targets a single load instead of two. * This avoids the fix-point in the GC and message object copying for weak references. (N.b. Weak references need to be processed _after_ the fix-point for weak properties.) The semantics of weak references in messages is that their target gets set to `null` if the target is not included in the message by a strong reference. The tests take particular care to exercise the case where a weak reference's target is only kept alive because a weak property key is alive and it refers to the target in its value. This exercises the fact that weak references need to be processed last. Does not add support for weak references in the app snapshot. It would be dead code until we start using weak references in for example the CFE. This CL does not try to unify weak references and weak properties in the GC or messaging (as proposed in go/dart-vm-weakreference), because their semantics differ enough. Closes: https://github.com/dart-lang/sdk/issues/48162 TEST=runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart TEST=runtime/tests/vm/dart/isolates/fast_object_copy_test.dart TEST=runtime/vm/object_test.cc TEST=tests/lib/isolate/weak_reference_message_1_test.dart TEST=tests/lib/isolate/weak_reference_message_2_test.dart Change-Id: I3810e919a5866f3ae8a95bd9aa23a880a0b0921c Cq-Include-Trybots: luci.dart.try:app-kernel-linux-debug-x64-try,dart-sdk-mac-arm64-try,vm-canary-linux-debug-try,vm-fuchsia-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simriscv64-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232087 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
|
|
45f42d0be8 |
[vm] Refactor duplicated slots and rename offsets
This change removes distinct Slots for the same field: PointerBase_data_field -> PointerBase_data Pointer_data_field -> PointerBase_data TypedDataBase_data_field -> PointerBase_data Also, the following slot is renamed to match field name: TypedDataView_data -> TypedDataView_typed_data The following offsets are renamed to match field names / declarations in Untagged* classes: PointerBase::data_field_offset -> PointerBase::data_offset TypedData::data_offset -> TypedData::payload_offset TypedDataView::data_offset -> TypedDataView::typed_data_offset TEST=ci Fixes https://github.com/dart-lang/sdk/issues/48273 Change-Id: I602545fc43018494bcb24d8692292fdbc6a8f3e0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231160 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
91154e78a3 |
[vm/compiler] Ensure that right operand range is set for ShiftUint32Op created during range analysis
Code generation for shift instructions relies on the range information for the right operand in order to generate shifts by constants and omit certain runtime checks. When range analysis creates ShiftUint32Op it has not been setting range of the right operand, which resulted in suboptimal code. This change fixes that by using BinaryIntegerOpInstr::Make which initializes range of the right operand if it is a constant. TEST=vm/cc/RangeAnalysis_ShiftUint32Op Fixes https://github.com/dart-lang/sdk/issues/48153 Change-Id: I7df4bb86745bad8712862e3ea07c75b2c4898288 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228684 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
|
|
a771d6eaed |
[vm] Minor ARM64 code generation improvements discovered during RISC-V port.
TEST=ci Change-Id: I4bd17df224933f732eb9cef0a9b2da8dfad0a7d4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227940 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> |
||
|
|
c6fe9e21f0 |
[vm/compiler] Avoid invalid code motion
In Dart doing a type check against one value can constrain the type of another value in an indirect fashion. This possibility needs to be taken into account when inserting Redefinitions to inhibit the code motion. This CL addresses two previously ignored situations: * Given a generic container `C<T> c` which holds a value `T v` doing a type check against `c` might narrow the type of `v`. * Given two generic classes `C<T>` and `H<T>`, doing a type-check against an instance of type `C<X> c` might narrow the type of an unrelated instance of `H<X> v` within the same scope. The second situation is currently limited to a situation when we do an invocation on `this` and the target of the call has constrained generic parameter (e.g. because the target of the call is in the subclass which instantiates the base class with a more specific type `class C_ extends C<int>`). Calls on `this` are special because they are allowed to bypass argument type checks which are usually performed due to covariance. In both cases we need to ensure that all uses of `v` which are using narrowed type are pinned to stay within the true successor of the type-check against `c`. Previously we would only insert redefinitions for the value that is being type checked, but this is not enough and this CL tries to address the newly discovered cases: * When replacing loads in load optimizer we must ensure that if replaced load was dependant on the redefinition (and thus was pinned) the replacement is similarly pinned (if the type of the load might have been narrowed). If neccessary we must insert a redefinition for the loaded value itself. * When performing inlining of calls on `this` we must insert redefinitions for all parameters that might have their types narrowed. * When replacing phis which have redefinitions as all inputs. Fixes https://github.com/flutter/flutter/issues/91370 Fixes https://github.com/dart-lang/sdk/issues/43652 TEST=vm/dart{,_2}/flutter_regress_91370_il_test Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try Change-Id: I89c1f165615dd827102e9f6af90365af7d8f32b2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219241 Commit-Queue: Slava Egorov <vegorov@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> |
||
|
|
b9b1ea6b5d |
[vm] Refactor hash maps with T* keys where T <: Object.
Rename PointerKeyValueTrait<T>, which is used to create sets of pointers to T instances where T <: Object and T has appropriate Hash and Equals instance methods, to the more specific name PointerSetKeyValueTrait. Create a PointerSet<T> alias for using this trait with DirectChainedHashMap and use that alias in other code as a shorthand. Remove PointerSetKeyValueTrait<const char> as a superclass of CStringKeyValueTrait, as the only reuse from the former are the two methods KeyOf and ValueOf which just return their argument, and having this relationship is odd since const char is not a subtype of Object. TEST=Renaming/refactoring, so existing tests. Change-Id: I0274b16cb9fcb3939a28fb109fb8626c1ac8c0e9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215761 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
|
|
e8e9e1d152 |
[vm] Introduce immutable maps and sets in backend
This CL introduces immutable maps and sets in the VM backend but does not yet target them from the frontend. The changes are tested by unit tests constructing these immutable maps and sets. This CL introduces immutable variants of the hash map and set in compact_hash.dart and recognizes them in the VM. The immutable ones use a different mixin with a different recognized method for accessing members. * Data list is an immutable list with a different cid. (Otherwise the optimizer notices that immutable and mutable lists cannot be equal.) * Index is a nullable mutable typed data. (Otherwise optimizer removes necessary null checks.) * Index should use a store-release barrier when written to. Multiple isolates might lazily compute the index for const sets and maps. This is fine because all identityHashCodes and hashCodes are guaranteed to be race-free. The later isolates will override the index pointer with an identical index. This CL does not introduce support for using these immutable maps and sets in AOT (clustered_snapshot) and in messages to other isolates (message_snapshot) because that is harder to test with unit tests. That will be added in the follow-up CL. Design doc: go/dart-vm-const-maps TEST=runtime/vm/object_test.cc Bug: https://github.com/dart-lang/sdk/issues/45908 Change-Id: I4042179c15e8b37692d3255655351c01c7124991 Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210860 Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
|
|
94bdcc2084 |
[VM] Adds native field accessor in Dart.
Adds GetNativeField(o,i) to access NativeFieldWrapperClass{1-4}
native fields directly in Dart instead of through VM API.
This will allow us to pass `this` as a raw pointer instead of as
a Dart handle which needs to be unwrapped.
This will in turn allow ffi native calls for instance methods.
TEST=Adds vm/cc/DartAPI_NativeFieldAccess
Bug: https://github.com/dart-lang/sdk/issues/43889
Change-Id: I8006c735569fcbe5e49915a4c7e72c4ca85b356e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205482
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
|
||
|
|
172e1bee70 |
[vm] Introduce LinkedHashBase
In separate CL so that the LinkedHashMap CL is a bit smaller. Bug: https://github.com/dart-lang/sdk/issues/36077 TEST=tests/**_test.dart Change-Id: I4ecff40a40fffbad4d9c37ca426066128c0ed7f7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206223 Reviewed-by: Tess Strickland <sstrickl@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
|
|
cf63eaed4d |
[vm] Remove overlap between Function and FunctionType.
Previously there were several pieces of information shared between both FunctionType and Function, mostly in the packed fields, but named argument names were also kept in both places. Now the FunctionType is the primary source for this information, with the Function only keeping the names of positional arguments, which are discarded in AOT snapshots. This does mean extra work to access this information via the function object, but for the most part, this information is only accessed in the compiler or during dynamic lookups or checks in the runtime. After adding the count of type parameters to the packed information in FunctionType, the packed information has been split into two pieces: one for parameter counts, another for type parameter counts. This split does not increase the size of UntaggedFunctionType, as there were 2 bytes available in the existing padding. Changes on flutter gallery in release mode: * ARM7 code size: total -0.91%, readonly -0.22%, isolate -4.32% * ARM7 heap size: total -2.00% * ARM8 code size: total -0.93%, readonly -0.22%, isolate -4.32% * ARM8 heap size: total -2.12% Changes on flutter gallery in release-sizeopt mode: * ARM7 code size: total -0.24%, readonly -0.08%, isolate -1.49% * ARM7 heap size: total -0.88% * ARM8 code size: total -0.26%, readonly -0.11%, isolate -1.49% * ARM8 heap size: total -1.01% TEST=Refactoring, so existing tests. Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try Change-Id: Ic4d59a7b4acca039a5647f9163e716f6019163f5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203241 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Régis Crelier <regis@google.com> |
||
|
|
b8ecf06943 |
[vm/compiler] Add kUnboxedUint16 representation.
Adding this representation allows us to create slots for storing
and retrieving values from uint16_t-typed object fields in the runtime.
Also generalize BoxUint8Instr to BoxSmallIntInstr, which holds any
unboxed integer representation where the value is guaranteed to fit
into a Smi.
To unify the implementation of BoxSmallIntInstr across architectures,
we add ExtendValue(Register dst, Register src, OperandSize sz), which
extends the sz-sized value in src to a full register size in dst. If
sz is a signed OperandSize, then the resulting value is sign
extended appropriately.
We also add MoveAndSmiTagRegister / ExtendAndSmiTagValue, which is like
the base operation but also tags the value as a Smi. On some
architectures, this can be performed using a single instruction.
Also adds sbfx/ubfx on ARM for use in ExtendValue.
TEST=Existing tests for BoxSmallIntInstr, followup CL for the new
representation.
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: I9c0b3a23f5e28480e0bfbde55b9494f7b822dcfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203761
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
|
||
|
|
faa1c9ff98 |
[vm] Move context setting into AllocateClosure stub.
With this change, allocation instructions can now be direct inputs to other allocation instructions, so the redundancy eliminator is extended to handle this possibility. Methods for working with instruction input-related slots are added to subclasses of AllocationInstr, so that the redundancy eliminator can be written more generically in places, instead of needing to add cases for new allocation instructions and/or instruction inputs. Code size different in Flutter gallery (release-sizeopt): * ARM7: Total -0.30%, instructions -0.41% * ARM8: Total -0.31%, instructions -0.47% TEST=Current test suite. Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-debug-x64c-try Change-Id: Idc1aa2a1cb8c0c62f0bcb64aee89a7525dd3d1e1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198406 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> |
||
|
|
1f55b7ca10 |
Reland "[VM/runtime] Refactor the representation of type parameters in the VM."
This is a reland of
|