| /arkcompiler/runtime_core/runtime/mem/refstorage/ |
| D | ref_block.cpp | 34 uint8_t index = GetFreeIndex(); in AddRef() local 35 Set(index, object); in AddRef() 36 auto *ref = reinterpret_cast<Reference *>(&refs_[index]); in AddRef() 48 auto index = (ref_ptr - block_ptr) / sizeof(ObjectPointer<ObjectHeader>); in Remove() local 49 ASSERT(IsBusyIndex(index)); in Remove() 50 slots_ |= static_cast<uint64_t>(1U) << index; in Remove() 51 ASAN_POISON_MEMORY_REGION(refs_[index], sizeof(refs_[index])); in Remove() 60 for (size_t index = 0; index < REFS_IN_BLOCK; index++) { in VisitObjects() local 61 if (block->IsBusyIndex(index)) { in VisitObjects() 62 auto object_pointer = block->refs_[index]; in VisitObjects() [all …]
|
| D | global_object_storage.h | 121 …1) When index is busy - then we store jobject in storage_ and 0 in the lowest bit (cause of alignm… 122 …Reference* contains it's index shifted by 2 with reference-type in lowest bits which we return to … 125 …2) When index if free - storage[index] stores next free index (shifted by 1) with lowest bit equal… 130 … | busy-index | | | | 131 … | Reference* (index) | index | 0/1 (ref-type) | 0/1 (ref-type) | 132 … | storage[index] | xxx | 0 | 134 … | free-index | | | 135 … | storage[index] | xxx | 1 | 141 * Index of first available block in list 235 auto index = ReferenceToIndex(ref); in Get() local [all …]
|
| /arkcompiler/ets_runtime/ecmascript/js_api/ |
| D | js_api_plain_array.cpp | 34 int32_t index = obj->BinarySearch(*keyArray, 0, size, key.GetTaggedValue().GetNumber()); in Add() local 35 if (index >= 0) { in Add() 36 keyArray->Set(thread, index, key); in Add() 37 valueArray->Set(thread, index, value); in Add() 40 index ^= 0xFFFFFFFF; in Add() 41 if (index < size) { in Add() 42 obj->AdjustArray(thread, *keyArray, index, size, true); in Add() 43 obj->AdjustArray(thread, *valueArray, index, size, true); in Add() 55 keyArray->Set(thread, index, key); in Add() 56 valueArray->Set(thread, index, value); in Add() [all …]
|
| D | js_api_lightweightmap.cpp | 32 int32_t index) in IncreaseCapacityTo() argument 35 if (index < DEFAULT_CAPACITY_LENGTH || num >= index) { in IncreaseCapacityTo() 41 JSHandle<TaggedArray> newHashArray = GrowCapacity(thread, hashArray, index); in IncreaseCapacityTo() 42 JSHandle<TaggedArray> newKeyArray = GrowCapacity(thread, keyArray, index); in IncreaseCapacityTo() 43 JSHandle<TaggedArray> newValueArray = GrowCapacity(thread, valueArray, index); in IncreaseCapacityTo() 51 … int32_t index, const JSHandle<JSTaggedValue> &value, AccossorsKind kind) in InsertValue() argument 57 newArray = factory->InsertElementByIndex(newArray, value, index, len); in InsertValue() 62 … int32_t index, const JSHandle<JSTaggedValue> &value, AccossorsKind kind) in ReplaceValue() argument 65 ASSERT(0 <= index || index < lightWeightMap->GetSize()); in ReplaceValue() 66 array->Set(thread, index, value.GetTaggedValue()); in ReplaceValue() [all …]
|
| D | js_api_list.cpp | 57 const int index) in Insert() argument 61 if (index < 0 || index > nodeLength) { in Insert() 63 oss << "The value of \"index\" is out of range. It must be >= 0 && <= " << nodeLength in Insert() 64 << ". Received value is: " << index; in Insert() 68 JSTaggedValue newList = TaggedSingleList::Insert(thread, singleList, value, index); in Insert() 74 const int index, const JSHandle<JSTaggedValue> &value) in Set() argument 78 if (index < 0 || index >= nodeLength) { in Set() 80 oss << "The value of \"index\" is out of range. It must be >= 0 && <= " << (nodeLength - 1) in Set() 81 << ". Received value is: " << index; in Set() 85 TaggedSingleList::Set(thread, singleList, index, value); in Set() [all …]
|
| D | js_api_linked_list.cpp | 28 const JSHandle<JSTaggedValue> &value, const int index) in Insert() argument 32 if (index < 0 || index > nodeLength) { in Insert() 34 oss << "The value of \"index\" is out of range. It must be >= 0 && <= " << nodeLength in Insert() 35 << ". Received value is: " << index; in Insert() 39 JSTaggedValue newList = TaggedDoubleList::Insert(thread, doubleList, value, index); in Insert() 92 … JSAPILinkedList::RemoveByIndex(JSThread *thread, JSHandle<JSAPILinkedList> &list, const int index) in RemoveByIndex() argument 96 if (index < 0 || index >= nodeLength) { in RemoveByIndex() 99 oss << "The value of \"index\" is out of range. It must be >= 0 && <= " << size in RemoveByIndex() 100 << ". Received value is: " << index; in RemoveByIndex() 104 return doubleList->RemoveByIndex(thread, index); in RemoveByIndex() [all …]
|
| D | js_api_queue.cpp | 77 uint32_t index = queue->GetFront(); in GetFirst() local 81 return elements->Get(index); in GetFirst() 104 JSTaggedValue JSAPIQueue::Get(JSThread *thread, const uint32_t index) in Get() argument 107 if (index >= length) { in Get() 109 oss << "The value of \"Get property index\" is out of range. It must be >= 0 && <= " in Get() 110 << (length - 1) << ". Received value is: " << index; in Get() 119 uint32_t curIndex = (front + index) % capacity; in Get() 123 JSTaggedValue JSAPIQueue::Set(JSThread *thread, const uint32_t index, JSTaggedValue value) in Set() argument 125 if (index < 0 || index >= GetLength().GetArrayLength()) { in Set() 127 oss << "The value of \"Set property index\" is out of range. It must be >= 0 && <= " in Set() [all …]
|
| D | js_api_stack.cpp | 99 JSTaggedValue JSAPIStack::Get(const uint32_t index) in Get() argument 101 ASSERT(static_cast<int>(index) <= GetTop()); in Get() 103 return elements->Get(index); in Get() 106 JSTaggedValue JSAPIStack::Set(JSThread *thread, const uint32_t index, JSTaggedValue value) in Set() argument 109 elements->Set(thread, index, value); in Set() 145 uint32_t index = 0; in GetOwnProperty() local 146 if (UNLIKELY(!JSTaggedValue::ToElementIndex(key.GetTaggedValue(), &index))) { in GetOwnProperty() 149 "The type of \"index\" can not obtain attributes of no-number type. Received value is: " in GetOwnProperty() 156 if (index >= length) { in GetOwnProperty() 158 oss << "The value of \"index\" is out of range. It must be > " << (length - 1) in GetOwnProperty() [all …]
|
| D | js_api_lightweightset.cpp | 36 int32_t index = obj->GetHashIndex(value, size); in Add() local 37 if (index >= 0) { in Add() 40 index ^= JSAPILightWeightSet::HASH_REBELLION; in Add() 41 if (index < size) { in Add() 42 obj->AdjustArray(thread, hashArray, index, size, true); in Add() 43 obj->AdjustArray(thread, valueArray, index, size, true); in Add() 54 hashArray->Set(thread, index, JSTaggedValue(hashCode)); in Add() 55 valueArray->Set(thread, index, value.GetTaggedValue()); in Add() 61 JSTaggedValue JSAPILightWeightSet::Get(const uint32_t index) in Get() argument 64 return valueArray->Get(index); in Get() [all …]
|
| D | js_api_vector.cpp | 44 const JSHandle<JSTaggedValue> &value, int32_t index) in Insert() argument 47 if (index < 0 || index > length) { in Insert() 48 THROW_ERROR(thread, ErrorType::RANGE_ERROR, "the index is out-of-bounds"); in Insert() 54 for (int32_t i = length - 1; i >= index; i--) { in Insert() 58 elements->Set(thread, index, value); in Insert() 102 const JSHandle<JSTaggedValue> &obj, int32_t index) in GetIndexFrom() argument 107 if (index < 0) { in GetIndexFrom() 108 index = 0; in GetIndexFrom() 109 } else if (index >= length) { in GetIndexFrom() 114 for (int32_t i = index; i < length; i++) { in GetIndexFrom() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/ |
| D | tagged_tree.cpp | 40 void TaggedTree<Derived>::InsertRebalance(const JSThread *thread, int index) in InsertRebalance() argument 42 while (IsValidIndex(index) && GetColor(GetParent(index)) == TreeColor::RED) { in InsertRebalance() 43 if (IsLeft(GetParent(index))) { in InsertRebalance() 44 int bro = GetLeftBrother(GetParent(index)); in InsertRebalance() 46 SetColor(thread, GetParent(index), TreeColor::BLACK); in InsertRebalance() 48 SetColor(thread, GetParent(GetParent(index)), TreeColor::RED); in InsertRebalance() 49 index = GetParent(GetParent(index)); in InsertRebalance() 51 if (IsRight(index)) { in InsertRebalance() 52 index = GetParent(index); in InsertRebalance() 53 LeftRotate(thread, index); in InsertRebalance() [all …]
|
| D | tagged_tree.h | 31 …* | the number of elements | the number of hole elements | the number of capacity | root index | c… 82 int index = EntryToIndex(entry); in GetKey() local 83 return GetElement(index); in GetKey() 88 int index = static_cast<int>(EntryToIndex(entry) + Derived::ENTRY_VALUE_INDEX); in GetValue() local 89 return GetElement(index); in GetValue() 97 int index = static_cast<int>(EntryToIndex(entry) + Derived::ENTRY_COLOR_INDEX); in GetColor() local 98 JSTaggedValue color = GetElement(index); in GetColor() 171 int index = EntryToIndex(entry); in SetKey() local 172 SetElement(thread, index, key); in SetKey() 177 int index = static_cast<int>(EntryToIndex(entry) + Derived::ENTRY_VALUE_INDEX); in SetValue() local [all …]
|
| D | global_env_constants-inl.h | 35 inline void GlobalEnvConstants::SetConstant(ConstantIndex index, JSTaggedValue value) in SetConstant() argument 37 DASSERT_PRINT(index >= ConstantIndex::CONSTATNT_BEGIN && index < ConstantIndex::CONSTATNT_END, in SetConstant() 38 "Root Index out of bound"); in SetConstant() 39 constants_[static_cast<int>(index)] = value; in SetConstant() 43 inline void GlobalEnvConstants::SetConstant(ConstantIndex index, JSHandle<T> value) in SetConstant() argument 45 DASSERT_PRINT(index >= ConstantIndex::CONSTATNT_BEGIN && index < ConstantIndex::CONSTATNT_END, in SetConstant() 46 "Root Index out of bound"); in SetConstant() 47 constants_[static_cast<int>(index)] = value.GetTaggedValue(); in SetConstant() 50 inline uintptr_t GlobalEnvConstants::GetGlobalConstantAddr(ConstantIndex index) const in GetGlobalConstantAddr() argument 52 return ToUintPtr(this) + sizeof(JSTaggedValue) * static_cast<uint32_t>(index); in GetGlobalConstantAddr() [all …]
|
| D | layout_info-inl.h | 40 inline uint32_t LayoutInfo::GetKeyIndex(int index) const in GetKeyIndex() argument 42 return static_cast<uint32_t>(index) << ELEMENTS_INDEX_LOG2; in GetKeyIndex() 45 inline uint32_t LayoutInfo::GetAttrIndex(int index) const in GetAttrIndex() argument 47 return (static_cast<uint32_t>(index) << ELEMENTS_INDEX_LOG2) + ATTR_INDEX_OFFSET; in GetAttrIndex() 50 inline void LayoutInfo::SetPropertyInit(const JSThread *thread, int index, const JSTaggedValue &key, in SetPropertyInit() argument 53 uint32_t fixed_idx = GetKeyIndex(index); in SetPropertyInit() 58 inline void LayoutInfo::SetNormalAttr(const JSThread *thread, int index, const PropertyAttributes &… in SetNormalAttr() argument 60 uint32_t fixed_idx = GetAttrIndex(index); in SetNormalAttr() 66 inline JSTaggedValue LayoutInfo::GetKey(int index) const in GetKey() argument 68 uint32_t fixed_idx = GetKeyIndex(index); in GetKey() [all …]
|
| D | js_thread.h | 68 void Set(size_t index, Address addr) in Set() 70 ASSERT(index < COUNT); in Set() 71 stubEntries_[index] = addr; in Set() 79 Address Get(size_t index) const in Get() 81 ASSERT(index < COUNT); in Get() 82 return stubEntries_[index]; in Get() 94 void Set(size_t index, Address addr) in Set() 96 ASSERT(index < COUNT); in Set() 97 stubEntries_[index] = addr; in Set() 100 Address Get(size_t index) const in Get() [all …]
|
| D | tagged_list.h | 41 … const JSHandle<JSTaggedValue> &value, const int index, int prevDataIndex); 46 JSTaggedValue FindElementByIndex(int index) const; 50 int FindDataIndexByNodeIndex(int index) const; 53 int FindPrevNodeByIndex(int index) const; 55 JSTaggedValue RemoveByIndex(JSThread *thread, const int &index); 78 inline void SetElement(const JSThread *thread, int index, const JSTaggedValue &element) in SetElement() argument 80 if (UNLIKELY((index < 0 || index >= static_cast<int>(GetLength())))) { in SetElement() 83 Set(thread, index, element); in SetElement() 86 inline JSTaggedValue GetElement(int index) const in GetElement() argument 88 if (UNLIKELY((index < 0 || index >= static_cast<int>(GetLength())))) { in GetElement() [all …]
|
| D | layout_info.h | 45 uint32_t GetKeyIndex(int index) const; 46 uint32_t GetAttrIndex(int index) const; 47 …void SetPropertyInit(const JSThread *thread, int index, const JSTaggedValue &key, const PropertyAt… 48 void SetKey(const JSThread *thread, int index, const JSTaggedValue &key); 49 void SetNormalAttr(const JSThread *thread, int index, const PropertyAttributes &attr); 50 JSTaggedValue GetKey(int index) const; 51 PropertyAttributes GetAttr(int index) const; 52 JSTaggedValue GetSortedKey(int index) const; 53 uint32_t GetSortedIndex(int index) const; 54 void SetSortedIndex(const JSThread *thread, int index, int sortedIndex); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/mem/ |
| D | gc_bitset.h | 63 void SetGCWords(uint32_t index) // Only used for snapshot to record region index in SetGCWords() argument 65 *reinterpret_cast<GCBitsetWord *>(this) = index; in SetGCWords() 92 Words()[Index(offset)] &= ~Mask(IndexInWord(offset)); in ClearBit() 99 uint32_t startIndex = Index(offsetBegin); in ClearBitRange() 101 uint32_t endIndex = Index(offsetEnd - 1); in ClearBitRange() 117 return Words()[Index(offset)] & Mask(IndexInWord(offset)); in TestBit() 125 uint32_t index = BIT_PER_WORD; in IterateMarkedBits() local 129 index = static_cast<uint32_t>(__builtin_ctz(word)); in IterateMarkedBits() 130 ASSERT(index < BIT_PER_WORD); in IterateMarkedBits() 131 if (!visitor(reinterpret_cast<void *>(begin + (index << TAGGED_TYPE_SIZE_LOG)))) { in IterateMarkedBits() [all …]
|
| /arkcompiler/runtime_core/libpandabase/mem/ |
| D | base_mem_stats.cpp | 33 auto index = helpers::ToUnderlying(type_mem); in RecordAllocate() local 36 allocated_[index].fetch_add(size, std::memory_order_acq_rel); in RecordAllocate() 41 auto index = helpers::ToUnderlying(type_mem); in RecordMoved() local 44 uint64_t old_value = allocated_[index].fetch_sub(size, std::memory_order_acq_rel); in RecordMoved() 57 auto index = helpers::ToUnderlying(type_mem); in RecordFree() local 60 freed_[index].fetch_add(size, std::memory_order_acq_rel); in RecordFree() 80 for (size_t index = 0; index < SPACE_TYPE_SIZE; index++) { in GetAllocatedHeap() local 81 SpaceType type = ToSpaceType(index); in GetAllocatedHeap() 85 result += allocated_[index].load(std::memory_order_acquire); in GetAllocatedHeap() 94 for (size_t index = 0; index < SPACE_TYPE_SIZE; index++) { in GetFreedHeap() local [all …]
|
| /arkcompiler/runtime_core/verification/util/ |
| D | index.h | 29 class Index { 31 Index() : Value_ {INVALID} {} in Index() function 32 Index(Int val) : Value_ {val} in Index() function 36 Index &operator=(Int val) 42 Index(const Index &) = default; 43 Index(Index &&idx) : Value_ {idx.Value_} in Index() function 47 Index &operator=(const Index &) = default; 48 Index &operator=(Index &&idx) 54 ~Index() = default; 56 bool operator==(const Index &other) const [all …]
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | transitions_dictionary_test.cpp | 132 for (int index = 0; index < eleNum; index++) { in HWTEST_F_L0() local 133 std::string keyStr = "key" + std::to_string(index); in HWTEST_F_L0() 134 std::string valueStr = "value" + std::to_string(index); in HWTEST_F_L0() 151 for (int index = 0; index < numberOfElements; index++) { in HWTEST_F_L0() local 152 transDic->SetAttributes(thread, index, JSTaggedValue(index)); in HWTEST_F_L0() 153 JSTaggedValue value = transDic->GetAttributes(index); in HWTEST_F_L0() 154 EXPECT_EQ(value, JSTaggedValue(index)); in HWTEST_F_L0() 165 for (int index = 0; index < numberOfElements; index++) { in HWTEST_F_L0() local 166 std::string keyStr = "key" + std::to_string(index); in HWTEST_F_L0() 167 std::string valueStr = "value" + std::to_string(index); in HWTEST_F_L0() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/ |
| D | frame_states.h | 34 void SetValuesAt(size_t index, GateRef gate) in SetValuesAt() argument 36 ASSERT(index < values_.size()); in SetValuesAt() 37 values_[index] = gate; in SetValuesAt() 40 void SetBit(size_t index) in SetBit() argument 42 liveout_.SetBit(index); in SetBit() 45 void ClearBit(size_t index) in ClearBit() argument 47 liveout_.ClearBit(index); in ClearBit() 50 GateRef ValuesAt(size_t index) const in ValuesAt() argument 52 ASSERT(index < values_.size()); in ValuesAt() 53 return values_[index]; in ValuesAt() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/ic/ |
| D | profile_type_info.cpp | 27 auto index = slotId_; in AddElementHandler() local 29 profileTypeInfo_->Set(thread_, index, GetWeakRef(hclass.GetTaggedValue())); in AddElementHandler() 30 profileTypeInfo_->Set(thread_, index + 1, handler.GetTaggedValue()); in AddElementHandler() 35 profileTypeInfo_->Set(thread_, index, GetWeakRef(hclass.GetTaggedValue())); in AddElementHandler() 36 profileTypeInfo_->Set(thread_, index + 1, handler.GetTaggedValue()); in AddElementHandler() 44 auto index = slotId_; in AddHandlerWithoutKey() local 46 profileTypeInfo_->Set(thread_, index, handler.GetTaggedValue()); in AddHandlerWithoutKey() 52 profileTypeInfo_->Set(thread_, index, GetWeakRef(hclass.GetTaggedValue())); in AddHandlerWithoutKey() 53 profileTypeInfo_->Set(thread_, index + 1, handler.GetTaggedValue()); in AddHandlerWithoutKey() 57 ASSERT(profileTypeInfo_->Get(index + 1) == JSTaggedValue::Hole()); in AddHandlerWithoutKey() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/deoptimizer/ |
| D | deoptimizer.h | 46 enum class Index : size_t { enum 54 static_assert(static_cast<size_t>(Index::NUM_OF_MEMBER) == NumOfTypes); 58 return GetOffset<static_cast<size_t>(Index::OUTPUT_COUNT_INDEX)>(isArch32); in GetOutputCountOffset() 63 return GetOffset<static_cast<size_t>(Index::CALLFRAME_TOP_INDEX)>(isArch32); in GetCallFrameTopOffset() 68 return GetOffset<static_cast<size_t>(Index::RETURN_ADDRESS_INDEX)>(isArch32); in GetReturnAddressOffset() 73 return GetOffset<static_cast<size_t>(Index::CALLERFRAME_POINTER_INDEX)>(isArch32); in GetCallerFpOffset() 114 size_t GetFrameIndex(kungfu::CommonArgIdx index) in GetFrameIndex() argument 116 return static_cast<size_t>(index) - static_cast<size_t>(kungfu::CommonArgIdx::FUNC); in GetFrameIndex() 124 JSTaggedValue GetFrameArgv(kungfu::CommonArgIdx index) in GetFrameArgv() argument 126 return GetFrameArgv(GetFrameIndex(index)); in GetFrameArgv() [all …]
|
| /arkcompiler/ets_runtime/test/moduletest/arrayforeach/ |
| D | arrayforeach.js | 23 let func = (item, index) => `${index}_${JSON.stringify(item)}`; argument 26 array1.forEach((item, index) => { 27 print(func(item, index)); 31 array2.forEach((item, index) => { 33 print(func(item, index)); 37 array3.forEach((item, index) => { 38 func(item, index); 43 array4.forEach((item, index) => { 44 func(item, index);
|