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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 } | 299 } |
300 return false; | 300 return false; |
301 } | 301 } |
302 | 302 |
303 return false; | 303 return false; |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 template<class Config> | 307 template<class Config> |
308 bool TypeImpl<Config>::NowIs(TypeImpl* that) { | 308 bool TypeImpl<Config>::NowIs(TypeImpl* that) { |
| 309 DisallowHeapAllocation no_allocation; |
309 if (this->IsConstant()) { | 310 if (this->IsConstant()) { |
310 DisallowHeapAllocation no_allocation; | |
311 i::Object* object = *this->AsConstant(); | 311 i::Object* object = *this->AsConstant(); |
312 if (object->IsHeapObject()) { | 312 if (object->IsHeapObject()) { |
313 i::Map* map = i::HeapObject::cast(object)->map(); | 313 i::Map* map = i::HeapObject::cast(object)->map(); |
314 for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) { | 314 for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) { |
315 if (*it.Current() == map) return true; | 315 if (*it.Current() == map) return true; |
316 } | 316 } |
317 } | 317 } |
318 } | 318 } |
319 return this->Is(that); | 319 return this->Is(that); |
320 } | 320 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 375 bool TypeImpl<Config>::NowContains(i::Object* value) { |
| 376 DisallowHeapAllocation no_allocation; |
376 if (value->IsHeapObject()) { | 377 if (value->IsHeapObject()) { |
377 DisallowHeapAllocation no_allocation; | |
378 i::Map* map = i::HeapObject::cast(value)->map(); | 378 i::Map* map = i::HeapObject::cast(value)->map(); |
379 for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) { | 379 for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) { |
380 if (*it.Current() == map) return true; | 380 if (*it.Current() == map) return true; |
381 } | 381 } |
382 } | 382 } |
383 return this->Contains(value); | 383 return this->Contains(value); |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 template<class Config> | 387 template<class Config> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 688 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
689 | 689 |
690 template TypeImpl<ZoneTypeConfig>::TypeHandle | 690 template TypeImpl<ZoneTypeConfig>::TypeHandle |
691 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 691 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
692 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 692 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
693 template TypeImpl<HeapTypeConfig>::TypeHandle | 693 template TypeImpl<HeapTypeConfig>::TypeHandle |
694 TypeImpl<HeapTypeConfig>::Convert<Type>( | 694 TypeImpl<HeapTypeConfig>::Convert<Type>( |
695 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 695 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
696 | 696 |
697 } } // namespace v8::internal | 697 } } // namespace v8::internal |
OLD | NEW |