Commit 2461d2a5 authored by rossberg@chromium.org's avatar rossberg@chromium.org

Add Type::cast

R=danno@chromium.org
BUG=

Review URL: https://codereview.chromium.org/18843002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7ab931ee
......@@ -15850,8 +15850,8 @@ MaybeObject* PropertyCell::SetValueInferType(Object* value,
&PropertyCell::UpdateType,
Handle<PropertyCell>(this),
Handle<Object>(value, GetIsolate()));
if (maybe_type->IsFailure()) return maybe_type;
Type* new_type = static_cast<Type*>(maybe_type);
Type* new_type;
if (maybe_type->To(&new_type)) return maybe_type;
set_type(new_type);
}
return value;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment