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

Side by Side Diff: src/types-inl.h

Issue 234743003: Inline TypeImpl::NowContains(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make Andreas happy. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TYPES_INL_H_ 5 #ifndef V8_TYPES_INL_H_
6 #define V8_TYPES_INL_H_ 6 #define V8_TYPES_INL_H_
7 7
8 #include "types.h" 8 #include "types.h"
9 9
10 #include "factory.h" 10 #include "factory.h"
11 #include "handles-inl.h" 11 #include "handles-inl.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 template<class Config>
17 bool TypeImpl<Config>::NowContains(i::Object* value) {
18 DisallowHeapAllocation no_allocation;
19 if (this->IsAny()) return true;
20 if (value->IsHeapObject()) {
21 i::Map* map = i::HeapObject::cast(value)->map();
22 for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
23 if (*it.Current() == map) return true;
24 }
25 }
26 return this->Contains(value);
27 }
28
29
16 // static 30 // static
17 Type* ZoneTypeConfig::handle(Type* type) { 31 Type* ZoneTypeConfig::handle(Type* type) {
18 return type; 32 return type;
19 } 33 }
20 34
21 35
22 // static 36 // static
23 bool ZoneTypeConfig::is_bitset(Type* type) { 37 bool ZoneTypeConfig::is_bitset(Type* type) {
24 return reinterpret_cast<intptr_t>(type) & 1; 38 return reinterpret_cast<intptr_t>(type) & 1;
25 } 39 }
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 309
296 310
297 // static 311 // static
298 int HeapTypeConfig::lub_bitset(Type* type) { 312 int HeapTypeConfig::lub_bitset(Type* type) {
299 return 0; // kNone, which causes recomputation. 313 return 0; // kNone, which causes recomputation.
300 } 314 }
301 315
302 } } // namespace v8::internal 316 } } // namespace v8::internal
303 317
304 #endif // V8_TYPES_INL_H_ 318 #endif // V8_TYPES_INL_H_
OLDNEW
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698