68 static const int kPackedSizeNotKnown = -1;
76 #define ELEMENTS_LIST(V) \
77 V(FastPackedSmiElementsAccessor, FAST_SMI_ELEMENTS, FixedArray) \
78 V(FastHoleySmiElementsAccessor, FAST_HOLEY_SMI_ELEMENTS, \
80 V(FastPackedObjectElementsAccessor, FAST_ELEMENTS, FixedArray) \
81 V(FastHoleyObjectElementsAccessor, FAST_HOLEY_ELEMENTS, FixedArray) \
82 V(FastPackedDoubleElementsAccessor, FAST_DOUBLE_ELEMENTS, \
84 V(FastHoleyDoubleElementsAccessor, FAST_HOLEY_DOUBLE_ELEMENTS, \
86 V(DictionaryElementsAccessor, DICTIONARY_ELEMENTS, \
87 SeededNumberDictionary) \
88 V(NonStrictArgumentsElementsAccessor, NON_STRICT_ARGUMENTS_ELEMENTS, \
90 V(ExternalByteElementsAccessor, EXTERNAL_BYTE_ELEMENTS, \
92 V(ExternalUnsignedByteElementsAccessor, \
93 EXTERNAL_UNSIGNED_BYTE_ELEMENTS, ExternalUnsignedByteArray) \
94 V(ExternalShortElementsAccessor, EXTERNAL_SHORT_ELEMENTS, \
96 V(ExternalUnsignedShortElementsAccessor, \
97 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, ExternalUnsignedShortArray) \
98 V(ExternalIntElementsAccessor, EXTERNAL_INT_ELEMENTS, \
100 V(ExternalUnsignedIntElementsAccessor, \
101 EXTERNAL_UNSIGNED_INT_ELEMENTS, ExternalUnsignedIntArray) \
102 V(ExternalFloatElementsAccessor, \
103 EXTERNAL_FLOAT_ELEMENTS, ExternalFloatArray) \
104 V(ExternalDoubleElementsAccessor, \
105 EXTERNAL_DOUBLE_ELEMENTS, ExternalDoubleArray) \
106 V(PixelElementsAccessor, EXTERNAL_PIXEL_ELEMENTS, ExternalPixelArray)
114 #define ELEMENTS_TRAITS(Class, KindParam, Store) \
115 template<> class ElementsKindTraits<KindParam> { \
117 static const ElementsKind Kind = KindParam; \
118 typedef Store BackingStore; \
121 #undef ELEMENTS_TRAITS
124 ElementsAccessor** ElementsAccessor::elements_accessors_;
127 static bool HasKey(FixedArray* array,
Object* key) {
128 int len0 = array->length();
129 for (
int i = 0; i < len0; i++) {
130 Object* element = array->get(i);
131 if (element->IsSmi() && element == key)
return true;
132 if (element->IsString() &&
141 static Failure* ThrowArrayLengthRangeError(Heap* heap) {
142 HandleScope scope(heap->isolate());
143 return heap->isolate()->Throw(
144 *heap->isolate()->factory()->NewRangeError(
"invalid_array_length",
145 HandleVector<Object>(
NULL, 0)));
157 int copy_size = raw_copy_size;
158 if (raw_copy_size < 0) {
161 copy_size =
Min(from->
length() - from_start,
167 for (
int i = to_start + copy_size; i < to->
length(); ++i) {
173 ASSERT((copy_size + static_cast<int>(to_start)) <= to->
length() &&
174 (copy_size +
static_cast<int>(from_start)) <= from->
length());
175 if (copy_size == 0)
return;
180 CopyWords(reinterpret_cast<Object**>(to_address) + to_start,
181 reinterpret_cast<Object**>(from_address) + from_start,
196 static void CopyDictionaryToObjectElements(SeededNumberDictionary* from,
202 int copy_size = raw_copy_size;
203 Heap* heap = from->GetHeap();
204 if (raw_copy_size < 0) {
207 copy_size = from->max_number_key() + 1 - from_start;
212 for (
int i = to_start + copy_size; i < to->length(); ++i) {
213 ASSERT(to->get(i)->IsTheHole());
220 if (copy_size == 0)
return;
221 uint32_t to_length = to->length();
222 if (to_start + copy_size > to_length) {
223 copy_size = to_length - to_start;
225 for (
int i = 0; i < copy_size; i++) {
226 int entry = from->FindEntry(i + from_start);
228 Object* value = from->ValueAt(entry);
229 ASSERT(!value->IsTheHole());
232 to->set_the_hole(i + to_start);
236 if (!heap->InNewSpace(to)) {
237 heap->RecordWrites(to->address(),
238 to->OffsetOfElementAt(to_start),
241 heap->incremental_marking()->RecordWrites(to);
247 FixedDoubleArray* from,
254 int copy_size = raw_copy_size;
255 if (raw_copy_size < 0) {
258 copy_size =
Min(from->length() - from_start,
259 to->length() - to_start);
264 for (
int i = to_start + copy_size; i < to->length(); ++i) {
265 ASSERT(to->get(i)->IsTheHole());
270 ASSERT((copy_size + static_cast<int>(to_start)) <= to->length() &&
271 (copy_size +
static_cast<int>(from_start)) <= from->length());
272 if (copy_size == 0)
return from;
273 for (
int i = 0; i < copy_size; ++i) {
278 MaybeObject* maybe_value = from->get(i + from_start);
286 if (!maybe_value->ToObject(&value)) {
287 ASSERT(maybe_value->IsRetryAfterGC() || maybe_value->IsOutOfMemory());
288 Heap* heap = from->GetHeap();
289 MaybeObject* maybe_value_object =
290 heap->AllocateHeapNumber(from->get_scalar(i + from_start),
292 if (!maybe_value_object->ToObject(&value))
return maybe_value_object;
301 static void CopyDoubleToDoubleElements(FixedDoubleArray* from,
303 FixedDoubleArray* to,
306 int copy_size = raw_copy_size;
307 if (raw_copy_size < 0) {
310 copy_size =
Min(from->length() - from_start,
311 to->length() - to_start);
313 for (
int i = to_start + copy_size; i < to->length(); ++i) {
318 ASSERT((copy_size + static_cast<int>(to_start)) <= to->length() &&
319 (copy_size +
static_cast<int>(from_start)) <= from->length());
320 if (copy_size == 0)
return;
326 CopyWords(reinterpret_cast<Object**>(to_address),
327 reinterpret_cast<Object**>(from_address),
328 words_per_double * copy_size);
332 static void CopySmiToDoubleElements(FixedArray* from,
334 FixedDoubleArray* to,
337 int copy_size = raw_copy_size;
338 if (raw_copy_size < 0) {
341 copy_size = from->length() - from_start;
343 for (
int i = to_start + copy_size; i < to->length(); ++i) {
348 ASSERT((copy_size + static_cast<int>(to_start)) <= to->length() &&
349 (copy_size +
static_cast<int>(from_start)) <= from->length());
350 if (copy_size == 0)
return;
351 Object* the_hole = from->GetHeap()->the_hole_value();
352 for (uint32_t from_end = from_start + static_cast<uint32_t>(copy_size);
353 from_start < from_end; from_start++, to_start++) {
354 Object* hole_or_smi = from->get(from_start);
355 if (hole_or_smi == the_hole) {
356 to->set_the_hole(to_start);
358 to->set(to_start,
Smi::cast(hole_or_smi)->value());
364 static void CopyPackedSmiToDoubleElements(FixedArray* from,
366 FixedDoubleArray* to,
370 int copy_size = raw_copy_size;
372 if (raw_copy_size < 0) {
375 copy_size = from->length() - from_start;
377 to_end = to->length();
379 to_end = to_start +
static_cast<uint32_t
>(copy_size);
382 to_end = to_start +
static_cast<uint32_t
>(copy_size);
384 ASSERT(static_cast<int>(to_end) <= to->length());
385 ASSERT(packed_size >= 0 && packed_size <= copy_size);
386 ASSERT((copy_size + static_cast<int>(to_start)) <= to->length() &&
387 (copy_size +
static_cast<int>(from_start)) <= from->length());
388 if (copy_size == 0)
return;
389 for (uint32_t from_end = from_start + static_cast<uint32_t>(packed_size);
390 from_start < from_end; from_start++, to_start++) {
391 Object* smi = from->get(from_start);
392 ASSERT(!smi->IsTheHole());
393 to->set(to_start,
Smi::cast(smi)->value());
396 while (to_start < to_end) {
397 to->set_the_hole(to_start++);
402 static void CopyObjectToDoubleElements(FixedArray* from,
404 FixedDoubleArray* to,
407 int copy_size = raw_copy_size;
408 if (raw_copy_size < 0) {
411 copy_size = from->length() - from_start;
413 for (
int i = to_start + copy_size; i < to->length(); ++i) {
418 ASSERT((copy_size + static_cast<int>(to_start)) <= to->length() &&
419 (copy_size +
static_cast<int>(from_start)) <= from->length());
420 if (copy_size == 0)
return;
421 Object* the_hole = from->GetHeap()->the_hole_value();
422 for (uint32_t from_end = from_start + copy_size;
423 from_start < from_end; from_start++, to_start++) {
424 Object* hole_or_object = from->get(from_start);
425 if (hole_or_object == the_hole) {
426 to->set_the_hole(to_start);
428 to->set(to_start, hole_or_object->Number());
434 static void CopyDictionaryToDoubleElements(SeededNumberDictionary* from,
436 FixedDoubleArray* to,
439 int copy_size = raw_copy_size;
443 copy_size = from->max_number_key() + 1 - from_start;
445 for (
int i = to_start + copy_size; i < to->length(); ++i) {
450 if (copy_size == 0)
return;
451 uint32_t to_length = to->length();
452 if (to_start + copy_size > to_length) {
453 copy_size = to_length - to_start;
455 for (
int i = 0; i < copy_size; i++) {
456 int entry = from->FindEntry(i + from_start);
458 to->set(i + to_start, from->ValueAt(entry)->Number());
460 to->set_the_hole(i + to_start);
483 template <
typename ElementsAccessorSubclass,
484 typename ElementsTraitsParam>
501 if (fixed_array_base->IsFailure())
return;
502 if (!fixed_array_base->IsHeapObject())
return;
503 Map* map = fixed_array_base->
map();
506 if (map == heap->raw_unchecked_one_pointer_filler_map() ||
507 map == heap->raw_unchecked_two_pointer_filler_map() ||
508 map == heap->free_space_map()) {
512 if (holder->IsJSArray()) {
514 if (length_obj->IsSmi()) {
518 length = fixed_array_base->
length();
520 ElementsAccessorSubclass::ValidateContents(holder, length);
524 ElementsAccessorSubclass::ValidateImpl(holder);
531 MaybeObject* element =
532 ElementsAccessorSubclass::GetImpl(receiver, holder, key, backing_store);
533 return !element->IsTheHole();
540 if (backing_store ==
NULL) {
541 backing_store = holder->elements();
543 return ElementsAccessorSubclass::HasElementImpl(
544 receiver, holder, key, BackingStore::cast(backing_store));
551 if (backing_store ==
NULL) {
552 backing_store = holder->elements();
554 return ElementsAccessorSubclass::GetImpl(
555 receiver, holder, key, BackingStore::cast(backing_store));
562 return (key < ElementsAccessorSubclass::GetCapacityImpl(backing_store))
563 ? backing_store->get(key)
564 : backing_store->
GetHeap()->the_hole_value();
569 return ElementsAccessorSubclass::SetLengthImpl(
570 array, length, BackingStore::cast(array->elements()));
582 return ElementsAccessorSubclass::SetFastElementsCapacityAndLength(
618 int packed_size = kPackedSizeNotKnown;
620 from = from_holder->elements();
626 from_holder->IsJSArray();
629 if (copy_size >= 0 && packed_size > copy_size) {
630 packed_size = copy_size;
634 if (from->
length() == 0) {
637 return ElementsAccessorSubclass::CopyElementsImpl(
638 from, from_start, to, to_kind, to_start, packed_size, copy_size);
649 for (
int i = 0; i < len0; i++) {
655 from = holder->elements();
658 uint32_t len1 = ElementsAccessorSubclass::GetCapacityImpl(backing_store);
662 if (len1 == 0)
return to;
666 for (uint32_t y = 0; y < len1; y++) {
668 ElementsAccessorSubclass::GetKeyForIndexImpl(backing_store, y);
669 if (ElementsAccessorSubclass::HasElementImpl(
670 receiver, holder, key, backing_store)) {
671 MaybeObject* maybe_value =
672 ElementsAccessorSubclass::GetImpl(receiver, holder,
675 if (!maybe_value->ToObject(&value))
return maybe_value;
676 ASSERT(!value->IsTheHole());
677 if (!HasKey(to, value)) {
683 if (extra == 0)
return to;
687 MaybeObject* maybe_obj =
689 if (!maybe_obj->To<
FixedArray>(&result))
return maybe_obj;
695 for (
int i = 0; i < len0; i++) {
697 ASSERT(e->IsString() || e->IsNumber());
698 result->
set(i, e, mode);
703 for (uint32_t y = 0; y < len1; y++) {
705 ElementsAccessorSubclass::GetKeyForIndexImpl(backing_store, y);
706 if (ElementsAccessorSubclass::HasElementImpl(
707 receiver, holder, key, backing_store)) {
708 MaybeObject* maybe_value =
709 ElementsAccessorSubclass::GetImpl(receiver, holder,
712 if (!maybe_value->ToObject(&value))
return maybe_value;
713 if (!value->IsTheHole() && !HasKey(to, value)) {
714 result->
set(len0 + index, value);
725 return backing_store->
length();
729 return ElementsAccessorSubclass::GetCapacityImpl(
730 BackingStore::cast(backing_store));
740 return ElementsAccessorSubclass::GetKeyForIndexImpl(
741 BackingStore::cast(backing_store), index);
750 template<
typename FastElementsAccessorSubclass,
771 uint32_t old_capacity = backing_store->
length();
772 Object* old_length = array->length();
773 bool same_size = old_length->IsSmi() &&
781 if (maybe_obj->IsFailure())
return maybe_obj;
785 if (length <= old_capacity) {
788 if (!maybe_obj->To(&backing_store))
return maybe_obj;
790 if (2 * length <= old_capacity) {
797 BackingStore::OffsetOfElementAt(length);
798 int filler_size = (old_capacity - length) * ElementSize;
804 for (
int i = length; i < old_length; i++) {
805 backing_store->set_the_hole(i);
808 return length_object;
813 uint32_t new_capacity = length > min ? length : min;
815 MaybeObject* result = FastElementsAccessorSubclass::
816 SetFastElementsCapacityAndLength(array, new_capacity, length);
817 if (result->IsFailure())
return result;
819 return length_object;
823 return array->
GetHeap()->undefined_value();
832 typename KindTraits::BackingStore* backing_store =
833 KindTraits::BackingStore::cast(obj->elements());
835 if (backing_store->map() == heap->non_strict_arguments_elements_map()) {
837 KindTraits::BackingStore::cast(
842 MaybeObject* transitioned =
844 if (transitioned->IsFailure())
return transitioned;
849 if (!maybe->ToObject(&writable))
return maybe;
850 backing_store = KindTraits::BackingStore::cast(writable);
853 uint32_t length =
static_cast<uint32_t
>(
856 : backing_store->length());
858 backing_store->set_the_hole(key);
863 const int kMinLengthForSparsenessCheck = 64;
864 if (backing_store->length() >= kMinLengthForSparsenessCheck &&
865 !heap->InNewSpace(backing_store) &&
866 ((key > 0 && backing_store->is_the_hole(key - 1)) ||
867 (key + 1 < length && backing_store->is_the_hole(key + 1)))) {
869 for (
int i = 0; i < backing_store->length(); ++i) {
870 if (!backing_store->is_the_hole(i)) ++num_used;
872 if (4 * num_used > backing_store->length())
break;
874 if (4 * num_used <= backing_store->length()) {
876 if (result->IsFailure())
return result;
880 return heap->true_value();
893 typename KindTraits::BackingStore* backing_store) {
894 if (key >= static_cast<uint32_t>(backing_store->length())) {
897 return !backing_store->is_the_hole(key);
904 Map* map = elements->
map();
906 (map == heap->fixed_array_map() ||
907 map == heap->fixed_cow_array_map())) ||
909 ((map == heap->fixed_array_map() && length == 0) ||
910 map == heap->fixed_double_array_map())));
911 for (
int i = 0; i < length; i++) {
912 typename KindTraits::BackingStore* backing_store =
913 KindTraits::BackingStore::cast(elements);
915 static_cast<Object*>(backing_store->get(i))->IsSmi()) ||
917 backing_store->is_the_hole(i)));
924 template<
typename FastElementsAccessorSubclass,
950 packed_size != kPackedSizeNotKnown) {
951 CopyPackedSmiToDoubleElements(
954 packed_size, copy_size);
956 CopySmiToDoubleElements(
961 CopyObjectToDoubleElements(
968 return to->
GetHeap()->undefined_value();
988 FastPackedSmiElementsAccessor,
989 ElementsKindTraits<FAST_SMI_ELEMENTS> > {
1000 FastHoleySmiElementsAccessor,
1001 ElementsKindTraits<FAST_HOLEY_SMI_ELEMENTS> > {
1012 FastPackedObjectElementsAccessor,
1013 ElementsKindTraits<FAST_ELEMENTS> > {
1024 FastHoleyObjectElementsAccessor,
1025 ElementsKindTraits<FAST_HOLEY_ELEMENTS> > {
1034 template<
typename FastElementsAccessorSubclass,
1035 typename KindTraits>
1055 uint32_t from_start,
1066 return CopyDoubleToObjectElements(
1068 to_kind, to_start, copy_size);
1073 to_start, copy_size);
1078 return to->
GetHeap()->undefined_value();
1085 FastPackedDoubleElementsAccessor,
1086 ElementsKindTraits<FAST_DOUBLE_ELEMENTS> > {
1092 FastPackedDoubleElementsAccessor,
1099 FastHoleyDoubleElementsAccessor,
1100 ElementsKindTraits<FAST_HOLEY_DOUBLE_ELEMENTS> > {
1103 FastHoleyDoubleElementsAccessor,
1107 FastHoleyDoubleElementsAccessor,
1113 template<
typename ExternalElementsAccessorSubclass,
1117 ElementsKindTraits<Kind> > {
1134 key < ExternalElementsAccessorSubclass::GetCapacityImpl(backing_store)
1135 ? backing_store->get(key)
1136 : backing_store->
GetHeap()->undefined_value();
1152 return obj->
GetHeap()->true_value();
1160 ExternalElementsAccessorSubclass::GetCapacityImpl(backing_store);
1161 return key < capacity;
1168 EXTERNAL_BYTE_ELEMENTS> {
1178 EXTERNAL_UNSIGNED_BYTE_ELEMENTS> {
1188 EXTERNAL_SHORT_ELEMENTS> {
1198 EXTERNAL_UNSIGNED_SHORT_ELEMENTS> {
1208 EXTERNAL_INT_ELEMENTS> {
1218 EXTERNAL_UNSIGNED_INT_ELEMENTS> {
1228 EXTERNAL_FLOAT_ELEMENTS> {
1238 EXTERNAL_DOUBLE_ELEMENTS> {
1248 EXTERNAL_PIXEL_ELEMENTS> {
1258 ElementsKindTraits<DICTIONARY_ELEMENTS> > {
1277 if (!maybe_obj->ToObject(&obj))
return maybe_obj;
1279 uint32_t new_length = length;
1280 uint32_t old_length =
static_cast<uint32_t
>(array->length()->
Number());
1281 if (new_length < old_length) {
1286 for (
int i = 0; i < capacity; i++) {
1288 if (key->IsNumber()) {
1289 uint32_t number =
static_cast<uint32_t
>(key->
Number());
1290 if (new_length <= number && number < old_length) {
1291 PropertyDetails details = dict->
DetailsAt(i);
1292 if (details.IsDontDelete()) new_length = number + 1;
1296 if (new_length != length) {
1298 if (!maybe_object->To(&length_object))
return maybe_object;
1302 int removed_entries = 0;
1303 Object* the_hole_value = heap->the_hole_value();
1304 for (
int i = 0; i < capacity; i++) {
1306 if (key->IsNumber()) {
1307 uint32_t number =
static_cast<uint32_t
>(key->
Number());
1308 if (new_length <= number && number < old_length) {
1309 dict->
SetEntry(i, the_hole_value, the_hole_value);
1319 return length_object;
1339 if (result == heap->true_value()) {
1340 MaybeObject* maybe_elements = dictionary->
Shrink(key);
1342 if (!maybe_elements->To(&new_elements)) {
1343 return maybe_elements;
1348 obj->set_elements(new_elements);
1352 result == heap->false_value()) {
1362 return isolate->
Throw(*error);
1365 return heap->true_value();
1369 uint32_t from_start,
1380 CopyDictionaryToObjectElements(
1386 CopyDictionaryToDoubleElements(
1393 return to->
GetHeap()->undefined_value();
1412 int entry = backing_store->
FindEntry(key);
1415 PropertyDetails details = backing_store->
DetailsAt(entry);
1417 return obj->GetElementWithCallback(receiver,
1425 return obj->
GetHeap()->the_hole_value();
1445 NonStrictArgumentsElementsAccessor,
1446 ElementsKindTraits<NON_STRICT_ARGUMENTS_ELEMENTS> > {
1461 Object* probe = GetParameterMapArg(obj, parameter_map, key);
1462 if (!probe->IsTheHole()) {
1465 ASSERT(!context->
get(context_index)->IsTheHole());
1466 return context->
get(context_index);
1471 receiver, obj, key, arguments);
1473 if (!maybe_result->ToObject(&result))
return maybe_result;
1475 if (result->IsAliasedArgumentsEntry()) {
1479 ASSERT(!context->
get(context_index)->IsTheHole());
1480 return context->
get(context_index);
1501 Object* probe = GetParameterMapArg(obj, parameter_map, key);
1502 if (!probe->IsTheHole()) {
1509 if (arguments->IsDictionary()) {
1518 return obj->
GetHeap()->true_value();
1522 uint32_t from_start,
1531 return accessor->CopyElements(
NULL, from_start, to, to_kind,
1532 to_start, copy_size, arguments);
1537 return Max(static_cast<uint32_t>(parameter_map->
length() - 2),
1550 Object* probe = GetParameterMapArg(holder, parameter_map, key);
1551 if (!probe->IsTheHole()) {
1556 return !accessor->Get(receiver, holder, key, arguments)->IsTheHole();
1564 uint32_t length = holder->IsJSArray()
1566 : parameter_map->
length();
1567 return key < (length - 2 )
1568 ? parameter_map->
get(key + 2)
1569 : parameter_map->
GetHeap()->the_hole_value();
1577 if (array->IsDictionary()) {
1609 #define ACCESSOR_ARRAY(Class, Kind, Store) new Class(#Kind),
1611 #undef ACCESSOR_ARRAY
1614 STATIC_ASSERT((
sizeof(accessor_array) /
sizeof(*accessor_array)) ==
1617 elements_accessors_ = accessor_array;
1622 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind];
1624 #undef ACCESSOR_DELETE
1625 elements_accessors_ =
NULL;
1629 template <
typename ElementsAccessorSub
class,
typename ElementsKindTraits>
1638 MaybeObject* maybe_smi_length = length->
ToSmi();
1640 if (maybe_smi_length->ToObject(&smi_length) && smi_length->IsSmi()) {
1644 MaybeObject* result = ElementsAccessorSubclass::
1645 SetLengthWithoutNormalize(backing_store, array, smi_length, value);
1646 if (!result->ToObject(&new_length))
return result;
1647 ASSERT(new_length->IsSmi() || new_length->IsUndefined());
1648 if (new_length->IsSmi()) {
1653 return ThrowArrayLengthRangeError(array->
GetHeap());
1659 if (length->IsNumber()) {
1664 if (!maybe_object->To(&dictionary))
return maybe_object;
1668 if (!result->ToObject(&new_length))
return result;
1669 ASSERT(new_length->IsNumber());
1673 return ThrowArrayLengthRangeError(array->
GetHeap());
1681 if (!maybe_obj->To(&new_backing_store))
return maybe_obj;
1682 new_backing_store->
set(0, length);
1683 { MaybeObject* result = array->
SetContent(new_backing_store);
1684 if (result->IsFailure())
return result;
bool FLAG_enable_slow_asserts
static MUST_USE_RESULT MaybeObject * SetLengthImpl(JSObject *obj, Object *length, BackingStore *backing_store)
Object * KeyAt(int entry)
static MUST_USE_RESULT MaybeObject * GetImpl(Object *receiver, JSObject *obj, uint32_t key, BackingStore *backing_store)
FastDoubleElementsAccessor(const char *name)
#define ACCESSOR_DELETE(Class, Kind, Store)
#define ACCESSOR_ARRAY(Class, Kind, Store)
static const int kNotFound
MUST_USE_RESULT MaybeObject * AllocateFixedArray(int length, PretenureFlag pretenure)
static MUST_USE_RESULT MaybeObject * GetImpl(Object *receiver, JSObject *obj, uint32_t key, FixedArray *parameter_map)
void set(int index, Object *value)
virtual MUST_USE_RESULT MaybeObject * Delete(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
bool InNewSpace(Object *object)
static String * cast(Object *obj)
static uint32_t GetCapacityImpl(FixedArray *parameter_map)
virtual MUST_USE_RESULT MaybeObject * AddElementsToFixedArray(Object *receiver, JSObject *holder, FixedArray *to, FixedArrayBase *from)
FastSmiOrObjectElementsAccessor(const char *name)
static bool HasElementImpl(Object *receiver, JSObject *holder, uint32_t key, SeededNumberDictionary *backing_store)
ElementsTraitsParam::BackingStore BackingStore
void set_length(Smi *length)
static Smi * FromInt(int value)
bool HasFastSmiElements()
bool IsFastObjectElementsKind(ElementsKind kind)
MUST_USE_RESULT MaybeObject * ToSmi()
virtual MUST_USE_RESULT MaybeObject * SetCapacityAndLength(JSArray *array, int capacity, int length)
static bool HasElementImpl(Object *receiver, JSObject *holder, uint32_t key, BackingStore *backing_store)
value format" "after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false, "print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false, "print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false, "report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true, "garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true, "flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true, "use incremental marking") DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") DEFINE_bool(trace_incremental_marking, false, "trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true, "Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false, "Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true, "use inline caching") DEFINE_bool(native_code_counters, false, "generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false, "Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true, "Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false, "Never perform compaction on full GC-testing only") DEFINE_bool(compact_code_space, true, "Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and" "flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0, "Default seed for initializing random generator" "(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true, "allows verbose printing") DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") DEFINE_bool(trace_sim, false, "Trace simulator execution") DEFINE_bool(check_icache, false, "Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator(4 or 8, 8 is default)") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, "preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true, "randomize hashes to avoid predictable hash collisions" "(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0, "Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false, "activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") DEFINE_int(testing_int_flag, 13, "testing_int_flag") DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_string(testing_serialization_file, "/tmp/serdes", "file in which to serialize heap") DEFINE_bool(help, false, "Print usage message, including flags, on console") DEFINE_bool(dump_counters, false, "Dump counters on exit") DEFINE_string(map_counters, "", "Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT, "Pass all remaining arguments to the script.Alias for\"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#43"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2#define FLAG_MODE_DEFINE_DEFAULTS#1"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flag-definitions.h"1#define FLAG_FULL(ftype, ctype, nam, def, cmt)#define FLAG_READONLY(ftype, ctype, nam, def, cmt)#define DEFINE_implication(whenflag, thenflag)#define DEFINE_bool(nam, def, cmt)#define DEFINE_int(nam, def, cmt)#define DEFINE_float(nam, def, cmt)#define DEFINE_string(nam, def, cmt)#define DEFINE_args(nam, def, cmt)#define FLAG DEFINE_bool(use_strict, false,"enforce strict mode") DEFINE_bool(es5_readonly, false,"activate correct semantics for inheriting readonliness") DEFINE_bool(es52_globals, false,"activate new semantics for global var declarations") DEFINE_bool(harmony_typeof, false,"enable harmony semantics for typeof") DEFINE_bool(harmony_scoping, false,"enable harmony block scoping") DEFINE_bool(harmony_modules, false,"enable harmony modules (implies block scoping)") DEFINE_bool(harmony_proxies, false,"enable harmony proxies") DEFINE_bool(harmony_collections, false,"enable harmony collections (sets, maps, and weak maps)") DEFINE_bool(harmony, false,"enable all harmony features (except typeof)") DEFINE_implication(harmony, harmony_scoping) DEFINE_implication(harmony, harmony_modules) DEFINE_implication(harmony, harmony_proxies) DEFINE_implication(harmony, harmony_collections) DEFINE_implication(harmony_modules, harmony_scoping) DEFINE_bool(packed_arrays, false,"optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true,"tracks arrays with only smi values") DEFINE_bool(clever_optimizations, true,"Optimize object size, Array shift, DOM strings and string +") DEFINE_bool(unbox_double_arrays, true,"automatically unbox arrays of doubles") DEFINE_bool(string_slices, true,"use string slices") DEFINE_bool(crankshaft, true,"use crankshaft") DEFINE_string(hydrogen_filter,"","optimization filter") DEFINE_bool(use_range, true,"use hydrogen range analysis") DEFINE_bool(eliminate_dead_phis, true,"eliminate dead phis") DEFINE_bool(use_gvn, true,"use hydrogen global value numbering") DEFINE_bool(use_canonicalizing, true,"use hydrogen instruction canonicalizing") DEFINE_bool(use_inlining, true,"use function inlining") DEFINE_int(max_inlined_source_size, 600,"maximum source size in bytes considered for a single inlining") DEFINE_int(max_inlined_nodes, 196,"maximum number of AST nodes considered for a single inlining") DEFINE_int(max_inlined_nodes_cumulative, 196,"maximum cumulative number of AST nodes considered for inlining") DEFINE_bool(loop_invariant_code_motion, true,"loop invariant code motion") DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true,"crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false,"print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false,"trace generated hydrogen to file") DEFINE_string(trace_phase,"Z","trace generated IR for specified phases") DEFINE_bool(trace_inlining, false,"trace inlining decisions") DEFINE_bool(trace_alloc, false,"trace register allocator") DEFINE_bool(trace_all_uses, false,"trace all use positions") DEFINE_bool(trace_range, false,"trace range analysis") DEFINE_bool(trace_gvn, false,"trace global value numbering") DEFINE_bool(trace_representation, false,"trace representation types") DEFINE_bool(stress_pointer_maps, false,"pointer map for every instruction") DEFINE_bool(stress_environments, false,"environment for every instruction") DEFINE_int(deopt_every_n_times, 0,"deoptimize every n times a deopt point is passed") DEFINE_bool(trap_on_deopt, false,"put a break point before deoptimizing") DEFINE_bool(deoptimize_uncommon_cases, true,"deoptimize uncommon cases") DEFINE_bool(polymorphic_inlining, true,"polymorphic inlining") DEFINE_bool(use_osr, true,"use on-stack replacement") DEFINE_bool(array_bounds_checks_elimination, false,"perform array bounds checks elimination") DEFINE_bool(array_index_dehoisting, false,"perform array index dehoisting") DEFINE_bool(trace_osr, false,"trace on-stack replacement") DEFINE_int(stress_runs, 0,"number of stress runs") DEFINE_bool(optimize_closures, true,"optimize closures") DEFINE_bool(inline_construct, true,"inline constructor calls") DEFINE_bool(inline_arguments, true,"inline functions with arguments object") DEFINE_int(loop_weight, 1,"loop weight for representation inference") DEFINE_bool(optimize_for_in, true,"optimize functions containing for-in loops") DEFINE_bool(experimental_profiler, true,"enable all profiler experiments") DEFINE_bool(watch_ic_patching, false,"profiler considers IC stability") DEFINE_int(frame_count, 1,"number of stack frames inspected by the profiler") DEFINE_bool(self_optimization, false,"primitive functions trigger their own optimization") DEFINE_bool(direct_self_opt, false,"call recompile stub directly when self-optimizing") DEFINE_bool(retry_self_opt, false,"re-try self-optimization if it failed") DEFINE_bool(count_based_interrupts, false,"trigger profiler ticks based on counting instead of timing") DEFINE_bool(interrupt_at_exit, false,"insert an interrupt check at function exit") DEFINE_bool(weighted_back_edges, false,"weight back edges by jump distance for interrupt triggering") DEFINE_int(interrupt_budget, 5900,"execution budget before interrupt is triggered") DEFINE_int(type_info_threshold, 15,"percentage of ICs that must have type info to allow optimization") DEFINE_int(self_opt_count, 130,"call count before self-optimization") DEFINE_implication(experimental_profiler, watch_ic_patching) DEFINE_implication(experimental_profiler, self_optimization) DEFINE_implication(experimental_profiler, retry_self_opt) DEFINE_implication(experimental_profiler, count_based_interrupts) DEFINE_implication(experimental_profiler, interrupt_at_exit) DEFINE_implication(experimental_profiler, weighted_back_edges) DEFINE_bool(trace_opt_verbose, false,"extra verbose compilation tracing") DEFINE_implication(trace_opt_verbose, trace_opt) DEFINE_bool(debug_code, false,"generate extra code (assertions) for debugging") DEFINE_bool(code_comments, false,"emit comments in code disassembly") DEFINE_bool(enable_sse2, true,"enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true,"enable use of SSE3 instructions if available") DEFINE_bool(enable_sse4_1, true,"enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true,"enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true,"enable use of RDTSC instruction if available") DEFINE_bool(enable_sahf, true,"enable use of SAHF instruction if available (X64 only)") DEFINE_bool(enable_vfp3, true,"enable use of VFP3 instructions if available - this implies ""enabling ARMv7 instructions (ARM only)") DEFINE_bool(enable_armv7, true,"enable use of ARMv7 instructions if available (ARM only)") DEFINE_bool(enable_fpu, true,"enable use of MIPS FPU instructions if available (MIPS only)") DEFINE_string(expose_natives_as, NULL,"expose natives in global object") DEFINE_string(expose_debug_as, NULL,"expose debug in global object") DEFINE_bool(expose_gc, false,"expose gc extension") DEFINE_bool(expose_externalize_string, false,"expose externalize string extension") DEFINE_int(stack_trace_limit, 10,"number of stack frames to capture") DEFINE_bool(builtins_in_stack_traces, false,"show built-in functions in stack traces") DEFINE_bool(disable_native_files, false,"disable builtin natives files") DEFINE_bool(inline_new, true,"use fast inline allocation") DEFINE_bool(stack_trace_on_abort, true,"print a stack trace if an assertion failure occurs") DEFINE_bool(trace, false,"trace function calls") DEFINE_bool(mask_constants_with_cookie, true,"use random jit cookie to mask large constants") DEFINE_bool(lazy, true,"use lazy compilation") DEFINE_bool(trace_opt, false,"trace lazy optimization") DEFINE_bool(trace_opt_stats, false,"trace lazy optimization statistics") DEFINE_bool(opt, true,"use adaptive optimizations") DEFINE_bool(always_opt, false,"always try to optimize functions") DEFINE_bool(prepare_always_opt, false,"prepare for turning on always opt") DEFINE_bool(trace_deopt, false,"trace deoptimization") DEFINE_int(min_preparse_length, 1024,"minimum length for automatic enable preparsing") DEFINE_bool(always_full_compiler, false,"try to use the dedicated run-once backend for all code") DEFINE_bool(trace_bailout, false,"print reasons for falling back to using the classic V8 backend") DEFINE_bool(compilation_cache, true,"enable compilation cache") DEFINE_bool(cache_prototype_transitions, true,"cache prototype transitions") DEFINE_bool(trace_debug_json, false,"trace debugging JSON request/response") DEFINE_bool(debugger_auto_break, true,"automatically set the debug break flag when debugger commands are ""in the queue") DEFINE_bool(enable_liveedit, true,"enable liveedit experimental feature") DEFINE_bool(break_on_abort, true,"always cause a debug break before aborting") DEFINE_int(stack_size, kPointerSize *123,"default size of stack region v8 is allowed to use (in kBytes)") DEFINE_int(max_stack_trace_source_length, 300,"maximum length of function source code printed in a stack trace.") DEFINE_bool(always_inline_smi_code, false,"always inline smi code in non-opt code") DEFINE_int(max_new_space_size, 0,"max size of the new generation (in kBytes)") DEFINE_int(max_old_space_size, 0,"max size of the old generation (in Mbytes)") DEFINE_int(max_executable_size, 0,"max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false,"always perform global GCs") DEFINE_int(gc_interval,-1,"garbage collect after <n> allocations") DEFINE_bool(trace_gc, false,"print one trace line following each garbage collection") DEFINE_bool(trace_gc_nvp, false,"print one detailed trace line in name=value format ""after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false,"print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false,"print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false,"report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true,"garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true,"flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true,"use incremental marking") DEFINE_bool(incremental_marking_steps, true,"do incremental marking steps") DEFINE_bool(trace_incremental_marking, false,"trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true,"Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false,"Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true,"use inline caching") DEFINE_bool(native_code_counters, false,"generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false,"Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true,"Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false,"Never perform compaction on full GC - testing only") DEFINE_bool(compact_code_space, true,"Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true,"Flush inline caches prior to mark compact collection and ""flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0,"Default seed for initializing random generator ""(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true,"allows verbose printing") DEFINE_bool(allow_natives_syntax, false,"allow natives syntax") DEFINE_bool(trace_sim, false,"Trace simulator execution") DEFINE_bool(check_icache, false,"Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0,"Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8,"Stack alingment in bytes in simulator (4 or 8, 8 is default)") DEFINE_bool(trace_exception, false,"print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false,"preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true,"randomize hashes to avoid predictable hash collisions ""(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0,"Fixed seed to use to hash property keys (0 means random)""(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false,"activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true,"generate optimized regexp code") DEFINE_bool(testing_bool_flag, true,"testing_bool_flag") DEFINE_int(testing_int_flag, 13,"testing_int_flag") DEFINE_float(testing_float_flag, 2.5,"float-flag") DEFINE_string(testing_string_flag,"Hello, world!","string-flag") DEFINE_int(testing_prng_seed, 42,"Seed used for threading test randomness") DEFINE_string(testing_serialization_file,"/tmp/serdes","file in which to serialize heap") DEFINE_bool(help, false,"Print usage message, including flags, on console") DEFINE_bool(dump_counters, false,"Dump counters on exit") DEFINE_string(map_counters,"","Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT,"Pass all remaining arguments to the script. Alias for \"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#47"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2 namespace{struct Flag{enum FlagType{TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARGS} name
static bool HasElementImpl(Object *receiver, JSObject *holder, uint32_t key, BackingStore *backing_store)
static MUST_USE_RESULT MaybeObject * SetLengthImpl(JSObject *obj, Object *length, BackingStore *backing_store)
virtual void Validate(JSObject *holder)
ExternalElementsAccessor(const char *name)
ExternalShortElementsAccessor(const char *name)
virtual MUST_USE_RESULT MaybeObject * SetLength(JSArray *array, Object *length)
static Failure * Exception()
static MaybeObject * SetFastElementsCapacityAndLength(JSObject *obj, uint32_t capacity, uint32_t length)
static AliasedArgumentsEntry * cast(Object *obj)
DictionaryElementsAccessor(const char *name)
static Handle< Object > TransitionElementsKind(Handle< JSObject > object, ElementsKind to_kind)
#define ASSERT(condition)
virtual MUST_USE_RESULT MaybeObject * Delete(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
KindTraits::BackingStore BackingStore
static MUST_USE_RESULT MaybeObject * SetLengthWithoutNormalize(SeededNumberDictionary *dict, JSArray *array, Object *length_object, uint32_t length)
virtual MUST_USE_RESULT MaybeObject * Delete(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
static Context * cast(Object *context)
ElementsTraitsParam ElementsTraits
ExternalUnsignedByteElementsAccessor(const char *name)
ExternalDoubleElementsAccessor(const char *name)
FixedArrayBase BackingStore
virtual bool HasElement(Object *receiver, JSObject *holder, uint32_t key, FixedArrayBase *backing_store)
void initialize_elements()
FastElementsAccessor(const char *name)
ExternalByteElementsAccessor(const char *name)
static uint32_t GetKeyForIndexImpl(SeededNumberDictionary *dict, uint32_t index)
bool IsFastElementsKind(ElementsKind kind)
MUST_USE_RESULT MaybeObject * EnsureWritableFastElements()
void set_the_hole(int index)
ExternalFloatElementsAccessor(const char *name)
static Smi * cast(Object *object)
bool Equals(String *other)
static MUST_USE_RESULT MaybeObject * DeleteCommon(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
static MUST_USE_RESULT MaybeObject * CopyElementsImpl(FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int packed_size, int copy_size)
FastHoleyObjectElementsAccessor(const char *name)
static const int kCopyToEnd
static uint32_t GetKeyForIndexImpl(FixedArray *dict, uint32_t index)
Object * ValueAt(int entry)
void CopyWords(T *dst, T *src, int num_words)
bool HasFastSmiOrObjectElements()
virtual ElementsKind kind() const
static void ValidateImpl(JSObject *holder)
STATIC_ASSERT((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
static SeededNumberDictionary * cast(Object *obj)
MUST_USE_RESULT MaybeObject * SetContent(FixedArrayBase *storage)
bool IsFastPackedElementsKind(ElementsKind kind)
static void ValidateContents(JSObject *holder, int length)
static MUST_USE_RESULT MaybeObject * SetFastElementsCapacityAndLength(JSObject *obj, int capacity, int length)
NonStrictArgumentsElementsAccessor(const char *name)
virtual MUST_USE_RESULT MaybeObject * Get(Object *receiver, JSObject *holder, uint32_t key, FixedArrayBase *backing_store)
static MaybeObject * DeleteCommon(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
bool ToArrayIndex(uint32_t *index)
MUST_USE_RESULT MaybeObject * ResetElements()
ElementsKind GetElementsKind()
FastPackedObjectElementsAccessor(const char *name)
static uint32_t GetKeyForIndexImpl(BackingStore *backing_store, uint32_t index)
static MaybeObject * CopyElementsImpl(FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int packed_size, int copy_size)
static bool HasElementImpl(Object *receiver, JSObject *holder, uint32_t key, FixedArray *parameter_map)
static void InitializeOncePerProcess()
static MUST_USE_RESULT MaybeObject * GetImpl(Object *receiver, JSObject *obj, uint32_t key, BackingStore *backing_store)
SetFastElementsCapacitySmiMode
void RecordWrites(HeapObject *obj)
static FixedDoubleArray * cast(Object *obj)
#define ELEMENTS_TRAITS(Class, KindParam, Store)
bool IsFastSmiElementsKind(ElementsKind kind)
static MUST_USE_RESULT MaybeObject * CopyElementsImpl(FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int packed_size, int copy_size)
void set_length(int value)
MUST_USE_RESULT MaybeObject * SetFastElementsCapacityAndLength(int capacity, int length, SetFastElementsCapacitySmiMode smi_mode)
static ElementsAccessor * ForArray(FixedArrayBase *array)
WriteBarrierMode GetWriteBarrierMode(const AssertNoAllocation &)
MUST_USE_RESULT MaybeObject * Shrink(Key key)
virtual MUST_USE_RESULT MaybeObject * Get(Object *receiver, JSObject *holder, uint32_t key, FixedArrayBase *backing_store=NULL)=0
Failure * Throw(Object *exception, MessageLocation *location=NULL)
virtual MUST_USE_RESULT MaybeObject * CopyElements(JSObject *from_holder, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int copy_size, FixedArrayBase *from)
static int OffsetOfElementAt(int index)
static JSArray * cast(Object *obj)
ExternalIntElementsAccessor(const char *name)
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)
void RecordWrites(Address address, int start, int len)
FastPackedSmiElementsAccessor(const char *name)
const int kElementsKindCount
static const int kHeaderSize
FastPackedDoubleElementsAccessor(const char *name)
MUST_USE_RESULT MaybeObject * SetFastDoubleElementsCapacityAndLength(int capacity, int length)
void CopyObjectToObjectElements(FixedArray *from, ElementsKind from_kind, uint32_t from_start, FixedArray *to, ElementsKind to_kind, uint32_t to_start, int raw_copy_size)
bool ShouldConvertToSlowElements(int new_capacity)
static const int kCopyToEndAndInitializeToHole
ElementsKindTraits< Kind >::BackingStore BackingStore
static MaybeObject * SetLengthWithoutNormalize(BackingStore *backing_store, JSArray *array, Object *length_object, uint32_t length)
MUST_USE_RESULT MaybeObject * NumberFromUint32(uint32_t value, PretenureFlag pretenure=NOT_TENURED)
IncrementalMarking * incremental_marking()
static MUST_USE_RESULT MaybeObject * SetLengthImpl(JSObject *obj, Object *length, FixedArray *parameter_map)
PropertyDetails DetailsAt(int entry)
Object * DeleteProperty(int entry, JSObject::DeleteMode mode)
Handle< Object > NewTypeError(const char *type, Vector< Handle< Object > > args)
ExternalUnsignedShortElementsAccessor(const char *name)
static Handle< SeededNumberDictionary > NormalizeElements(Handle< JSObject > object)
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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt 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 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
InstanceType instance_type()
static FixedArray * cast(Object *obj)
static bool HasElementImpl(Object *receiver, JSObject *holder, uint32_t key, typename KindTraits::BackingStore *backing_store)
static MUST_USE_RESULT MaybeObject * CopyElementsImpl(FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int packed_size, int copy_size)
ExternalUnsignedIntElementsAccessor(const char *name)
void SetEntry(int entry, Object *key, Object *value)
bool IsFastHoleyElementsKind(ElementsKind kind)
bool HasFastDoubleElements()
bool HasFastArgumentsElements()
void CreateFillerObjectAt(Address addr, int size)
static MaybeObject * SetFastElementsCapacityAndLength(JSObject *obj, uint32_t capacity, uint32_t length)
virtual uint32_t GetCapacity(FixedArrayBase *backing_store)
PixelElementsAccessor(const char *name)
Vector< Handle< Object > > HandleVector(v8::internal::Handle< T > *elms, int length)
virtual MUST_USE_RESULT MaybeObject * Delete(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)=0
int aliased_context_slot()
virtual uint32_t GetCapacity(FixedArrayBase *backing_store)=0
virtual uint32_t GetKeyForIndex(FixedArrayBase *backing_store, uint32_t index)
static int NewElementsCapacity(int old_capacity)
static FixedArrayBase * cast(Object *object)
ElementsAccessorBase(const char *name)
static uint32_t GetCapacityImpl(BackingStore *backing_store)
virtual MaybeObject * Delete(JSObject *obj, uint32_t key, JSReceiver::DeleteMode mode)
Handle< Object > NewNumberFromUint(uint32_t value, PretenureFlag pretenure=NOT_TENURED)
static void ValidateContents(JSObject *holder, int length)
ElementsKind GetHoleyElementsKind(ElementsKind packed_kind)
const char * name() const
void ElementsRemoved(int n)
FastHoleyDoubleElementsAccessor(const char *name)
FastHoleySmiElementsAccessor(const char *name)
static MUST_USE_RESULT MaybeObject * GetImpl(Object *receiver, JSObject *obj, uint32_t key, SeededNumberDictionary *backing_store)
bool IsFastDoubleElementsKind(ElementsKind kind)
static MaybeObject * CopyElementsImpl(FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind to_kind, uint32_t to_start, int packed_size, int copy_size)