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

Unified Diff: src/types.h

Issue 234743003: Inline TypeImpl::NowContains(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/types.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 18b22239a2dd30cf435de75babe2cfe99ed05b6e..8caba7a52794eeca2fe97ec70456c852866a4fc2 100644
--- a/src/types.h
+++ b/src/types.h
@@ -271,7 +271,17 @@ class TypeImpl : public Config::Base {
bool NowIs(TypeImpl* that);
template<class TypeHandle>
bool NowIs(TypeHandle that) { return this->NowIs(*that); }
- bool NowContains(i::Object* val);
+ bool NowContains(i::Object* val) {
rossberg 2014/04/11 09:19:37 Can we move that to types-inl?
Benedikt Meurer 2014/04/11 09:23:30 Done.
+ DisallowHeapAllocation no_allocation;
+ if (this->IsAny()) return true;
+ if (val->IsHeapObject()) {
+ i::Map* map = i::HeapObject::cast(val)->map();
+ for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
+ if (*it.Current() == map) return true;
+ }
+ }
+ return this->Contains(val);
+ }
bool NowContains(i::Handle<i::Object> val) { return this->NowContains(*val); }
bool IsClass() { return Config::is_class(this); }
« no previous file with comments | « no previous file | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698