-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Records] VM implementation #49719
Labels
Milestone
Comments
a-siva
added
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
P2
A bug or feature request we're likely to work on
labels
Aug 19, 2022
copybara-service bot
pushed a commit
that referenced
this issue
Sep 12, 2022
TEST=language/record_type_test Issue: #49719 Change-Id: Ib2100c23513395c9fa9c541320eacbb33a2a119e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256802 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 12, 2022
TEST=ci Issue: #49719 Change-Id: I82ba571d1935d616fe3d4d6d579e59eb57d65a43 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256804 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 12, 2022
TEST=language/record_literal_test Issue: #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>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 12, 2022
TEST=language/record_literal_test Issue: #49719 Change-Id: Ia24fb1178c4a19761fea65c5c0cc9a0137226e45 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257920 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 12, 2022
TEST=language/records/simple/literals_and_field_access_test TEST=language/records/simple/constants_and_field_access_test TEST=language/record_type_test Issue: #49719 Change-Id: I727b6ced0a70fa4f6513cb7bacce5796404e514c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257924 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 16, 2022
This change provides baseline implementation of type checks involving record instances and record types via runtime calls. TEST=language/records/simple/type_checks_test Issue: #49719 Change-Id: I2402f3db0a6dadbab477b073ed2b8861d5a172e8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259460 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Tess Strickland <sstrickl@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 16, 2022
This change adds minimal support for RecordType, RecordLiteral, RecordIndexGet, RecordNameGet and RecordConstant kernel nodes to TFA. TFA is *not* yet extended with the ability to infer record types. TEST=language/records/simple Issue: #49719 Change-Id: I7c5eb860c6a5cb263e4d1bb55ad230e5c51f47c2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259520 Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 19, 2022
TEST=co19/LanguageFeatures/Subtyping/dynamic/generated/records_arguments_binding_A03_t03 Issue: #49719 Change-Id: I5528a428f4dd49768732b1a8c440423f472e8923 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259920 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 19, 2022
TEST=language/records/simple/runtime_type_test Issue: #49719 Change-Id: I031dff68241dfc62ebc3b6350b10ba7d352bab37 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259621 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 20, 2022
On arm64 Address can assume certain load/store size depending on the value (alignment) of the offset. This may cause assertion failure "runtime/vm/compiler/assembler/assembler_arm64.h: 2750: error: expected: a.log2sz_ == -1 || a.log2sz_ == size". This change fixes build on arm64c in debug mode by using an unaligned offset. This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/259920. TEST=Build on the vm-ffi-android-debug-arm64c bot. Issue: #49719 Change-Id: I2fef8c8b397e85b9092244ae701a5f7b24b8f6eb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260062 Auto-Submit: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 22, 2022
TEST=language/records/simple/equals_and_hashcode_test TEST=co19/LanguageFeatures/Records/equality_* Issue: #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>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 22, 2022
TEST=language/records/simple/to_string_test Issue: #49719 Change-Id: I7e55a2486b1d964b24a287ffcf87c40c20f9cfe9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260480 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 28, 2022
TEST=language/records/simple/constants_and_field_access_test Issue: #49719 Change-Id: I47b1c300195249d0e07e2adfdeeba0c4e44f5de7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261480 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 28, 2022
…generic types TEST=language/records/simple/type_checks2_test Issue: #49719 Change-Id: I9117331d8e985675a8adba1aaa4d50a6b17758f4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261182 Reviewed-by: Tess Strickland <sstrickl@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 29, 2022
TEST=ci Issue: #49719 Change-Id: Ibf818df1f57afa93051123d0c9493913e7f9ab76 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260641 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Sep 29, 2022
TEST=co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01 (Tested manualy by applying 4b6a8f3 and running "tools/test.py -n dartk-strong-linux-debug-x64 co19/LanguageFeatures/Records/upper_and_lower_bounds_A04_t01"). Issue: #49719 Change-Id: Ib5658ac776a75913e617095f8861baba25f13de3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261800 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> Auto-Submit: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 3, 2022
TEST=language/records/simple/dynamic_field_access_test Issue: #49719 Change-Id: I18df67e0bf97944c8e5ef8a71f075b5cd40fec29 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262300 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 5, 2022
TEST=co19/LanguageFeatures/Records/record_class_A01_t01 Issue: #49719 Change-Id: Ic57de7f1ee59fdd9334b3463ec8b9a6e5e6af06c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262840 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 10, 2022
From records specification: ``` Like numbers, records do not have a well-defined persistent identity. That means Expandos can not be attached to them. ``` This change updates Expando and WeakReference API documentation and adds a check to disallow attaching Expando or WeakReference to a record. TEST=co19/LanguageFeatures/Records/expandos_A01_t01 Issue: #49719 Change-Id: I6459f43a2deac697e201673589d73abedc8d413e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263420 Reviewed-by: Lasse Nielsen <lrn@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 18, 2022
It is allowed to have named fields $N in records unless they conflict with corresponding positional fields. So when accessing $N fields dynamically we should look for both positional field and named field. TEST=language/records/simple/dynamic_field_access_test Issue: #49719 Change-Id: Id31dcb82e753aeeaeed74d5d07aac556ae08a7b2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264740 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 19, 2022
TEST=language/records/simple/dynamic_field_access_test Issue: #49719 Change-Id: I811db5c649988cbadf7ab29e5c4c70366f55e86b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262845 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 24, 2022
This change adds all necessary support for allocation sinking and materialization of record instances. TEST=vm/cc/AllocationSinking_Records Issue: #49719 Change-Id: I040ce8b1ed3220f87a767b590050de3e50573170 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265380 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Oct 25, 2022
The new micro-benchmark measures performance of returning 2 values via list, dedicated class, record and a record with named fields. Requires '--enable-experiment=records' flag to run. Issue: #49719 Change-Id: I895d955efb2fc4f1c04b31b113cd8e01db47132a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265121 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Nov 3, 2022
This change introduces specialized stubs and IL instruction for allocating records with 2 or 3 fields. This makes allocation of small records slightly faster compared to a construction of similar class instances and makes code size of record allocation smaller. Benchmark: MultipleReturns.NotInlined.Record(RunTime) 77150 -> 66222 MultipleReturns.NotInlined.RecordNamed(RunTime) 78073 -> 67044 MultipleReturns.Forwarded.Record(RunTime) 97130 -> 77635 MultipleReturns.Forwarded.RecordNamed(RunTime) 96495 -> 77904 TEST=ci Issue: #49719 Change-Id: I8ed7add06b39ba79dfd78bbe2afaefe606cc505b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266420 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Nov 7, 2022
'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: #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>
copybara-service bot
pushed a commit
that referenced
this issue
Nov 29, 2022
Functions returning non-nullable records of 2 fields can now return them as separate values on 2 registers. This postpones and sometimes eliminates creation of record instances. As other unboxing optimizations of return values, this optimization is only performed in AOT. Pair of values for an unboxed record are represented using kPairOfTagged representation, which can be now used for the input of Return and for the output of StaticCall/InstanceCall PolymorphicInstanceCall/DispatchTableCall instructions. In order to combine separate values for Return, a new MakePair instruction is added. Extracting separate values from the result of a call is implemented using existing ExtractNthOutput instruction. Benchmarks (AOT mode): MultipleReturns.Forwarded.Record +45-57% MultipleReturns.Forwarded.RecordNamed +43-57% MultipleReturns.NotInlined.Record +58-79% MultipleReturns.NotInlined.RecordNamed +53-76% TEST=runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart TEST=benchmarks/MultipleReturns/dart/MultipleReturns.dart Issue: #49719 Change-Id: I7117b19a134c1db0ba5117a1ef093867f9ba20e2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269100 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Dec 13, 2022
Issue: #49719 Change-Id: I1cb36cc4e690ef463c26c8aa58a2186dfe3290e6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273823 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Stephen Adams <sra@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Dec 14, 2022
Benchmarks improved by: JIT: RecordCollections.ListAddPoly.Record ~9.6 times RecordCollections.ListSetIndexed.Record ~8.3 times RecordCollections.ListSetIndexedPoly.Record ~16.1 times RecordCollections.MapAdd.RecordKey ~3.6 times RecordCollections.MapAdd.RecordValue ~4.4 times RecordCollections.SetAdd.Record ~4.1 times AOT: RecordCollections.ListAdd.Record ~8.7 times RecordCollections.ListAddPoly.Record ~8.8 times RecordCollections.ListSetIndexed.Record ~19.5 times RecordCollections.ListSetIndexedPoly.Record ~18.3 times RecordCollections.MapAdd.RecordKey ~7.1 times RecordCollections.MapAdd.RecordValue ~8.8 times RecordCollections.SetAdd.Record ~8.9 times TEST=vm/cc/TTS_RecordSubtypeRangeCheck Issue: #49719 Change-Id: I96e4c6a40a897a72b3570b59e014c8af77a9ef99 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275082 Reviewed-by: Tess Strickland <sstrickl@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Dec 20, 2022
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: #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>
copybara-service bot
pushed a commit
that referenced
this issue
Dec 21, 2022
After record shape representation changed in https://dart-review.googlesource.com/c/sdk/+/276201, clang started to insert an extra alignment padding between 'shape' and 'data' fields in record instances in compressed pointers mode. This padding is not initialized in the allocation stubs, but GC scans it as it falls between 'from' (shape) and 'to' (end of data). This change adjusts layout of UntaggedRecord in compressed pointers mode to avoid the implicit padding and GC visiting garbage. TEST=Manual run of language/records/simple tests and RecordCollections benchmark on x64c and simarm64c architectures. Issue: #49719 Change-Id: I4b8a5b36c3ff757ccbbdb46c20d9ed8d12c53f96 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276775 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Jan 6, 2023
TEST=TypePropagator_RecordFieldAccess Issue: #49719 Change-Id: I18f8fc1ca1c97722f10b280afbe943bb4c948e17 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278520 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Feb 1, 2023
This change fixes assertion ../../runtime/vm/object_reload.cc: 942: error: expected: old_target_.is_static() || old_target_.kind() == UntaggedFunction::kConstructor which happened when updating a target of static call from record field getter to Record._fieldNames. TEST=language/records/simple/dynamic_field_access_test (on vm-reload-linux-debug-x64 configuration) Issue: #49719 Change-Id: I0e80a91969778ca5a14805d79f4127ba53bc4aa7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280246 Auto-Submit: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Mar 7, 2023
This allows us to better track all kinds of accesses to record implementation classes in dart2wasm, which generates separate record implementation class per record shape. This change also allows us to remove mutable dispatch targets which were used to implement dynamic accesses to record fields, and make tracking of record field types more accurate (record fields are now versioned per shape). This is also a step towards inferring actual record types. TEST=pkg/vm/testcases/transformations/type_flow/transformer/records.dart TEST=pkg/vm/testcases/transformations/type_flow/transformer/records_dart2wasm.dart TEST=language/records/simple/dynamic_field_access_test Issue #49719 Fixes #51363 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try Change-Id: Icba62a7ca8cfd8ddbc7f2b7c38aeabbef5caec4b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286950 Reviewed-by: Slava Egorov <vegorov@google.com> Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Mar 9, 2023
…gation Types of record field accesses are based on static record types, so it is useful to keep and propagate static types even when concrete class id is known. TEST=runtime/tests/vm/dart/records_field_operations_il_test.dart Issue: #49719 Issue: #51637 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try Change-Id: I268e3d519b07e12d1e2f8929cbd704a6995e2053 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287222 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Mar 15, 2023
Unboxing of records in return values is switched to use inferred record shape instead of a static type. This is more accurate, as static return type 'Object', 'dynamic' or a type parameter would not prevent record unboxing. TEST=runtime/tests/vm/dart/records_return_value_unboxing_il_test.dart TEST=pkg/vm/testcases/transformations/type_flow/transformer/unboxed_records.dart Issue: #49719 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try Change-Id: I56528e114bc2de94c4a1ec09c48eb5b9ed3c3d3f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288824 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
@bernaferrari VM uses fasta (more generally called common front-end, CFE), but we treat it as a separate component in the issue tracker as different people are working on the front-end and the VM. CFE has its own issue for the implementation of the records feature - #49713. If you experience any bugs related to records in the VM - please file issues and we will triage and route them as needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: