Skip to content

Commit 3d0a29d

Browse files
sstricklCommit Queue
authored andcommitted
[vm/compiler] Allow Slot::Equals to be used with native slots.
Before this change, Slot::Equals would hit the default UNREACHABLE() case if used to compare two equal native slots. That's surprising and also unavoidable if code comparing arbitrary slots wants to check Slot equality, since there's no existing predicate to determine whether an arbitrary slot is native. TEST=ci Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-linux-product-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-mac-release-arm64-try Change-Id: Ia794a33fc607013bf35435b0427ceb02bdae4b0d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419560 Reviewed-by: Daco Harkes <[email protected]> Commit-Queue: Tess Strickland <[email protected]>
1 parent 9f42ef7 commit 3d0a29d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runtime/vm/compiler/backend/slot.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ bool Slot::Equals(const Slot& other) const {
469469
}
470470

471471
switch (kind_) {
472+
#define NATIVE_SLOT_CASE(CN, __, FN, ___, ____) case Kind::k##CN##_##FN:
473+
NATIVE_SLOTS_LIST(NATIVE_SLOT_CASE)
474+
#undef NATIVE_SLOT_CASE
472475
case Kind::kTypeArguments:
473476
case Kind::kTypeArgumentsIndex:
474477
case Kind::kArrayElement:

0 commit comments

Comments
 (0)