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

Unified Diff: runtime/vm/object.h

Issue 1947753002: More efficient identification of dynamic and void types. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/debugger.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 564db7248d2e3b292a5603f9930866f33a903cc2..640af8fe6c8309eaf494fd567cc6ba7ae83cec1b 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -5472,23 +5472,17 @@ class AbstractType : public Instance {
// type.
RawString* ClassName() const;
- // Check if this type represents the 'dynamic' type.
- bool IsDynamicType() const {
- return !IsFunctionType() &&
- HasResolvedTypeClass() &&
- (type_class() == Object::dynamic_class());
- }
+ // Check if this type represents the 'dynamic' type or if it is malformed,
+ // since a malformed type is mapped to 'dynamic'.
+ // Call IsMalformed() first, if distinction is required.
+ bool IsDynamicType() const;
+
+ // Check if this type represents the 'void' type.
+ bool IsVoidType() const;
// Check if this type represents the 'Null' type.
bool IsNullType() const;
- // Check if this type represents the 'void' type.
- bool IsVoidType() const {
- return !IsFunctionType() &&
- HasResolvedTypeClass() &&
- (type_class() == Object::void_class());
- }
-
bool IsObjectType() const {
return !IsFunctionType() &&
HasResolvedTypeClass() &&
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698