From b7cc6de5fdc2c41fb14a108cf6117d9026f775d1 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Sat, 13 Jul 2024 08:25:39 +0000 Subject: [PATCH] [dart2wasm] Remove (now) unsed code in RTT that checks for class correspondence After [0] we now use a row-displacment table for representing the relationship between class and super class. We no longer use per-subclass or per-superclass information. [0] https://dart-review.googlesource.com/c/sdk/+/375281 Change-Id: I249c745d49217955adbe9254a3afa2b2a58dd197 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375560 Reviewed-by: Srujan Gaddam Commit-Queue: Martin Kustermann --- sdk/lib/_internal/wasm/lib/type.dart | 52 ---------------------------- 1 file changed, 52 deletions(-) diff --git a/sdk/lib/_internal/wasm/lib/type.dart b/sdk/lib/_internal/wasm/lib/type.dart index 4de1645641d4..8038cd20ba4b 100644 --- a/sdk/lib/_internal/wasm/lib/type.dart +++ b/sdk/lib/_internal/wasm/lib/type.dart @@ -1026,58 +1026,6 @@ abstract class _TypeUniverse { return (-1).toWasmI32(); } - static WasmI32 _searchSubs(WasmArray table, WasmI32 key) { - for (WasmI32 i = 0.toWasmI32(); - i < table.length.toWasmI32(); - i += 3.toWasmI32()) { - final start = table[i.toIntSigned()]; - final end = table[(i + 1.toWasmI32()).toIntSigned()]; - if (start <= key && key <= end) - return table[(i + 2.toWasmI32()).toIntSigned()]; - } - return (-1).toWasmI32(); - } - - static WasmI32 _searchSupers(WasmArray table, WasmI32 key) { - final WasmI32 end = table.length.toWasmI32() >> 1.toWasmI32(); - return (end < 8.toWasmI32()) - ? _linearSearch(table, end, key) - : _binarySearch(table, end, key); - } - - @pragma('wasm:prefer-inline') - static WasmI32 _linearSearch( - WasmArray table, WasmI32 end, WasmI32 key) { - for (WasmI32 i = 0.toWasmI32(); i < end; i += 1.toWasmI32()) { - if (table[i.toIntSigned()] == key) return end + i; - } - return (-1).toWasmI32(); - } - - @pragma('wasm:prefer-inline') - static WasmI32 _binarySearch( - WasmArray table, WasmI32 end, WasmI32 key) { - WasmI32 lower = 0.toWasmI32(); - WasmI32 upper = end - 1.toWasmI32(); - while (lower <= upper) { - final WasmI32 mid = (lower + upper) >> 1.toWasmI32(); - final WasmI32 entry = table[mid.toIntSigned()]; - if (key < entry) { - upper = mid - 1.toWasmI32(); - continue; - } - if (entry < key) { - lower = mid + 1.toWasmI32(); - continue; - } - assert(entry == key); - assert(_linearSearch(table, end, key) == (end + mid)); - return end + mid; - } - assert(_linearSearch(table, end, key) == (-1).toWasmI32()); - return (-1).toWasmI32(); - } - static bool isFunctionSubtype(_FunctionType s, _Environment? sEnv, _FunctionType t, _Environment? tEnv) { // Set up environments