commit | 3770ffb53ea0dd7108519517a4455665282b1de6 | [log] [tgz] |
---|---|---|
author | Stephen Adams <sra@google.com> | Wed Jan 23 21:27:55 2019 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Wed Jan 23 21:27:55 2019 +0000 |
tree | 89a5372e7dd0b556a6b5f704a3fbfba2513a1041 | |
parent | 27316cc97b19c53b693b2ffe93fcb6993c4be86b [diff] |
[js_runtime] Not worth inlining TypeImpl.== Change-Id: I7d04aa903abb653f6cec12631b4153cd493bd66c Reviewed-on: https://dart-review.googlesource.com/c/90581 Commit-Queue: Stephen Adams <sra@google.com> Reviewed-by: Stephen Adams <sra@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart index 9a6ef99..bdef059 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -60,6 +60,7 @@ // TODO(ahe): This is a poor hashCode as it collides with its name. int get hashCode => _hashCode ??= _typeName.hashCode; + @pragma('dart2js:noInline') bool operator ==(other) { return (other is TypeImpl) && _typeName == other._typeName; }
diff --git a/tests/compiler/dart2js/rti/emission/dynamic_type_literal.dart b/tests/compiler/dart2js/rti/emission/dynamic_type_literal.dart index 8f7ce92..66d91cf 100644 --- a/tests/compiler/dart2js/rti/emission/dynamic_type_literal.dart +++ b/tests/compiler/dart2js/rti/emission/dynamic_type_literal.dart
@@ -6,7 +6,7 @@ import "package:expect/expect.dart"; -void main() { +void main(bool b) { Expect.isTrue(dynamic is Type); - Expect.isFalse(dynamic == Type); + Expect.isFalse(dynamic == (b ? Type : dynamic)); // ?: avoids constant folding }