Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1552)

Unified Diff: runtime/lib/object_patch.dart

Issue 2379733002: Recognize and optimize a.runtimeType == b.runtimeType pattern. (Closed)
Patch Set: Done Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/object_patch.dart
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 0af593d779c0157e881701fd796d5ff13caf6635..4fb4db5a8996abf2484f25611f9600a14b5e3daa 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -53,6 +53,8 @@
@patch Type get runtimeType native "Object_runtimeType";
siva 2016/09/29 02:28:20 One could recover some of the lost effectiveness o
Vyacheslav Egorov (Google) 2016/09/29 15:01:43 This is precisely what intrinsic is doing. Howev
Florian Schneider 2016/09/29 18:03:28 I think Siva's suggestion would simplify the hand-
Vyacheslav Egorov (Google) 2016/09/30 09:56:27 I did measurements: it's 30-50% slower than the in
Florian Schneider 2016/09/30 17:42:56 Sounds good!
+ static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType";
+
// Call this function instead of inlining instanceof, thus collecting
// type feedback and reducing code size of unoptimized code.
bool _instanceOf(instantiator_type_arguments, type, bool negate)

Powered by Google App Engine
This is Rietveld 408576698