28 #ifndef V8_TRANSITIONS_INL_H_
29 #define V8_TRANSITIONS_INL_H_
38 #define FIELD_ADDR(p, offset) \
39 (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag)
41 #define WRITE_FIELD(p, offset, value) \
42 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value)
44 #define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \
45 if (mode == UPDATE_WRITE_BARRIER) { \
46 heap->incremental_marking()->RecordWrite( \
47 object, HeapObject::RawField(object, offset), value); \
48 if (heap->InNewSpace(value)) { \
49 heap->RecordWrite(object->address(), offset); \
55 ASSERT(object->IsTransitionArray());
123 ASSERT(transitions->IsFixedArray());
141 reinterpret_cast<HeapObject*>(
this),
150 String* key = target->instance_descriptors()->GetKey(descriptor);
154 return String::cast(
get(ToKeyIndex(transition_number)));
161 set(ToKeyIndex(transition_number), key);
171 return Map::cast(
get(ToTargetIndex(transition_number)));
181 set(ToTargetIndex(transition_number), value);
199 return internal::Search<ALL_ENTRIES>(
this, name);
203 void TransitionArray::NoIncrementalWriteBarrierSet(
int transition_number,
207 this, ToKeyIndex(transition_number), key);
209 this, ToTargetIndex(transition_number), target);
215 #undef CONDITIONAL_WRITE_BARRIER
220 #endif // V8_TRANSITIONS_INL_H_
Map * elements_transition()
void set(int index, Object *value)
static String * cast(Object *obj)
static Smi * FromInt(int value)
#define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode)
HeapObject * UncheckedPrototypeTransitions()
static const int kElementsTransitionOffset
static Map * cast(Object *obj)
static const int kPrototypeTransitionsIndex
bool IsFullTransitionArray()
void SetKey(int transition_number, String *value)
#define ASSERT(condition)
static const int kElementsTransitionIndex
static const int kSimpleTransitionTarget
void ClearElementsTransition()
Object ** GetPrototypeTransitionsSlot()
static Object ** RawField(HeapObject *obj, int offset)
bool Equals(String *other)
static const int kNotFound
bool HasPrototypeTransitions()
int number_of_transitions()
void SetPrototypeTransitions(FixedArray *prototype_transitions, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
PropertyDetails GetDetails(int descriptor_number)
static const int kSimpleTransitionIndex
static int OffsetOfElementAt(int index)
String * GetKey(int transition_number)
static TransitionArray * cast(Object *obj)
static const int kBackPointerStorageOffset
bool IsSimpleTransition()
bool HasElementsTransition()
Map * GetTarget(int transition_number)
static const int kBackPointerStorageIndex
void set_back_pointer_storage(Object *back_pointer, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
static void NoIncrementalWriteBarrierSet(FixedArray *array, int index, Object *value)
#define WRITE_FIELD(p, offset, value)
static FixedArray * cast(Object *obj)
FixedArray * GetPrototypeTransitions()
Object * back_pointer_storage()
static const int kPrototypeTransitionsOffset
void set_elements_transition(Map *target, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
Object ** GetKeySlot(int transition_number)
void SetTarget(int transition_number, Map *target)
PropertyDetails GetTargetDetails(int transition_number)