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

Unified Diff: runtime/vm/object.h

Issue 1157003003: Add TypedData instance kinds. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 8027aaf3c7ceb46e7b2ecfb99ce3f3682a702934..454518e2062d0a1e03aea0474fb2465761d5a8d0 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6797,6 +6797,15 @@ class TypedData : public Instance {
return ElementSizeInBytes(cid);
}
+ const char* ElementTypeName() const {
+ switch (ElementType()) {
+#define V(name) case k##name##Element: return #name;
+CLASS_LIST_TYPED_DATA(V)
+#undef V
+ }
+ UNREACHABLE();
+ return "UnknownTypedDataElementType";
+ }
TypedDataElementType ElementType() const {
intptr_t cid = raw()->GetClassId();
@@ -6973,6 +6982,16 @@ class ExternalTypedData : public Instance {
return ElementSizeInBytes(cid);
}
+ const char* ElementTypeName() const {
+ switch (ElementType()) {
+#define V(name) case k##name##Element: return #name;
+CLASS_LIST_TYPED_DATA(V)
+#undef V
+ }
+ UNREACHABLE();
+ return "UnknownTypedDataElementType";
+ }
+
TypedDataElementType ElementType() const {
intptr_t cid = raw()->GetClassId();
return ElementType(cid);

Powered by Google App Engine
This is Rietveld 408576698