Skip to content

Commit e8785d6

Browse files
sstricklcommit-bot@chromium.org
authored andcommitted
[vm/compiler] Move type argument type checks out of closure bodies.
These checks are now performed in the dynamic closure call dispatcher. To avoid having to create type argument vectors (TAVs) for default type arguments at runtime, we cache a compile-time created TAV in the ClosureData for the closure function which is retrieved by the dispatcher when needed. We also keep an associated packed field of information that can also be determined at compile time: * Whether the cached TAV needs instantiation or can share its instantiator or function type arguments. * The number of parent type parameters. The former allows the generated IL to keep the invariant that the InstantiateTypeArguments instruction (and the runtime entry it calls) is only used for uninstantiated TAVs. Also changes the destination name to an Value input for the AssertSubtype instruction and adds handling for non-constant types and names in that instruction's backend. Additional changes: * Adds new slots for ClosureData, Function, and TypeArguments. * Adds a new kUnboxedUint8 representation (needed for TypeParameterLayout::flags_, which is of type uint8_t). * Extends LoadField to handle uint8_t unboxed native fields. * Adds BoxUint8 for boxing unboxed uint8_t values. Code size impact on Flutter gallery in release mode: * arm7: total +0.08%, vmisolate: +0.56%, isolate: +0.42%, readonly: -0.04%, instructions: -0.03% * arm8: total +0.12%, vmisolate: +0.56%, isolate: +0.42%, readonly: -0.002%, instructions: +0.03% Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try Bug: dart-lang#40813 Change-Id: I5a7de27a17e3119e27752bd0d10e1c6bc1b52a16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158844 Commit-Queue: Tess Strickland <[email protected]> Reviewed-by: Martin Kustermann <[email protected]> Reviewed-by: Régis Crelier <[email protected]>
1 parent f6717e5 commit e8785d6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

assembler_arm.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,7 @@ OperandSize Address::OperandSizeFor(intptr_t cid) {
22072207
switch (cid) {
22082208
case kArrayCid:
22092209
case kImmutableArrayCid:
2210+
case kTypeArgumentsCid:
22102211
return kWord;
22112212
case kOneByteStringCid:
22122213
case kExternalOneByteStringCid:

assembler_arm64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ class Address : public ValueObject {
266266
switch (cid) {
267267
case kArrayCid:
268268
case kImmutableArrayCid:
269+
case kTypeArgumentsCid:
269270
return kWord;
270271
case kOneByteStringCid:
271272
case kExternalOneByteStringCid:

0 commit comments

Comments
 (0)