f5892dafe6
HInstanceEnvironment returns the type of an instance, which gives access to all type variables of the supertypes. HInstanceEnvironment is currently lowered to a call to 'instanceType', but we expect to lower to a field access in most cases, or a constant type which can be folded into subsequent operations. The type_builder builds a type environment for each type expression. The environment is build from the instance type scope and the function type scopes. GVN optimizations already introduce more sharing, but it might be advantageous to pre-compute the environment and sink the operations instead. Later we will pass multiple type arguments as tuples which will reduce the number of operations, especially in factory constructors. There are some tweaks removing types in rti.dart to avoid re-entrant code. Change-Id: I004adf7a8a464e575b32d59476c888db46542fde Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107460 Commit-Queue: Stephen Adams <sra@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com>