28 #ifndef V8_PROPERTY_H_
29 #define V8_PROPERTY_H_
52 if (!StringShape(key_).IsSymbol()) {
53 MaybeObject* maybe_result =
HEAP->LookupSymbol(key_);
54 if (!maybe_result->To(&key_))
return maybe_result;
64 void Print(FILE* out);
68 details_ = PropertyDetails(details_.attributes(), details_.type(), index);
76 PropertyDetails details_;
99 details_(attributes, type, index) { }
111 : Descriptor(key,
Smi::FromInt(field_index), attributes,
FIELD, index) {}
131 : Descriptor(key, foreign, attributes,
CALLBACKS, index) {}
139 next_(isolate->top_lookup_result()),
140 lookup_type_(NOT_FOUND),
148 ASSERT(isolate_->top_lookup_result() ==
this);
149 isolate_->SetTopLookupResult(next_);
153 lookup_type_ = DESCRIPTOR_TYPE;
160 lookup_type_ = TRANSITION_TYPE;
167 lookup_type_ = CONSTANT_TYPE;
170 PropertyDetails(static_cast<PropertyAttributes>(
DONT_ENUM |
177 lookup_type_ = DICTIONARY_TYPE;
184 lookup_type_ = HANDLER_TYPE;
191 lookup_type_ = INTERCEPTOR_TYPE;
197 lookup_type_ = NOT_FOUND;
214 return details_.type();
221 return details_.attributes();
231 return IsTransition() || type() !=
NORMAL;
244 return details_.IsReadOnly();
249 return details_.type() ==
FIELD;
254 return details_.type() ==
NORMAL;
265 bool IsFound() {
return lookup_type_ != NOT_FOUND; }
267 bool IsHandler() {
return lookup_type_ == HANDLER_TYPE; }
272 return IsFound() && !IsTransition();
281 return holder()->FastPropertyAt(GetFieldIndex());
284 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry());
285 if (holder()->IsGlobalObject()) {
291 return GetConstantFunction();
310 return GetTransitionDetails(holder()->map());
314 return IsTransition() && GetTransitionDetails(map).type() ==
FIELD;
324 return map->transitions()->GetTarget(number_);
333 ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
338 ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
340 return Descriptor::IndexFromValue(GetValue());
345 return Descriptor::IndexFromValue(GetValueFromMap(map)) -
350 ASSERT(lookup_type_ == DICTIONARY_TYPE);
365 if (lookup_type_ == CONSTANT_TYPE) {
366 return HEAP->prototype_accessors();
373 void Print(FILE* out);
377 if (lookup_type_ == DESCRIPTOR_TYPE) {
378 return GetValueFromMap(holder()->map());
381 ASSERT(lookup_type_ == DICTIONARY_TYPE);
382 return holder()->GetNormalizedProperty(
this);
386 ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
387 ASSERT(number_ < map->NumberOfOwnDescriptors());
388 return map->instance_descriptors()->GetValue(number_);
391 void Iterate(ObjectVisitor* visitor);
411 PropertyDetails details_;
417 #endif // V8_PROPERTY_H_
void DescriptorResult(JSObject *holder, PropertyDetails details, int number)
bool IsTransitionToField(Map *map)
void ConstantResult(JSObject *holder)
int GetLocalFieldIndexFromMap(Map *map)
int inobject_properties()
MUST_USE_RESULT MaybeObject * KeyToSymbol()
bool IsConstantFunction()
static Smi * FromInt(int value)
Object * GetValueFromMap(Map *map) const
static Map * cast(Object *obj)
#define ASSERT(condition)
bool IsPropertyCallbacks()
v8::Handle< v8::Value > Print(const v8::Arguments &args)
void SetEnumerationIndex(int index)
Object * GetCallbackObject()
PropertyDetails GetPropertyDetails()
PropertyDetails GetTransitionDetails()
static Smi * cast(Object *object)
ConstantFunctionDescriptor(String *key, JSFunction *function, PropertyAttributes attributes, int index)
Map * GetTransitionTarget()
void SetSortedKeyIndex(int index)
static int IndexFromValue(Object *value)
LookupResult(Isolate *isolate)
PropertyAttributes GetAttributes()
FieldDescriptor(String *key, int field_index, PropertyAttributes attributes, int index=0)
void TransitionResult(JSObject *holder, int number)
Descriptor(String *key, Object *value, PropertyDetails details)
JSFunction * GetConstantFunctionFromMap(Map *map)
void SetTopLookupResult(LookupResult *top)
bool IsFastPropertyType()
PropertyDetails GetTransitionDetails(Map *map)
Map * GetTarget(int transition_number)
void HandlerResult(JSProxy *proxy)
static JSGlobalPropertyCell * cast(Object *obj)
PropertyDetails DetailsAt(int entry)
static JSProxy * cast(Object *obj)
void InterceptorResult(JSObject *holder)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
void DictionaryResult(JSObject *holder, int entry)
Descriptor(String *key, Object *value, PropertyAttributes attributes, PropertyType type, int index)
Map * GetTransitionMapFromMap(Map *map)
CallbacksDescriptor(String *key, Object *foreign, PropertyAttributes attributes, int index=0)
JSFunction * GetConstantFunction()
void Init(String *key, Object *value, PropertyDetails details)
StringDictionary * property_dictionary()
static JSObject * cast(Object *obj)
PropertyDetails GetTargetDetails(int transition_number)
PropertyDetails GetDetails()
static JSFunction * cast(Object *obj)