28 #ifndef V8_PROPERTY_DETAILS_H_
29 #define V8_PROPERTY_DETAILS_H_
31 #include "../include/v8.h"
61 template<
class>
class TypeImpl;
122 return kind_ == other.kind_;
144 return kind_ > other.kind_;
154 if (other.
fits_into(*
this))
return *
this;
162 return sizeof(uint8_t);
168 return sizeof(uint32_t);
204 static const int kDescriptorIndexBitCount = 10;
207 static const int kMaxNumberOfDescriptors =
208 (1 << kDescriptorIndexBitCount) - 2;
209 static const int kInvalidEnumCacheSentinel =
210 (1 << kDescriptorIndexBitCount) - 1;
220 value_ = TypeField::encode(type)
221 | AttributesField::encode(attributes)
222 | DictionaryStorageField::encode(index);
224 ASSERT(type == this->type());
225 ASSERT(attributes == this->attributes());
231 int field_index = 0) {
232 value_ = TypeField::encode(type)
233 | AttributesField::encode(attributes)
234 | RepresentationField::encode(EncodeRepresentation(representation))
235 | FieldIndexField::encode(field_index);
238 int pointer()
const {
return DescriptorPointer::decode(value_); }
240 PropertyDetails
set_pointer(
int i) {
return PropertyDetails(value_, i); }
243 return PropertyDetails(value_, representation);
248 return PropertyDetails(value_, new_attributes);
252 explicit inline PropertyDetails(
Smi* smi);
253 inline Smi* AsSmi()
const;
256 return representation.
kind();
266 return AttributesField::decode(value_);
270 return DictionaryStorageField::decode(value_);
275 return DecodeRepresentation(RepresentationField::decode(value_));
279 return FieldIndexField::decode(value_);
282 inline PropertyDetails AsDeleted()
const;
285 return DictionaryStorageField::is_valid(index);
291 bool IsDeleted()
const {
return DeletedField::decode(value_) != 0;}
295 class TypeField:
public BitField<PropertyType, 0, 3> {};
305 kDescriptorIndexBitCount> {};
307 10 + kDescriptorIndexBitCount,
308 kDescriptorIndexBitCount> {};
310 STATIC_ASSERT(10 + kDescriptorIndexBitCount + kDescriptorIndexBitCount <= 31);
312 static const int kInitialIndex = 1;
315 PropertyDetails(
int value,
int pointer) {
316 value_ = DescriptorPointer::update(value, pointer);
319 value_ = RepresentationField::update(
320 value, EncodeRepresentation(representation));
323 value_ = AttributesField::update(value, attributes);
331 #endif // V8_PROPERTY_DETAILS_H_
bool is_more_general_than(const Representation &other) const
static Representation UInteger8()
bool IsUInteger16() const
PropertyDetails CopyAddAttributes(PropertyAttributes new_attributes)
static Representation Smi()
Representation representation() const
bool IsCompatibleForStore(const Representation &other) const
static uint8_t EncodeRepresentation(Representation representation)
static Representation Integer32()
PropertyType type() const
TypeImpl< ZoneTypeConfig > Type
PropertyDetails set_pointer(int i)
#define ASSERT(condition)
bool IsHeapObject() const
static Representation Double()
static Representation Integer16()
static Representation FromType(Type *type)
const char * Mnemonic() const
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
static Representation FromKind(Kind kind)
static Representation HeapObject()
PropertyAttributes attributes() const
static bool IsValidIndex(int index)
bool Equals(const Representation &other) const
bool IsSmiOrInteger32() const
bool CanContainDouble(double value)
static Representation DecodeRepresentation(uint32_t bits)
static Representation External()
Representation generalize(Representation other)
bool IsCompatibleForLoad(const Representation &other) const
PropertyDetails(PropertyAttributes attributes, PropertyType type, int index)
PropertyDetails(PropertyAttributes attributes, PropertyType type, Representation representation, int field_index=0)
bool fits_into(const Representation &other) const
PropertyDetails CopyWithRepresentation(Representation representation) const
static Representation UInteger16()
static Representation Integer8()
bool IsSmiOrTagged() const
static Representation None()
static Representation Tagged()
bool IsSpecialization() const
bool IsDontDelete() const
int dictionary_index() const