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

Unified Diff: runtime/vm/object.cc

Issue 1222863003: Make frequent type checks (instanceof) faster by adding dedicated instanceof methods; improves dart… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: flag Created 5 years, 5 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 79689346507076d9ad80316a2a4888335a6b6dd2..6f88bbdc2685b86f60028bdb277ef74386ec688e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14898,6 +14898,12 @@ bool AbstractType::IsNumberType() const {
}
+bool AbstractType::IsSmiType() const {
+ return HasResolvedTypeClass() &&
+ (type_class() == Type::Handle(Type::SmiType()).type_class());
+}
+
+
bool AbstractType::IsStringType() const {
return HasResolvedTypeClass() &&
(type_class() == Type::Handle(Type::StringType()).type_class());
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698