Skip to content

Commit 6694aa8

Browse files
rakudramacommit-bot@chromium.org
authored andcommitted
[dart2js] new-rti: Temporary work-around for timeouts
We will remove this in a few weeks when more of the rti runtime is correct. [email protected] Change-Id: I6cf9ff18398aa1a4c2dc1e38a9919165a816a145 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107833 Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Stephen Adams <[email protected]>
1 parent 18ff5ce commit 6694aa8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • sdk/lib/_internal/js_runtime/lib

‎sdk/lib/_internal/js_runtime/lib/rti.dart‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,21 @@ class TypeRule {
10761076

10771077
// Future entry point from compiled code.
10781078
bool isSubtype(universe, Rti s, Rti t) {
1079+
// TODO(sra): When more tests are working, remove this rediculous hack.
1080+
// Temporary 'metering' of isSubtype calls to force tests that endlessly loop
1081+
// to fail.
1082+
int next = JS('int', '(#||0) + 1', _ticks);
1083+
_ticks = next;
1084+
if (next > 10 * 1000 * 1000) {
1085+
throw StateError('Too many isSubtype calls'
1086+
' ${_rtiToString(s, null)} <: ${_rtiToString(t, null)}');
1087+
}
1088+
10791089
return _isSubtype(universe, s, null, t, null);
10801090
}
10811091

1092+
int _ticks = 0;
1093+
10821094
bool _isSubtype(universe, Rti s, sEnv, Rti t, tEnv) {
10831095
// TODO(fishythefish): Update for NNBD. See
10841096
// https://github.com/dart-lang/language/blob/master/resources/type-system/subtyping.md#rules

0 commit comments

Comments
 (0)