| 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 #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 "src/types.h" | 8 #include "src/types.h" |
| 9 | 9 |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 typename TypeImpl<Config>::bitset | 26 typename TypeImpl<Config>::bitset |
| 27 TypeImpl<Config>::BitsetType::UnsignedSmall() { | 27 TypeImpl<Config>::BitsetType::UnsignedSmall() { |
| 28 return i::SmiValuesAre31Bits() ? kUnsigned30 : kUnsigned31; | 28 return i::SmiValuesAre31Bits() ? kUnsigned30 : kUnsigned31; |
| 29 } | 29 } |
| 30 | 30 |
| 31 | 31 |
| 32 template<class Config> | 32 template<class Config> |
| 33 TypeImpl<Config>* TypeImpl<Config>::cast(typename Config::Base* object) { | 33 TypeImpl<Config>* TypeImpl<Config>::cast(typename Config::Base* object) { |
| 34 TypeImpl* t = static_cast<TypeImpl*>(object); | 34 TypeImpl* t = static_cast<TypeImpl*>(object); |
| 35 DCHECK(t->IsBitset() || t->IsClass() || t->IsConstant() || t->IsRange() || | 35 DCHECK(t->IsBitset() || t->IsClass() || t->IsConstant() || t->IsRange() || |
| 36 t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsContext()); | 36 t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsObject() || |
| 37 t->IsContext()); |
| 37 return t; | 38 return t; |
| 38 } | 39 } |
| 39 | 40 |
| 40 | 41 |
| 41 // Most precise _current_ type of a value (usually its class). | 42 // Most precise _current_ type of a value (usually its class). |
| 42 template<class Config> | 43 template<class Config> |
| 43 typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf( | 44 typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf( |
| 44 i::Object* value, Region* region) { | 45 i::Object* value, Region* region) { |
| 45 if (value->IsSmi() || | 46 if (value->IsSmi() || |
| 46 i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE) { | 47 i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE) { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 void HeapTypeConfig::range_set_double(i::Handle<HeapTypeConfig::Range> range, | 482 void HeapTypeConfig::range_set_double(i::Handle<HeapTypeConfig::Range> range, |
| 482 int index, double value, | 483 int index, double value, |
| 483 Isolate* isolate) { | 484 Isolate* isolate) { |
| 484 DCHECK(index >= 0 && index < 2); | 485 DCHECK(index >= 0 && index < 2); |
| 485 i::Handle<Object> number = isolate->factory()->NewNumber(value); | 486 i::Handle<Object> number = isolate->factory()->NewNumber(value); |
| 486 range->set(index + 2, *number); | 487 range->set(index + 2, *number); |
| 487 } | 488 } |
| 488 } } // namespace v8::internal | 489 } } // namespace v8::internal |
| 489 | 490 |
| 490 #endif // V8_TYPES_INL_H_ | 491 #endif // V8_TYPES_INL_H_ |
| OLD | NEW |