16 void LookupIterator::Next() {
20 has_property_ =
false;
22 JSReceiver* holder = *holder_;
23 Map*
map = *holder_map_;
26 state_ = LookupInHolder(
map, holder);
27 if (IsFound())
return;
31 JSReceiver* maybe_holder = NextHolder(
map);
32 if (maybe_holder ==
NULL)
break;
33 holder = maybe_holder;
35 state_ = LookupInHolder(
map, holder);
38 if (holder != *holder_) {
39 holder_ =
handle(holder, isolate_);
45 Handle<JSReceiver> LookupIterator::GetRoot()
const {
48 handle(receiver_->GetRootMap(isolate_)->prototype(), isolate_);
49 CHECK(!root->IsNull());
54 Handle<Map> LookupIterator::GetReceiverMap()
const {
55 if (receiver_->IsNumber())
return isolate_->factory()->heap_number_map();
60 Handle<JSObject> LookupIterator::GetStoreTarget()
const {
61 if (receiver_->IsJSGlobalProxy()) {
62 PrototypeIterator iter(isolate(), receiver_);
70 bool LookupIterator::IsBootstrapping()
const {
71 return isolate_->bootstrapper()->IsActive();
77 return isolate_->MayNamedAccess(GetHolder<JSObject>(), name_, access_type);
81 void LookupIterator::ReloadPropertyInformation() {
82 state_ = BEFORE_PROPERTY;
83 state_ = LookupInHolder(*holder_map_, *holder_);
84 DCHECK(IsFound() || holder_map_->is_dictionary_map());
88 void LookupIterator::PrepareForDataProperty(Handle<Object> value) {
90 DCHECK(HolderIsReceiverOrHiddenPrototype());
91 if (holder_map_->is_dictionary_map())
return;
95 ReloadPropertyInformation();
99 void LookupIterator::ReconfigureDataProperty(Handle<Object> value,
102 DCHECK(HolderIsReceiverOrHiddenPrototype());
103 Handle<JSObject> holder = GetHolder<JSObject>();
104 if (holder_map_->is_dictionary_map()) {
105 PropertyDetails details(attributes,
NORMAL, 0);
113 ReloadPropertyInformation();
117 void LookupIterator::PrepareTransitionToDataProperty(
120 if (state_ == TRANSITION)
return;
122 GetAccessors()->IsDeclaredAccessorInfo());
123 DCHECK(state_ == NOT_FOUND || !HolderIsReceiverOrHiddenPrototype());
128 Handle<JSObject> receiver = GetStoreTarget();
130 if (!
name().is_identical_to(isolate()->factory()->hidden_string()) &&
131 !receiver->map()->is_extensible()) {
136 handle(receiver->map(), isolate_), name_, value, attributes, store_mode);
141 void LookupIterator::ApplyTransitionToDataProperty() {
144 Handle<JSObject> receiver = GetStoreTarget();
146 holder_map_ = transition_map_;
148 ReloadPropertyInformation();
152 void LookupIterator::TransitionToAccessorProperty(
155 DCHECK(!accessor->IsNull());
159 Handle<JSObject> receiver = GetStoreTarget();
163 name_, component, accessor, attributes);
166 ReloadPropertyInformation();
168 if (!holder_map_->is_dictionary_map())
return;
172 if (holder_map_->IsGlobalObjectMap()) {
177 PropertyDetails details(attributes,
CALLBACKS, 0);
178 Handle<AccessorPair> pair;
179 if (state() ==
ACCESSOR && GetAccessors()->IsAccessorPair()) {
182 if (pair->get(component) == *accessor) {
183 if (property_details().attributes() == attributes)
return;
186 pair->set(component, *accessor);
189 pair = isolate()->factory()->NewAccessorPair();
190 pair->set(component, *accessor);
195 holder_map_ =
handle(receiver->map(), isolate_);
196 ReloadPropertyInformation();
200 bool LookupIterator::HolderIsReceiverOrHiddenPrototype()
const {
201 DCHECK(has_property_ || state_ == INTERCEPTOR || state_ == JSPROXY);
203 if (!check_prototype_chain())
return true;
205 if (!receiver_->IsJSReceiver())
return false;
206 Object* current = *receiver_;
207 JSReceiver* holder = *holder_;
209 if (current->IsJSProxy()) {
210 return JSReceiver::cast(current) == holder;
212 PrototypeIterator iter(isolate(), current,
215 if (JSReceiver::cast(iter.GetCurrent()) == holder)
return true;
216 DCHECK(!current->IsJSProxy());
223 Handle<Object> LookupIterator::FetchValue()
const {
225 Handle<JSObject> holder = GetHolder<JSObject>();
226 if (holder_map_->is_dictionary_map()) {
227 result = holder->property_dictionary()->ValueAt(number_);
228 if (holder_map_->IsGlobalObjectMap()) {
229 result = PropertyCell::cast(result)->value();
232 FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_);
236 result = holder_map_->instance_descriptors()->GetValue(number_);
238 return handle(result, isolate_);
242 int LookupIterator::GetConstantIndex()
const {
244 DCHECK(!holder_map_->is_dictionary_map());
246 return descriptor_number();
250 FieldIndex LookupIterator::GetFieldIndex()
const {
252 DCHECK(!holder_map_->is_dictionary_map());
255 holder_map_->instance_descriptors()->GetFieldIndex(descriptor_number());
256 bool is_double = representation().IsDouble();
257 return FieldIndex::ForPropertyIndex(*holder_map_, index, is_double);
261 Handle<HeapType> LookupIterator::GetFieldType()
const {
263 DCHECK(!holder_map_->is_dictionary_map());
266 holder_map_->instance_descriptors()->GetFieldType(descriptor_number()),
271 Handle<PropertyCell> LookupIterator::GetPropertyCell()
const {
272 Handle<JSObject> holder = GetHolder<JSObject>();
274 Object* value = global->property_dictionary()->ValueAt(dictionary_entry());
275 return Handle<PropertyCell>(PropertyCell::cast(value));
279 Handle<Object> LookupIterator::GetAccessors()
const {
285 Handle<Object> LookupIterator::GetDataValue()
const {
287 Handle<Object> value = FetchValue();
292 void LookupIterator::WriteDataValue(Handle<Object> value) {
294 Handle<JSObject> holder = GetHolder<JSObject>();
295 if (holder_map_->is_dictionary_map()) {
296 NameDictionary* property_dictionary = holder->property_dictionary();
297 if (holder->IsGlobalObject()) {
298 Handle<PropertyCell> cell(
299 PropertyCell::cast(property_dictionary->ValueAt(dictionary_entry())));
302 property_dictionary->ValueAtPut(dictionary_entry(), *value);
305 holder->WriteToField(descriptor_number(), *value);
312 void LookupIterator::InternalizeName() {
313 if (name_->IsUniqueName())
return;
static Handle< AccessorPair > Copy(Handle< AccessorPair > pair)
static void DeoptimizeGlobalObject(JSObject *object)
static Handle< T > cast(Handle< S > that)
static void ReoptimizeIfPrototype(Handle< JSObject > object)
static Handle< Object > FastPropertyAt(Handle< JSObject > object, Representation representation, FieldIndex index)
static void MigrateToMap(Handle< JSObject > object, Handle< Map > new_map)
static void SetNormalizedProperty(Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyDetails details)
static Handle< Map > TransitionToAccessorProperty(Handle< Map > map, Handle< Name > name, AccessorComponent component, Handle< Object > accessor, PropertyAttributes attributes)
static Handle< Map > PrepareForDataProperty(Handle< Map > old_map, int descriptor_number, Handle< Object > value)
static Handle< Map > ReconfigureDataProperty(Handle< Map > map, int descriptor, PropertyAttributes attributes)
static Handle< Map > TransitionToDataProperty(Handle< Map > map, Handle< Name > name, Handle< Object > value, PropertyAttributes attributes, StoreFromKeyed store_mode)
static void SetValueInferType(Handle< PropertyCell > cell, Handle< Object > value)
Object * GetCurrent() const
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
kSerializedDataOffset Object
Handle< T > handle(T *t, Isolate *isolate)
Debugger support for the V8 JavaScript engine.
AccessType
Access type specification.