dart-sdk/pkg/dart2wasm/lib
Martin Kustermann 0bc92a4333 [dart2wasm] Remove usage of type category table
The type category table is a O(number-of-classes) sized byte array that
maps from class-id to either a type category (function, record, ...) or
a masqueraded class-id.

* for flute this table takes up around 1 KB.
* this prevents from making concrete class-ids come before all abstract
  class ids

After recent changes the core RTT implementation no longer involves
masqueraded types (i.e. `<obj> is/as <type>` and `<type> <: <type>`
queries don't trigger masquerading functionality)

This CL removes the type category table, the special casing in the
class-id assignment and the compiler support for building the table.

Instead we move the logic to pure dart code, which can use normal `is`
checks to perform its function.

We add one optimization: The compiler will provide the class-id from
which one only non-masqueraded classes come. This makes the masquerading
function have a fast path.

* We use `Wasm{TypedData,String}Base` marker interfaces i
 `dart:_internal` to check for wasm-backed implementations
* We use `-Ddart.wasm.js_compatibility` to provide JSCM mode

We add a test that actually exercises the 2 modes.

Change-Id: I051c35b17878950402a1336df871a686b649f732
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349641
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-02 19:01:49 +00:00
..
js [dart2wasm] Add support for testing dart2wasm with JSC 2024-01-22 12:04:37 +00:00
abi.dart
async.dart [dart2wasm] Implement wrapping awaited values with Future.value 2024-01-08 12:19:30 +00:00
await_transformer.dart
class_info.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
closures.dart [dart2wasm] Implement wrapping awaited values with Future.value 2024-01-08 12:19:30 +00:00
code_generator.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
compile.dart Add new dart compile wasm command. 2023-12-05 15:44:53 +00:00
compiler_options.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
constants.dart [dart2wasm] Improve dispatch table call 2024-01-25 22:16:41 +00:00
dart2wasm.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
dispatch_table.dart [dart2wasm] Improve dispatch table packing from 49% to 99% 2024-01-26 14:44:08 +00:00
dynamic_forwarders.dart [dart2wasm] Improve dispatch table call 2024-01-25 22:16:41 +00:00
ffi_native_transformer.dart [vm/ffi]: Add Native.addressOf 2023-12-05 13:10:36 +00:00
functions.dart [dart2wasm] Improve dispatch table call 2024-01-25 22:16:41 +00:00
generate_wasm.dart [dart2wasm] Make dart compile wasm use AOT-compiled dart2wasm via subprocess 2024-01-24 13:20:15 +00:00
globals.dart
intrinsics.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
kernel_nodes.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00
list_factory_specializer.dart
option.dart Add new dart compile wasm command. 2023-12-05 15:44:53 +00:00
param_info.dart [dart2wasm] ParamInfo documentation and minor refactoring 2023-12-11 22:21:27 +00:00
record_class_generator.dart [dart2wasm] Record type related cleanups 2024-02-02 11:52:23 +00:00
records.dart
reference_extensions.dart
sync_star.dart [dart2wasm] Improve dispatch table call 2024-01-25 22:16:41 +00:00
target.dart [macros] Add dart:_macros 2024-02-02 07:47:59 +00:00
transformers.dart [dart2wasm] Simplify and fix async* element type computation 2023-12-20 08:31:25 +00:00
translator.dart [dart2wasm] Use class-id range checks in optimized type check implementation 2024-01-31 21:32:00 +00:00
types.dart [dart2wasm] Remove usage of type category table 2024-02-02 19:01:49 +00:00