Lines Matching defs:Array
45 #include "src/interpreter/bytecode-array-iterator.h"
883 Handle<JSArray> array = Handle<JSArray>::cast(object);
885 if (!array->HasArrayPrototype(isolate) ||
886 !array->length()->ToUint32(&length) || !array->HasFastElements() ||
887 !JSObject::PrototypeHasNoElements(isolate, *array)) {
890 return array->GetElementsAccessor()->CreateListFromArray(isolate, array);
2029 // Directly decode from the descriptor array if |from| did not change shape.
2330 // Check that this object is an array.
2343 // Check that the map of the initial array iterator hasn't changed.
2674 accumulator->Add("<JS Array[%u]>", static_cast<uint32_t>(length));
2958 os << "<Fixed" #Type "Array[" << Fixed##Type##Array::cast(this)->length() \
3218 // Ensure the descriptor array does not get too big.
3253 // Ensure the descriptor array does not get too big.
3391 // - Otherwise, allocate a fixed array large enough to hold all fields, in
3485 Handle<FixedArray> array = isolate->factory()->NewFixedArray(total_size);
3542 array->set(target_index, *value);
3557 array->set(target_index, *value);
3572 Object* value = array->get(external + i);
3597 heap->RightTrimFixedArray(*array, inobject);
3598 object->set_properties(*array);
3762 // Clear out the old descriptor array to avoid problems to sharing
3763 // the descriptor array without using an explicit.
3895 // Don't overwrite the empty descriptor array or initial map's descriptors.
3921 // in the descriptor array.
4546 Handle<JSArray> array = Handle<JSArray>::cast(receiver);
4547 if (JSArray::WouldChangeReadOnlyLength(array, it->index())) {
4548 RETURN_FAILURE(array->GetIsolate(), should_throw,
4551 Object::TypeOf(isolate, array), array));
4555 array->HasFixedTypedArrayElements()) {
4556 CheckArrayAbuse(array, "typed elements write", it->index(), true);
4559 if (FLAG_trace_js_array_abuse && !array->HasFixedTypedArrayElements()) {
4560 CheckArrayAbuse(array, "elements write", it->index(), false);
4612 // that the maps to which we push the new descriptor array back can rely
4666 Handle<typename T::Array> array,
4670 Isolate* isolate = array->GetIsolate();
4690 if (!T::Contains(key, entry, valid_descriptors, array)) {
4691 T::Insert(key, entry, valid_descriptors, array);
4700 typedef DescriptorArray Array;
4704 Handle<DescriptorArray> array) {
4706 return array->Search(*key, valid_descriptors) != DescriptorArray::kNotFound;
4711 Handle<DescriptorArray> array) {
4715 array->Append(&d);
4721 typedef FixedArray Array;
4725 Handle<FixedArray> array) {
4727 if (*key == AccessorInfo::cast(array->get(i))->name()) return true;
4734 Handle<FixedArray> array) {
4736 array->set(valid_descriptors, *entry);
4744 Handle<DescriptorArray> array(map->instance_descriptors());
4746 DCHECK_GE(array->NumberOfSlackDescriptors(), callbacks->length());
4747 nof = AppendUniqueCallbacks<DescriptorArrayAppender>(callbacks, array, nof);
4753 Handle<FixedArray> array,
4756 DCHECK_GE(array->length(), callbacks->length() + valid_descriptors);
4757 return AppendUniqueCallbacks<FixedArrayAppender>(callbacks, array,
5525 Handle<FixedArray> array(
5527 return Handle<NormalizedMapCache>::cast(array);
5665 // Allocate the fixed array for the fields.
6596 // 3. Else if P is an array index, then:
7267 // Get the constructor function for arguments array.
7285 // If it is an arguments array check the content.
7687 // Create a new descriptor array with the appropriate property attributes
7725 // typed array elements. Freeze works only if there are no actual elements.
7883 // an array.
8215 // Directly decode from the descriptor array if |from| did not change shape.
8629 // Initial maps must always own their descriptors and it's descriptor array
8643 // The copy will use the same descriptors array.
8674 // array, implying that its NumberOfOwnDescriptors equals the number of
8675 // descriptors in the descriptor array.
8682 // Ensure there's space for the new descriptor in the shared descriptor array.
8746 // descriptors in the descriptors array that do not belong to the map.
8818 // Start with creating last map which will own full descriptors array.
8820 // array if any of the allocations happening below fail.
8980 // copying the map; creating a new descriptor array cell.
9715 Handle<FixedArray> FixedArray::SetAndGrow(Handle<FixedArray> array, int index,
9717 if (index < array->length()) {
9718 array->set(index, *value);
9719 return array;
9721 int capacity = array->length();
9726 array->GetIsolate()->factory()->NewUninitializedFixedArray(capacity);
9727 array->CopyTo(0, *new_array, 0, array->length());
9728 new_array->FillWithHoles(array->length(), new_array->length());
9761 void WeakFixedArray::Set(Handle<WeakFixedArray> array, int index,
9763 DCHECK(array->IsEmptySlot(index)); // Don't overwrite anything.
9766 : array->GetIsolate()->factory()->NewWeakCell(value);
9767 Handle<FixedArray>::cast(array)->set(index + kFirstIndex, *cell);
9771 array->set_last_used_index(index);
9779 Handle<WeakFixedArray> array =
9785 int first_index = array->last_used_index();
9786 int length = array->Length();
9789 if (array->IsEmptySlot((i))) {
9790 WeakFixedArray::Set(array, i, value);
9792 return array;
9802 // No usable slot found, grow the array.
9805 Allocate(array->GetIsolate(), new_length, array);
9817 FixedArray* array = FixedArray::cast(this);
9819 for (int i = kFirstIndex; i < array->length(); i++) {
9820 Object* element = array->get(i);
9826 array->set(new_length++, element);
9828 array->Shrink(new_length);
9903 Handle<ArrayList> ArrayList::Add(Handle<ArrayList> array, Handle<Object> obj,
9905 int length = array->Length();
9906 array = EnsureSpace(array, length + 1);
9908 DCHECK(array->Length() <= length);
9909 length = array->Length();
9911 array->Set(length, *obj);
9912 array->SetLength(length + 1);
9913 return array;
9916 Handle<ArrayList> ArrayList::Add(Handle<ArrayList> array, Handle<Object> obj1,
9918 int length = array->Length();
9919 array = EnsureSpace(array, length + 2);
9921 length = array->Length();
9923 array->Set(length, *obj1);
9924 array->Set(length + 1, *obj2);
9925 array->SetLength(length + 2);
9926 return array;
9943 Handle<FixedArray> EnsureSpaceInFixedArray(Handle<FixedArray> array,
9945 int capacity = array->length();
9947 Isolate* isolate = array->GetIsolate();
9951 array = Handle<ArrayList>::cast(
9952 isolate->factory()->CopyFixedArrayAndGrow(array, grow_by));
9954 return array;
9959 Handle<ArrayList> ArrayList::EnsureSpace(Handle<ArrayList> array, int length) {
9960 const bool empty = (array->length() == 0);
9962 EnsureSpaceInFixedArray(array, kFirstIndex + length));
9984 Handle<FrameArray> array = EnsureSpace(in, new_length);
9985 array->SetReceiver(frame_count, *receiver);
9986 array->SetFunction(frame_count, *function);
9987 array->SetCode(frame_count, *code);
9988 array->SetOffset(frame_count, Smi::FromInt(offset));
9989 array->SetFlags(frame_count, Smi::FromInt(flags));
9990 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1));
9991 return array;
10002 Handle<FrameArray> array = EnsureSpace(in, new_length);
10003 array->SetWasmInstance(frame_count, *wasm_instance);
10004 array->SetWasmFunctionIndex(frame_count, Smi::FromInt(wasm_function_index));
10005 array->SetCode(frame_count, *code);
10006 array->SetOffset(frame_count, Smi::FromInt(offset));
10007 array->SetFlags(frame_count, Smi::FromInt(flags));
10008 array->set(kFrameCountIndex, Smi::FromInt(frame_count + 1));
10009 return array;
10015 Handle<FrameArray> FrameArray::EnsureSpace(Handle<FrameArray> array,
10017 return Handle<FrameArray>::cast(EnsureSpaceInFixedArray(array, length));
10029 // Allocate the array of keys.
10077 // Reset sorting since the descriptor array might contain invalid pointers.
10102 // Extract elements and create sorted array.
10104 // Put max element at the back of the array.
10332 // Fast array index case.
10922 Handle<FixedArray> array = isolate->factory()->NewFixedArray(line_count);
10924 array->set(i, Smi::FromInt(line_ends[i]));
10926 return array;
11616 // Isolate the array index form the full hash field.
11663 // For array indexes mix the length into the hash as an array index could
12402 // Replace all of the cached initial array maps in the native context with
12453 // If the function is used as the global Array function, cache the
12971 Handle<FixedArray> array = String::CalculateLineEnds(src, true);
12972 script->set_line_ends(*array);
12980 // For wasm, we do not create an artificial line_ends array, but do the
13018 // For wasm, we do not rely on the line_ends array, but do the translation
13046 // Determine line number by doing a binary search on the line ends array.
13271 // Remove shared function info from root array.
14715 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
14717 array->GetIsolate()->factory()->NewJSArrayStorage(
14718 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
14721 void JSArray::SetLength(Handle<JSArray> array, uint32_t new_length) {
14722 // We should never end in here with a pixel or external array.
14723 DCHECK(array->AllowsSetLength());
14724 if (array->SetLengthWouldNormalize(new_length)) {
14725 JSObject::NormalizeElements(array);
14727 array->GetElementsAccessor()->SetLength(array, new_length);
15476 // If the array is huge, it's not likely to be defined in a local
15625 bool JSArray::HasReadOnlyLength(Handle<JSArray> array) {
15626 Map* map = array->map();
15628 // configurable, it's guaranteed to be the first in the descriptor array.
15631 array->GetHeap()->length_string());
15635 Isolate* isolate = array->GetIsolate();
15636 LookupIterator it(array, isolate->factory()->length_string(), array,
15643 bool JSArray::WouldChangeReadOnlyLength(Handle<JSArray> array,
15646 CHECK(array->length()->ToArrayLength(&length));
15647 if (length <= index) return HasReadOnlyLength(array);
15912 Handle<FixedArray> array = isolate->factory()->NewFixedArray(4);
15913 array->set(0, *shared_);
15914 array->set(1, *source_);
15915 array->set(2, Smi::FromInt(language_mode_));
15916 array->set(3, Smi::FromInt(position_));
15917 return array;
16274 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure);
16275 array->set_map_no_write_barrier(Shape::GetMap(isolate));
16276 Handle<Derived> table = Handle<Derived>::cast(array);
16325 // Copy prefix to new array.
16748 // Bail out and do the sorting of undefineds and array holes in JS.
16805 // Collects all defined (non-hole) and non-undefined (array) elements at
16806 // the start of the elements array.
17038 return kExternal##Type##Array;
17611 // AddToLiteralsMap may allocate a new sub-array to live in the entry,
17612 // but it won't change the cache array. Therefore EntryToIndex and
18045 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length);
18054 array->set(array_size++, Smi::FromInt(i));
18060 Smi** start = reinterpret_cast<Smi**>(array->GetFirstElementAddress());
18063 array->Shrink(array_size);
18064 return array;
18072 Handle<FixedArray> array =
18097 array->set(array_size++, Smi::FromInt(i));
18101 Smi** start = reinterpret_cast<Smi**>(array->GetFirstElementAddress());
18107 int index = Smi::cast(array->get(i))->value();
18117 int index = Smi::cast(array->get(i))->value();
18210 // TODO(jochen): Consider to shrink the fixed array in place.
18611 FixedArray* array = FixedArray::cast(value_array->elements());
18612 static_cast<Derived*>(this)->PopulateValueArray(array);
18824 // No free slot - extend break point info array.
18907 // If there are multiple break points shrink the array
18940 // If there was one break point object before replace with array.
18942 Handle<FixedArray> array = isolate->factory()->NewFixedArray(2);
18943 array->set(0, break_point_info->break_point_objects());
18944 array->set(1, *break_point_object);
18945 break_point_info->set_break_point_objects(*array);
18948 // If there was more than one break point before extend array.
18978 FixedArray* array = FixedArray::cast(break_point_info->break_point_objects());
18979 for (int i = 0; i < array->length(); i++) {
18980 if (array->get(i) == *break_point_object) {
19280 // Prevent creating array buffers when serializing.
19857 // TODO(neis): Create regular_exports array here instead of in factory method?