Lines Matching refs:elements
37 #include "elements.h"
676 // performance of fetching elements where checking the prototype chain is
693 if (js_object->elements() != heap->empty_fixed_array()) {
1149 PrintF(file, "elements transition [");
1189 accumulator->Add("<Map(elements=%u)>", Map::cast(this)->elements_kind());
2365 // from SMI to FAST elements is not done directly, but by going through
2366 // DOUBLE elements first.
2436 // with elements that switch back and forth between dictionary and fast
3467 FixedArrayBase* array = FixedArrayBase::cast(elements());
3494 // Copy the elements to the new backing store.
3526 // Switch to using the dictionary as the backing storage for elements.
3528 FixedArray::cast(elements())->set(1, dictionary);
3530 // Set the new map first to satify the elements type assert in
3545 PrintF("Object elements have been normalized:\n");
3999 bool JSObject::ReferencesObjectFromElements(FixedArray* elements,
4007 : elements->length();
4009 Object* element = elements->get(i);
4014 SeededNumberDictionary::cast(elements)->SlowReverseLookup(object);
4063 FixedArray* elements = FixedArray::cast(this->elements());
4064 if (ReferencesObjectFromElements(elements, kind, obj)) return true;
4068 FixedArray* parameter_map = FixedArray::cast(elements());
4148 // It's not possible to seal objects with external array elements
4159 // If there are fast elements
4184 // - This object has no elements.
4185 // - No prototype has enumerable properties/elements.
4324 // Try to update an accessor in an elements dictionary. Return true if the
4368 // Ignore getters and setters on pixel and external array elements.
4381 // getter/setter pair in an arguments elements dictionary backing
4383 FixedArray* parameter_map = FixedArray::cast(elements());
4479 // Normalize elements to make this operation simple.
4493 if (elements()->map() == GetHeap()->non_strict_arguments_elements_map()) {
4499 FixedArray* parameter_map = FixedArray::cast(elements());
4640 // elements.
5163 // elements, reuse the space for the first of them.
5215 // Skip deleted elements.
5264 // Use null instead of undefined for deleted elements to distinguish
5265 // deleted elements from unused elements. This distinction is used
5452 // now because the lists are short (<= 4 elements currently).
5864 // Extract elements and create sorted array.
8465 // Allocate a new fast elements backing store.
8473 if (elements()->map() != heap->non_strict_arguments_elements_map()) {
8475 // it, or if it's allowed and the old elements array contained only SMIs.
8479 (elements()->map()->has_fast_smi_only_elements() ||
8480 elements() == heap->empty_fixed_array()));
8488 FixedArrayBase* old_elements = elements();
8536 FixedArrayBase* old_elements = elements();
8734 // Elements in |Arguments| are ordered backwards (because they're on the
8834 static_cast<uint32_t>(FixedArray::cast(elements())->length());
8836 !FixedArray::cast(elements())->get(index)->IsTheHole()) {
8845 static_cast<uint32_t>(FixedDoubleArray::cast(elements())->length());
8847 !FixedDoubleArray::cast(elements())->is_the_hole(index)) {
8853 ExternalPixelArray* pixels = ExternalPixelArray::cast(elements());
8865 ExternalArray* array = ExternalArray::cast(elements());
8877 // Aliased parameters and non-aliased elements in a fast backing store
8878 // behave as FAST_ELEMENT. Non-aliased elements in a dictionary
8880 FixedArray* parameter_map = FixedArray::cast(elements());
9096 if (!elements()->IsFixedArray()) return false;
9097 FixedArray* elements = FixedArray::cast(this->elements());
9098 if (elements->map() != heap->non_strict_arguments_elements_map()) {
9101 FixedArray* arguments = FixedArray::cast(elements->get(1));
9108 if (!elements()->IsFixedArray()) return false;
9109 FixedArray* elements = FixedArray::cast(this->elements());
9110 if (elements->map() != heap->non_strict_arguments_elements_map()) {
9113 FixedArray* arguments = FixedArray::cast(elements->get(1));
9118 // Adding n elements in fast case is O(n*n).
9120 // elements.
9128 FixedArray* backing_store = FixedArray::cast(elements());
9159 // a transition to slow elements is necessary.
9176 // Convert to fast double elements if appropriate.
9181 FixedDoubleArray::cast(elements())->set(index, value->Number());
9184 // Change elements kind from SMI_ONLY to generic FAST if necessary.
9193 PrintElementsTransition(stdout, FAST_SMI_ONLY_ELEMENTS, elements(),
9194 FAST_ELEMENTS, elements());
9214 ASSERT(elements()->IsFixedArray());
9234 FixedArray* elements = FixedArray::cast(this->elements());
9236 (elements->map() == heap->non_strict_arguments_elements_map());
9239 dictionary = SeededNumberDictionary::cast(elements->get(1));
9241 dictionary = SeededNumberDictionary::cast(elements);
9271 // Elements of the arguments object in slow mode might be slow aliases.
9274 Context* context = Context::cast(elements->get(0));
9278 // For elements that are still writable we keep slow aliasing.
9313 elements->set(1, new_dictionary);
9353 PrintF("Object elements are fast case again:\n");
9369 FixedArrayBase* base_elms = FixedArrayBase::cast(elements());
9373 elements.
9385 // If the value object is not a heap number, switch to fast elements and try
9411 FixedDoubleArray* elms = FixedDoubleArray::cast(elements());
9436 FixedDoubleArray::cast(elements())->set(index, double_value);
9444 ASSERT(elements()->IsFixedDoubleArray());
9541 // Normalize the elements to enable attributes on the property.
9586 ExternalPixelArray* pixels = ExternalPixelArray::cast(elements());
9590 ExternalByteArray* array = ExternalByteArray::cast(elements());
9595 ExternalUnsignedByteArray::cast(elements());
9599 ExternalShortArray* array = ExternalShortArray::cast(elements());
9604 ExternalUnsignedShortArray::cast(elements());
9608 ExternalIntArray* array = ExternalIntArray::cast(elements());
9613 ExternalUnsignedIntArray::cast(elements());
9617 ExternalFloatArray* array = ExternalFloatArray::cast(elements());
9621 ExternalDoubleArray* array = ExternalDoubleArray::cast(elements());
9628 FixedArray* parameter_map = FixedArray::cast(elements());
9640 // For elements that are still writable we re-establish slow aliasing.
9676 elements() == isolate->heap()->empty_fixed_array()) &&
9684 FixedArrayBase* elms = FixedArrayBase::cast(elements());
9690 FixedArrayBase* elms = FixedArrayBase::cast(elements());
9698 // elements, assume a length of zero.
9809 FixedArrayBase* backing_store_base = FixedArrayBase::cast(elements());
9834 SeededNumberDictionary::cast(FixedArray::cast(elements()));
9840 FixedDoubleArray* elms = FixedDoubleArray::cast(elements());
9857 ExternalArray* external_array = ExternalArray::cast(elements());
9875 // would, the object should have slow elements.
9887 // If the elements are sparse, we should not go back to fast case.
9890 // elements. If it had fast elements we would skip security checks.
9893 FixedArray* elements = FixedArray::cast(this->elements());
9895 if (elements->map() == GetHeap()->non_strict_arguments_elements_map()) {
9896 dictionary = SeededNumberDictionary::cast(elements->get(1));
9898 dictionary = SeededNumberDictionary::cast(elements);
9900 // If an element has been added at a very high index in the elements
9905 // the object should have fast elements.
9924 SeededNumberDictionary::cast(elements());
9972 void Dictionary<Shape, Key>::CopyValuesTo(FixedArray* elements) {
9976 WriteBarrierMode mode = elements->GetWriteBarrierMode(no_gc);
9980 elements->set(pos++, ValueAt(i), mode);
9983 ASSERT(pos == elements->length());
10114 static_cast<uint32_t>(FixedArray::cast(elements())->length());
10116 !FixedArray::cast(elements())->get(index)->IsTheHole();
10122 static_cast<uint32_t>(FixedDoubleArray::cast(elements())->length());
10124 !FixedDoubleArray::cast(elements())->is_the_hole(index);
10128 ExternalPixelArray* pixels = ExternalPixelArray::cast(elements());
10139 ExternalArray* array = ExternalArray::cast(elements());
10226 // Extract elements and create sorted array.
10279 // swap the elements at these two positions.
10317 // Fast case for objects with no elements.
10322 static_cast<uint32_t>(FixedArray::cast(elements())->length());
10325 // Compute the number of enumerable elements.
10338 FixedArray::cast(elements())->length();
10340 if (!FixedArray::cast(elements())->get(i)->IsTheHole()) {
10353 FixedDoubleArray::cast(elements())->length();
10355 if (!FixedDoubleArray::cast(elements())->is_the_hole(i)) {
10366 int length = ExternalPixelArray::cast(elements())->length();
10384 int length = ExternalArray::cast(elements())->length();
10404 FixedArray* parameter_map = FixedArray::cast(elements());
10966 // Rehash the elements.
10992 // 50% is still free after adding n elements and
10993 // at most 50% of the free elements are deleted elements.
11017 // Shrink to fit the number of elements if only a quarter of the
11018 // capacity is filled with elements.
11021 // number of elements. The allocation method will make sure that
11023 // lower than room for 16 elements.
11168 // Collates undefined and unexisting elements below limit from position
11169 // zero of the elements. The object stays in Dictionary mode.
11174 // elements.
11265 // Collects all defined (non-hole) and non-undefined (array) elements at
11266 // the start of the elements array.
11267 // If the object is in dictionary mode, it is converted to fast elements
11273 // Convert to fast elements containing only the existing properties.
11280 // Convert to fast elements.
11301 // External arrays cannot have holes or undefined elements.
11302 return Smi::FromInt(ExternalArray::cast(elements())->length());
11314 FixedArrayBase* elements_base = FixedArrayBase::cast(this->elements());
11336 FixedDoubleArray* elements = FixedDoubleArray::cast(elements_base);
11337 // Split elements into defined and the_hole, in that order.
11342 if (elements->is_the_hole(i)) {
11349 if (elements->is_the_hole(holes)) {
11352 elements->set(i, elements->get_scalar(holes));
11359 elements->set_the_hole(holes);
11363 FixedArray* elements = FixedArray::cast(elements_base);
11366 // Split elements into defined, undefined and the_hole, in that order. Only
11368 WriteBarrierMode write_barrier = elements->GetWriteBarrierMode(no_alloc);
11374 Object* current = elements->get(i);
11385 current = elements->get(undefs);
11392 elements->set(i, current, write_barrier);
11399 elements->set_undefined(undefs);
11403 elements->set_the_hole(holes);
12024 // Check whether there are enough enumeration indices to add n elements.
12132 // If the dictionary requires slow elements an element has already
12136 // elements.