1806e4ce65
The `_as` methods for primitive types are designed to be called from both the `_as` selector and directly from generated code. For the primitive types that are known at compile time and cannot change via linking or hot reload, we can generate direct calls. Adapted from https://dart-review.googlesource.com/c/sdk/+/420380 In addition to the base change: * Remove `int` cast helpers from DDC only code in favor of the versions from dart:_rti. * Moves existing optimizations from `visitAsExpression` to `_emitCast` to apply them consistently. Change-Id: I13d24e3756400f2358556812728db17bc73f544a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427040 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Stephen Adams <sra@google.com>