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

Unified Diff: src/field-type.h

Issue 1703513002: [runtime] More LookupIterator / Transition related performance tweaks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 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 | « no previous file | src/field-type.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/field-type.h
diff --git a/src/field-type.h b/src/field-type.h
index e390fca53ee39cbd3af0a1aa63a6915725c72ab0..eb7ffcab477ae6b505288c4aaf6c540d8d2cd54c 100644
--- a/src/field-type.h
+++ b/src/field-type.h
@@ -22,8 +22,15 @@ class FieldType : public Object {
static Handle<FieldType> Class(i::Handle<i::Map> map, Isolate* isolate);
static FieldType* cast(Object* object);
- bool NowContains(Object* value);
- bool NowContains(Handle<Object> value);
+ bool NowContains(Object* value) {
+ if (this == Any()) return true;
+ if (this == None()) return false;
+ if (!value->IsHeapObject()) return false;
+ return HeapObject::cast(value)->map() == Map::cast(this);
+ }
+
+ bool NowContains(Handle<Object> value) { return NowContains(*value); }
+
bool IsClass();
Handle<i::Map> AsClass();
bool IsNone() { return this == None(); }
« no previous file with comments | « no previous file | src/field-type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698