| OLD | NEW |
| 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 #include "types.h" | 5 #include "types.h" |
| 6 | 6 |
| 7 #include "string-stream.h" | 7 #include "string-stream.h" |
| 8 #include "types-inl.h" | 8 #include "types-inl.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 template<class Config> | 365 template<class Config> |
| 366 bool TypeImpl<Config>::Contains(i::Object* value) { | 366 bool TypeImpl<Config>::Contains(i::Object* value) { |
| 367 for (Iterator<i::Object> it = this->Constants(); !it.Done(); it.Advance()) { | 367 for (Iterator<i::Object> it = this->Constants(); !it.Done(); it.Advance()) { |
| 368 if (*it.Current() == value) return true; | 368 if (*it.Current() == value) return true; |
| 369 } | 369 } |
| 370 return Config::from_bitset(LubBitset(value))->Is(this); | 370 return Config::from_bitset(LubBitset(value))->Is(this); |
| 371 } | 371 } |
| 372 | 372 |
| 373 | 373 |
| 374 template<class Config> | 374 template<class Config> |
| 375 bool TypeImpl<Config>::NowContains(i::Object* value) { | |
| 376 DisallowHeapAllocation no_allocation; | |
| 377 if (value->IsHeapObject()) { | |
| 378 i::Map* map = i::HeapObject::cast(value)->map(); | |
| 379 for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) { | |
| 380 if (*it.Current() == map) return true; | |
| 381 } | |
| 382 } | |
| 383 return this->Contains(value); | |
| 384 } | |
| 385 | |
| 386 | |
| 387 template<class Config> | |
| 388 bool TypeImpl<Config>::InUnion(StructHandle unioned, int current_size) { | 375 bool TypeImpl<Config>::InUnion(StructHandle unioned, int current_size) { |
| 389 ASSERT(!this->IsUnion()); | 376 ASSERT(!this->IsUnion()); |
| 390 for (int i = 0; i < current_size; ++i) { | 377 for (int i = 0; i < current_size; ++i) { |
| 391 TypeHandle type = Config::struct_get(unioned, i); | 378 TypeHandle type = Config::struct_get(unioned, i); |
| 392 if (this->Is(type)) return true; | 379 if (this->Is(type)) return true; |
| 393 } | 380 } |
| 394 return false; | 381 return false; |
| 395 } | 382 } |
| 396 | 383 |
| 397 | 384 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 675 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
| 689 | 676 |
| 690 template TypeImpl<ZoneTypeConfig>::TypeHandle | 677 template TypeImpl<ZoneTypeConfig>::TypeHandle |
| 691 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 678 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
| 692 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 679 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
| 693 template TypeImpl<HeapTypeConfig>::TypeHandle | 680 template TypeImpl<HeapTypeConfig>::TypeHandle |
| 694 TypeImpl<HeapTypeConfig>::Convert<Type>( | 681 TypeImpl<HeapTypeConfig>::Convert<Type>( |
| 695 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 682 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
| 696 | 683 |
| 697 } } // namespace v8::internal | 684 } } // namespace v8::internal |
| OLD | NEW |