[rti] Codegen improvements in isSubtype.

Change-Id: If68a3c150b33e2029d7e6538cb3efff23bb9809f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333701
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
Mayank Patke 2023-11-02 21:37:38 +00:00 committed by Commit Queue
parent 1405695675
commit 7a343d0cc1

View file

@ -3262,10 +3262,12 @@ bool isSubtype(Object? universe, Rti s, Rti t) {
result = _isSubtypeUncached(universe, s, t);
_Utils.mapSet(sCache, t, result);
}
if (result == _subtypeResultFalse) return false;
if (result == _subtypeResultTrue) return true;
_onExtraNullSafetyError(
_InconsistentSubtypingError._forTypes(s, t), StackTrace.current);
if (_subtypeResultFalse == result) return false;
if (_subtypeResultTrue == result) return true;
if (JS_GET_FLAG('EXTRA_NULL_SAFETY_CHECKS')) {
_onExtraNullSafetyError(
_InconsistentSubtypingError._forTypes(s, t), StackTrace.current);
}
return true;
}