a9c11acd25
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: https://github.com/dart-lang/sdk/issues/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>