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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 i::Map* map = i::HeapObject::cast(object)->map(); | 352 i::Map* map = i::HeapObject::cast(object)->map(); |
353 for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) { | 353 for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) { |
354 if (*it.Current() == map) return true; | 354 if (*it.Current() == map) return true; |
355 } | 355 } |
356 } | 356 } |
357 } | 357 } |
358 return this->Is(that); | 358 return this->Is(that); |
359 } | 359 } |
360 | 360 |
361 | 361 |
| 362 // Check if this contains only (currently) stable classes. |
| 363 template<class Config> |
| 364 bool TypeImpl<Config>::NowStable() { |
| 365 DisallowHeapAllocation no_allocation; |
| 366 for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) { |
| 367 if (!it.Current()->is_stable()) return false; |
| 368 } |
| 369 return true; |
| 370 } |
| 371 |
| 372 |
362 // Check this overlaps that. | 373 // Check this overlaps that. |
363 template<class Config> | 374 template<class Config> |
364 bool TypeImpl<Config>::Maybe(TypeImpl* that) { | 375 bool TypeImpl<Config>::Maybe(TypeImpl* that) { |
365 DisallowHeapAllocation no_allocation; | 376 DisallowHeapAllocation no_allocation; |
366 | 377 |
367 // (T1 \/ ... \/ Tn) overlaps T <=> (T1 overlaps T) \/ ... \/ (Tn overlaps T) | 378 // (T1 \/ ... \/ Tn) overlaps T <=> (T1 overlaps T) \/ ... \/ (Tn overlaps T) |
368 if (this->IsUnion()) { | 379 if (this->IsUnion()) { |
369 UnionHandle unioned = handle(this->AsUnion()); | 380 UnionHandle unioned = handle(this->AsUnion()); |
370 for (int i = 0; i < unioned->Length(); ++i) { | 381 for (int i = 0; i < unioned->Length(); ++i) { |
371 if (unioned->Get(i)->Maybe(that)) return true; | 382 if (unioned->Get(i)->Maybe(that)) return true; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 772 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
762 | 773 |
763 template TypeImpl<ZoneTypeConfig>::TypeHandle | 774 template TypeImpl<ZoneTypeConfig>::TypeHandle |
764 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 775 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
765 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 776 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
766 template TypeImpl<HeapTypeConfig>::TypeHandle | 777 template TypeImpl<HeapTypeConfig>::TypeHandle |
767 TypeImpl<HeapTypeConfig>::Convert<Type>( | 778 TypeImpl<HeapTypeConfig>::Convert<Type>( |
768 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 779 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
769 | 780 |
770 } } // namespace v8::internal | 781 } } // namespace v8::internal |
OLD | NEW |