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

Unified Diff: src/types.h

Issue 18843002: Add Type::cast (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.h
diff --git a/src/types.h b/src/types.h
index a2bcda65791646c57464a5d85a908564efc5587a..31aa9512f4c3a44433412fc836df800ea5efe524 100644
--- a/src/types.h
+++ b/src/types.h
@@ -184,6 +184,13 @@ class Type : public Object {
return Iterator<v8::internal::Object>(this->handle());
}
+ static Type* cast(v8::internal::Object* object) {
+ Type* t = static_cast<Type*>(object);
+ ASSERT(t->is_bitset() || t->is_class() ||
+ t->is_constant() || t->is_union());
+ return t;
+ }
+
private:
// A union is a fixed array containing types. Invariants:
// - its length is at least 2
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698