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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return Config::union_get(this->AsUnion(), 0)->GlbBitset(); | 242 return Config::union_get(this->AsUnion(), 0)->GlbBitset(); |
243 } else { | 243 } else { |
244 return kNone; | 244 return kNone; |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
248 | 248 |
249 // Most precise _current_ type of a value (usually its class). | 249 // Most precise _current_ type of a value (usually its class). |
250 template<class Config> | 250 template<class Config> |
251 typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf( | 251 typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf( |
252 i::Handle<i::Object> value, Region* region) { | 252 i::Object* value, Region* region) { |
253 if (value->IsSmi() || | 253 if (value->IsSmi() || |
254 i::HeapObject::cast(*value)->map()->instance_type() == HEAP_NUMBER_TYPE || | 254 i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE || |
255 i::HeapObject::cast(*value)->map()->instance_type() == ODDBALL_TYPE) { | 255 i::HeapObject::cast(value)->map()->instance_type() == ODDBALL_TYPE) { |
256 return Of(value, region); | 256 return Of(value, region); |
257 } | 257 } |
258 return Class(i::handle(i::HeapObject::cast(*value)->map()), region); | 258 return Class(i::handle(i::HeapObject::cast(value)->map()), region); |
259 } | 259 } |
260 | 260 |
261 | 261 |
262 // Check this <= that. | 262 // Check this <= that. |
263 template<class Config> | 263 template<class Config> |
264 bool TypeImpl<Config>::SlowIs(TypeImpl* that) { | 264 bool TypeImpl<Config>::SlowIs(TypeImpl* that) { |
265 // Fast path for bitsets. | 265 // Fast path for bitsets. |
266 if (this->IsNone()) return true; | 266 if (this->IsNone()) return true; |
267 if (that->IsBitset()) { | 267 if (that->IsBitset()) { |
268 return (this->LubBitset() | that->AsBitset()) == that->AsBitset(); | 268 return (this->LubBitset() | that->AsBitset()) == that->AsBitset(); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 678 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
679 | 679 |
680 template TypeImpl<ZoneTypeConfig>::TypeHandle | 680 template TypeImpl<ZoneTypeConfig>::TypeHandle |
681 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 681 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
682 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 682 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
683 template TypeImpl<HeapTypeConfig>::TypeHandle | 683 template TypeImpl<HeapTypeConfig>::TypeHandle |
684 TypeImpl<HeapTypeConfig>::Convert<Type>( | 684 TypeImpl<HeapTypeConfig>::Convert<Type>( |
685 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 685 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
686 | 686 |
687 } } // namespace v8::internal | 687 } } // namespace v8::internal |
OLD | NEW |