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

Unified Diff: src/types.h

Issue 78023002: Use Type in CheckPrototypes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/stub-cache.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | 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 2e21a9e7b8422a19213414a5934df632d38c8bf0..f929a6cde41e868eed8307057db6fc96c46f1c32 100644
--- a/src/types.h
+++ b/src/types.h
@@ -163,6 +163,15 @@ class Type : public Object {
bool Is(Type* that) { return (this == that) ? true : SlowIs(that); }
bool Is(Handle<Type> that) { return this->Is(*that); }
+ bool IsCurrently(Type* that) {
+ if (this->Is(that)) return true;
+ if (!IsConstant()) return false;
+ Handle<i::Object> value = AsConstant();
+ if (!value->IsHeapObject()) return false;
+ if (!that->IsClass()) return false;
+ return HeapObject::cast(*value)->map() == *that->AsClass();
+ }
+ bool IsCurrently(Handle<Type> that) { return this->IsCurrently(*that); }
bool Maybe(Type* that);
bool Maybe(Handle<Type> that) { return this->Maybe(*that); }
« no previous file with comments | « src/stub-cache.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698