5 #ifndef V8_PROPERTY_DETAILS_H_
6 #define V8_PROPERTY_DETAILS_H_
38 template<
class>
class TypeImpl;
39 struct ZoneTypeConfig;
40 typedef TypeImpl<ZoneTypeConfig>
Type;
123 if (other.
fits_into(*
this))
return *
this;
131 return sizeof(uint8_t);
189 value_ = TypeField::encode(type)
190 | AttributesField::encode(attributes)
191 | DictionaryStorageField::encode(index);
193 DCHECK(type == this->type());
194 DCHECK(attributes == this->attributes());
200 int field_index = 0) {
201 value_ = TypeField::encode(type)
202 | AttributesField::encode(attributes)
203 | RepresentationField::encode(EncodeRepresentation(representation))
204 | FieldIndexField::encode(field_index);
207 int pointer()
const {
return DescriptorPointer::decode(value_); }
212 return PropertyDetails(value_, representation);
217 return PropertyDetails(value_, new_attributes);
225 return representation.
kind();
235 return AttributesField::decode(value_);
239 return DictionaryStorageField::decode(value_);
244 return DecodeRepresentation(RepresentationField::decode(value_));
248 return FieldIndexField::decode(value_);
254 return DictionaryStorageField::is_valid(index);
260 bool IsDeleted()
const {
return DeletedField::decode(value_) != 0;}
264 class TypeField :
public BitField<PropertyType, 0, 2> {};
274 :
public BitField<uint32_t, 9, kDescriptorIndexBitCount> {};
276 :
public BitField<uint32_t, 9 + kDescriptorIndexBitCount,
277 kDescriptorIndexBitCount> {};
281 static const int kInitialIndex = 1;
285 value_ = DescriptorPointer::update(value, pointer);
288 value_ = RepresentationField::update(
289 value, EncodeRepresentation(representation));
292 value_ = AttributesField::update(value, attributes);
PropertyDetails(Smi *smi)
PropertyDetails CopyAddAttributes(PropertyAttributes new_attributes)
static uint8_t EncodeRepresentation(Representation representation)
int dictionary_index() const
PropertyDetails(int value, Representation representation)
STATIC_ASSERT(9+kDescriptorIndexBitCount+kDescriptorIndexBitCount<=31)
PropertyDetails(PropertyAttributes attributes, PropertyType type, int index)
PropertyDetails CopyWithRepresentation(Representation representation) const
PropertyType type() const
PropertyDetails(PropertyAttributes attributes, PropertyType type, Representation representation, int field_index=0)
PropertyDetails(int value, PropertyAttributes attributes)
PropertyDetails set_pointer(int i)
static bool IsValidIndex(int index)
static Representation DecodeRepresentation(uint32_t bits)
bool IsConfigurable() const
PropertyDetails(int value, int pointer)
PropertyAttributes attributes() const
Representation representation() const
PropertyDetails AsDeleted() const
static Representation FromType(Type *type)
bool is_more_general_than(const Representation &other) const
static Representation Double()
const char * Mnemonic() const
static Representation UInteger8()
bool IsUInteger16() const
bool fits_into(const Representation &other) const
bool IsSpecialization() const
STATIC_ASSERT(kNumRepresentations<=(1<< kBitsPerByte))
bool IsCompatibleForStore(const Representation &other) const
static Representation External()
bool IsSmiOrTagged() const
bool IsHeapObject() const
static Representation Integer8()
static Representation Smi()
bool IsSmiOrInteger32() const
bool IsCompatibleForLoad(const Representation &other) const
Representation generalize(Representation other)
static Representation Integer32()
static Representation Integer16()
static Representation HeapObject()
bool Equals(const Representation &other) const
static Representation UInteger16()
static Representation Tagged()
static Representation None()
static Representation FromKind(Kind kind)
#define DCHECK(condition)
TypeImpl< ZoneTypeConfig > Type
static const int kInvalidEnumCacheSentinel
static const int kMaxNumberOfDescriptors
static const int kDescriptorIndexBitCount
Debugger support for the V8 JavaScript engine.