/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_util/include/ |
H A D | ptr_list_ref.h | 38 void SetPrev(T *ptr) in SetPrev() argument 40 prev = ptr; in SetPrev() 43 void SetNext(T *ptr) in SetNext() argument 45 next = ptr; in SetNext() 151 explicit PtrListRefIterator(pointer ptr) : ptr(ptr) {} in PtrListRefIterator() argument 154 PtrListRefIterator(const PtrListRefIterator<U> &iter) : ptr(iter.d()) in PtrListRefIterator() 162 return ptr; in d() 167 return *ptr; in operator *() 212 pointer ptr = nullptr; global() member in maple::PtrListRefIterator 404 auto *ptr = const_cast<T *>(&*where); insert() local 425 auto *ptr = const_cast<T *>(&*where); insertAfter() local 453 auto *ptr = const_cast<T *>(&*where); splice() local 479 auto *ptr = const_cast<T *>(&*where); erase() local 488 auto *ptr = const_cast<T *>(&*where); erase() local [all...] |
H A D | safe_ptr.h | 19 #include "ptr.h" 24 inline void AssertNotNull(const T *ptr) in AssertNotNull() argument 26 CHECK_FATAL(ptr != nullptr, "nullptr was assigned to SafePtr."); in AssertNotNull() 41 SafePtr(pointer ptr) : base(ptr) {} in SafePtr() argument 48 SafePtr(U *ptr) : base(ptr) in SafePtr() argument 76 SafePtr &operator=(pointer ptr) noexcept 78 base = ptr; 84 SafePtr &operator=(const SafePtr &ptr) noexcep 116 AssertNotNull(ptr); global() variable 219 ToRef(SafePtr<T> ptr) ToRef() argument [all...] |
H A D | ptr.h | 46 explicit Ptr(Pointer ptr) : pointer(ptr) in Ptr() argument 48 Check(ptr); in Ptr() 69 explicit Ptr(U *ptr) : pointer(ptr) in Ptr() argument 119 Ptr &operator=(Pointer ptr) noexcept 121 Check(ptr); variable 122 pointer = ptr; 133 Ptr &operator=(const Ptr &ptr) noexcept 135 if (&ptr ! 173 Check(ptr); global() variable [all...] |
/arkcompiler/runtime_core/static_core/runtime/tooling/sampler/ |
H A D | stack_walker_base.h | 86 static bool IsBoundaryFrame(const void *ptr) in IsBoundaryFrame() argument 89 return GetBoundaryFrameMethod<KIND>(ptr) == COMPILED_CODE_TO_INTERPRETER; in IsBoundaryFrame() 91 return GetBoundaryFrameMethod<KIND>(ptr) == INTERPRETER_TO_COMPILED_CODE; in IsBoundaryFrame() 96 static uintptr_t GetBoundaryFrameMethod(const void *ptr) in GetBoundaryFrameMethod() argument 98 auto frameMethod = reinterpret_cast<uintptr_t>(GetMethodFromBoundary<KIND>(ptr)); in GetBoundaryFrameMethod() 103 static Method *GetMethodFromBoundary(void *ptr) in GetMethodFromBoundary() argument 106 return *(reinterpret_cast<Method **>(ptr) + BoundaryFrame<KIND>::METHOD_OFFSET); in GetMethodFromBoundary() 110 static const Method *GetMethodFromBoundary(const void *ptr) in GetMethodFromBoundary() argument 113 return *(reinterpret_cast<Method *const *>(ptr) + BoundaryFrame<KIND>::METHOD_OFFSET); in GetMethodFromBoundary() 117 static SlotType *GetPrevFromBoundary(void *ptr) in GetPrevFromBoundary() argument [all...] |
H A D | stack_walker_base.cpp | 26 StackWalkerBase::FrameVariant StackWalkerBase::GetTopFrameFromFp(void *ptr, bool isFrameCompiled) in GetTopFrameFromFp() argument 29 if (IsBoundaryFrame<FrameKind::INTERPRETER>(ptr)) { in GetTopFrameFromFp() 30 auto bp = GetPrevFromBoundary<FrameKind::INTERPRETER>(ptr); in GetTopFrameFromFp() 34 return CreateCFrame(GetPrevFromBoundary<FrameKind::INTERPRETER>(ptr)); // NOLINT in GetTopFrameFromFp() 36 return CreateCFrame(reinterpret_cast<SlotType *>(ptr)); in GetTopFrameFromFp() 38 return reinterpret_cast<Frame *>(ptr); in GetTopFrameFromFp() 41 StackWalkerBase::CFrameType StackWalkerBase::CreateCFrame(SlotType *ptr) in CreateCFrame() argument 43 CFrameType cframe(ptr); in CreateCFrame()
|
/arkcompiler/runtime_core/static_core/plugins/ets/runtime/interop_js/ets_proxy/ |
H A D | typed_pointer.h | 27 explicit TypedPointer(U *ptr) in TypedPointer() 30 SetTagged(ptr, true); in TypedPointer() 33 explicit TypedPointer(R *ptr) in TypedPointer() 36 SetTagged(ptr, false); in TypedPointer() 58 void Set(T *ptr) in Set() 60 *this = TypedPointer(ptr); in Set() 81 void SetTagged(T *ptr, bool tag) in SetTagged() 83 ptr_ = reinterpret_cast<uintptr_t>(ptr); in SetTagged()
|
/arkcompiler/ets_runtime/ecmascript/mem/ |
H A D | caddress_allocator.h | 73 pointer allocate(size_type n, [[maybe_unused]] const void *ptr = nullptr) in allocate() 109 void *ptr = malloc(size); in Allocate() local 110 if (ptr == nullptr) { in Allocate() 114 return ptr; in Allocate() 126 void Finalize(S *ptr) in Finalize() argument 128 ASSERT(ptr != nullptr); in Finalize() 131 ptr->~S(); in Finalize() 133 Free(ptr); in Finalize() 141 void Delete(T *ptr) in Delete() argument 143 if (ptr in Delete() [all...] |
H A D | chunk.h | 73 void Delete(T *ptr) in Delete() argument 75 ASSERT(ptr != nullptr); in Delete() 78 ptr->~T(); in Delete() 80 Free(ptr); in Delete() 110 void operator delete([[maybe_unused]] void* ptr) in operator delete() argument
|
/arkcompiler/ets_runtime/ecmascript/base/ |
H A D | atomic_helper.h | 28 T operator()(T *ptr, const T *arg, [[maybe_unused]] uint32_t length) const
in operator ()() 31 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr);
in operator ()() 38 T operator()(T *ptr, const T *arg, [[maybe_unused]] uint32_t length) const
in operator ()() 41 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr);
in operator ()() 48 T operator()(T *ptr, const T *arg, [[maybe_unused]] uint32_t length) const
in operator ()() 51 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr);
in operator ()() 58 T operator()(T *ptr, const T *arg, [[maybe_unused]] uint32_t length) const
in operator ()() 61 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr);
in operator ()() 68 T operator()(T *ptr, const T *arg, [[maybe_unused]] uint32_t length) const
in operator ()() 71 std::atomic<T> *atomicValue = reinterpret_cast<std::atomic<T> *>(ptr);
in operator ()() [all...] |
/arkcompiler/runtime_core/static_core/runtime/tests/ |
H A D | internal_allocator_test.cpp | 156 auto isAligned = [](void *ptr) { return IsAligned(reinterpret_cast<uintptr_t>(ptr), ALIGNMENT); }; in TEST_F() 158 auto *ptr = allocator_->Alloc(N); in TEST_F() local 159 if (!isAligned(ptr)) { in TEST_F() 160 allocator_->Free(ptr); in TEST_F() 161 ptr = nullptr; in TEST_F() 183 if (ptr != nullptr) { in TEST_F() 184 allocator_->Free(ptr); in TEST_F() 198 auto isAligned = [](void *ptr) { return IsAligned(reinterpret_cast<uintptr_t>(ptr), ALIGNMEN in TEST_F() 200 auto *ptr = allocator_->AllocLocal(N); TEST_F() local [all...] |
H A D | mem_leak_test.cpp | 43 auto ptr = allocator->Alloc(4); in TEST_F() 44 ASSERT_NE(ptr, nullptr); in TEST_F() 57 auto ptr = allocator->Alloc(1_KB); in TEST_F() 58 ASSERT_NE(ptr, nullptr); in TEST_F() 71 auto ptr = allocator->Alloc(1_MB); in TEST_F() 72 ASSERT_NE(ptr, nullptr); in TEST_F()
|
/arkcompiler/runtime_core/static_core/irtoc/backend/compiler/tests/ |
H A D | dangling_pointers_checker_test.cpp | 40 // correct_acc_load := LoadI(LiveIn(frame).ptr).Imm(frame_acc_offset).ref 42 // correct_acc_store := StoreI(LiveIn(frame).ptr, correct_acc_load).Imm(frame_acc_offset).ref 60 INST(0U, Opcode::LiveIn).ptr().DstReg(DanglingPointersChecker::regmap_[arch]["frame"]); in TEST_F() 61 INST(1U, Opcode::LiveIn).ptr().DstReg(DanglingPointersChecker::regmap_[arch]["acc"]); in TEST_F() 62 INST(2U, Opcode::LiveIn).ptr().DstReg(DanglingPointersChecker::regmap_[arch]["acc_tag"]); in TEST_F() 70 INST(30U, Opcode::AddI).Inputs(0U).ptr().Imm(frameAccOffset); in TEST_F() 73 INST(3U, Opcode::Call).TypeId(0U).ptr(); in TEST_F() 85 // acc_ptr := AddI(LiveIn(frame).ptr).Imm(frame_acc_offset).ptr 88 // correct_acc_store := StoreI(LiveIn(frame).ptr, correct_acc_loa [all...] |
/arkcompiler/runtime_core/static_core/runtime/include/ |
H A D | stack_walker.h | 210 static SlotType *GetPrevFromBoundary(void *ptr) in GetPrevFromBoundary() argument 215 return *(reinterpret_cast<SlotType **>(ptr)); in GetPrevFromBoundary() 219 static uintptr_t GetBoundaryFrameMethod(const void *ptr) in GetBoundaryFrameMethod() argument 221 auto frameMethod = reinterpret_cast<uintptr_t>(GetMethodFromBoundary<KIND>(ptr)); in GetBoundaryFrameMethod() 226 static bool IsBoundaryFrame(const void *ptr) in IsBoundaryFrame() argument 229 return GetBoundaryFrameMethod<KIND>(ptr) == COMPILED_CODE_TO_INTERPRETER; in IsBoundaryFrame() 231 return GetBoundaryFrameMethod<KIND>(ptr) == INTERPRETER_TO_COMPILED_CODE; in IsBoundaryFrame() 283 CFrameType CreateCFrame(SlotType *ptr, uintptr_t npc, SlotType *calleeSlots, CalleeStorage *prevCallees = nullptr); 307 FrameVariant GetTopFrameFromFp(void *ptr, bool isFrameCompiled, uintptr_t npc); 312 static Method *GetMethodFromCBoundary(void *ptr) in GetMethodFromCBoundary() argument 319 GetMethodFromBoundary(void *ptr) GetMethodFromBoundary() argument 326 GetMethodFromBoundary(const void *ptr) GetMethodFromBoundary() argument 333 GetReturnAddressFromBoundary(const void *ptr) GetReturnAddressFromBoundary() argument 340 GetCalleeStackFromBoundary(void *ptr) GetCalleeStackFromBoundary() argument [all...] |
/arkcompiler/runtime_core/static_core/runtime/entrypoints/ |
H A D | string_index_of.h | 74 auto ptr = dataTyped + offset; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) in StringIndexOfSwar() local 76 std::min((reinterpret_cast<uintptr_t>(ptr) & ~(sizeof(LoadType) - 1)) + sizeof(LoadType), in StringIndexOfSwar() 78 ASSERT(prefixEnd >= ptr); in StringIndexOfSwar() 80 while (ptr < prefixEnd) { in StringIndexOfSwar() 81 if (*ptr == character) { in StringIndexOfSwar() 82 return ptr - dataTyped; in StringIndexOfSwar() 84 ++ptr; in StringIndexOfSwar() 89 while (ptr < mainEnd) { in StringIndexOfSwar() 90 LoadType value = *reinterpret_cast<LoadType *>(ptr); in StringIndexOfSwar() 96 ASSERT(ptr[id in StringIndexOfSwar() [all...] |
/arkcompiler/ets_runtime/test/fuzztest/jsvaluerefisasync_fuzzer/ |
H A D | jsvaluerefisasync_fuzzer.cpp | 40 uint8_t* ptr = nullptr; in JSValueRefIsAsyncGeneratorFunctionTrueFuzzTest() local 41 ptr = const_cast<uint8_t*>(data); in JSValueRefIsAsyncGeneratorFunctionTrueFuzzTest() 62 uint8_t* ptr = nullptr; in JSValueRefIsAsyncGeneratorFunctionFalseFuzzTest() local 63 ptr = const_cast<uint8_t*>(data); in JSValueRefIsAsyncGeneratorFunctionFalseFuzzTest() 81 uint8_t* ptr = nullptr; in JSValueRefIsAsyncGeneratorObjectTrueFuzzTest() local 82 ptr = const_cast<uint8_t*>(data); in JSValueRefIsAsyncGeneratorObjectTrueFuzzTest() 103 uint8_t* ptr = nullptr; in JSValueRefIsAsyncGeneratorObjectFalseFuzzTest() local 104 ptr = const_cast<uint8_t*>(data); in JSValueRefIsAsyncGeneratorObjectFalseFuzzTest()
|
/arkcompiler/ets_runtime/test/fuzztest/objectrefall_fuzzer/ |
H A D | objectrefall_fuzzer.cpp | 33 uint8_t *ptr = nullptr; in ObjectGetPrototypeFuzzTest() local 35 ptr = const_cast<uint8_t*>(data); in ObjectGetPrototypeFuzzTest() 51 uint8_t *ptr = nullptr; in ObjectSealFuzzTest() local 53 ptr = const_cast<uint8_t*>(data); in ObjectSealFuzzTest() 69 uint8_t *ptr = nullptr; in ObjectFreezeFuzzTest() local 71 ptr = const_cast<uint8_t*>(data); in ObjectFreezeFuzzTest()
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/compiler/ |
H A D | interop_intrinsics_opt_test.cpp | 83 PARAMETER(1U, 1U).ptr(); // Pass this and function values as parameters to simplify the test in SingleBlockBuildInitialGraph() 84 PARAMETER(2U, 2U).ptr(); in SingleBlockBuildInitialGraph() 91 INTRINSIC(6U, COMPILER_CONVERT_I32_TO_LOCAL).ptr().InputsAutoType(0U, 4U); in SingleBlockBuildInitialGraph() 92 INTRINSIC(7U, COMPILER_JS_CALL_FUNCTION).ptr().InputsAutoType(1U, 2U, 3U, 6U, 6U, 4U); in SingleBlockBuildInitialGraph() 101 INTRINSIC(14U, COMPILER_CONVERT_I32_TO_LOCAL).ptr().InputsAutoType(11U, 12U); in SingleBlockBuildInitialGraph() 102 INTRINSIC(15U, COMPILER_CONVERT_JS_VALUE_TO_LOCAL).ptr().InputsAutoType(8U, 12U); in SingleBlockBuildInitialGraph() 103 INTRINSIC(16U, COMPILER_JS_CALL_FUNCTION).ptr().InputsAutoType(1U, 2U, 3U, 14U, 15U, 12U); in SingleBlockBuildInitialGraph() 117 PARAMETER(1U, 1U).ptr(); // Pass this and function values as parameters to simplify the test in SingleBlockBuildExpectedGraph() 118 PARAMETER(2U, 2U).ptr(); in SingleBlockBuildExpectedGraph() 125 INTRINSIC(6U, COMPILER_CONVERT_I32_TO_LOCAL).ptr() in SingleBlockBuildExpectedGraph() [all...] |
/arkcompiler/runtime_core/static_core/libpandafile/ |
H A D | panda_cache.h | 39 Method *ptr {nullptr}; 44 Field *ptr {nullptr}; 49 Class *ptr {nullptr}; 92 return pair.ptr; in GetMethodFromCache() 105 pair.ptr = method; in SetMethodCache() 127 return pair.ptr; in GetFieldFromCache() 143 pair.ptr = field; in SetFieldCache() 162 return pair.ptr; in GetClassFromCache() 175 pair.ptr = clazz; in SetClassCache() 205 if (pair.ptr ! in EnumerateCachedClasses() [all...] |
H A D | file.cpp | 152 os::mem::BytePtr ptr(reinterpret_cast<std::byte *>(mem), sizeToMmap, os::mem::MmapDeleter); in OpenPandaFileFromZipFile() 156 auto ret = os::mem::TagAnonymousMemory(reinterpret_cast<void *>(ptr.Get()), sizeToMmap, it->second.c_str()); in OpenPandaFileFromZipFile() 162 auto extractError = ExtractToMemory(handle, reinterpret_cast<uint8_t *>(ptr.Get()), sizeToMmap); in OpenPandaFileFromZipFile() 168 os::mem::ConstBytePtr constPtr = ptr.ToConst(); in OpenPandaFileFromZipFile() 300 os::mem::ConstBytePtr ptr(reinterpret_cast<std::byte *>(mem), sizeToMmap, os::mem::MmapDeleter); in OpenPandaFileFromMemory() 301 if (ptr.Get() == nullptr) { in OpenPandaFileFromMemory() 306 return panda_file::File::OpenFromMemory(std::move(ptr), std::to_string(hash(mem))); in OpenPandaFileFromMemory() 486 os::mem::ConstBytePtr ptr = os::mem::MapFile(file, GetProt(openMode), os::mem::MMAP_FLAG_PRIVATE, size).ToConst(); in Open() local 487 if (ptr.Get() == nullptr) { in Open() 492 if (!CheckHeader(ptr, filenam in Open() 516 os::mem::ConstBytePtr ptr = OpenUncompressedArchive() local 530 CheckHeader(const os::mem::ConstBytePtr &ptr, const std::string_view &filename) CheckHeader() argument 559 OpenFromMemory(os::mem::ConstBytePtr &&ptr) OpenFromMemory() argument 570 OpenFromMemory(os::mem::ConstBytePtr &&ptr, std::string_view filename) OpenFromMemory() argument [all...] |
/arkcompiler/runtime_core/static_core/libpandabase/tests/ |
H A D | mem_hooks_test.cpp | 25 char *ptr = static_cast<char *>(malloc(5_MB)); // NOLINT(cppcoreguidelines-no-malloc) in MallocFunc() local 26 ptr[0U] = 'a'; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) in MallocFunc() 27 ptr[1U] = '\0'; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) in MallocFunc() 28 std::cout << ptr << std::endl; // NOLINT(clang-analyzer-unix.Malloc) in MallocFunc()
|
/arkcompiler/ets_runtime/compiler_service/test/fuzztest/compilerinterfacestub_fuzzer/ |
H A D | compilerinterfacestub_fuzzer.cpp | 39 uint32_t GetU32Data(const char* ptr) in GetU32Data() argument 41 return (ptr[DATA_ZERO] << OFFSET_THREE) | (ptr[DATA_ONE] << OFFSET_TWO) | in GetU32Data() 42 (ptr[DATA_TWO] << OFFSET_ONE) | (ptr[DATA_THREE]); in GetU32Data()
|
/arkcompiler/runtime_core/static_core/compiler/tests/aarch64/ |
H A D | encoder64_test.h | 85 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 86 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 89 ResetCodeAllocator(ptr, size); in CallCode() 129 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 130 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 132 ResetCodeAllocator(ptr, size); in CallCode() 171 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 172 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 174 ResetCodeAllocator(ptr, size); in CallCode() 209 void *ptr in CallCode() local 247 void *ptr = codeAlloc_->AllocateCode(size, offset); CallCodeStore() local 260 void *ptr = codeAlloc_->AllocateCode(size, offset); CallCodeCall() local [all...] |
/arkcompiler/runtime_core/static_core/compiler/tests/amd64/ |
H A D | encoder64_test.h | 77 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 78 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 81 ResetCodeAllocator(ptr, size); in CallCode() 121 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 122 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 124 ResetCodeAllocator(ptr, size); in CallCode() 164 void *ptr = codeAlloc_->AllocateCode(size, offset); in CallCode() local 165 auto func = reinterpret_cast<FunctPtr>(ptr); in CallCode() 167 ResetCodeAllocator(ptr, size); in CallCode() 202 void *ptr in CallCode() local 241 void *ptr = codeAlloc_->AllocateCode(size, offset); CallCodeStore() local 254 void *ptr = codeAlloc_->AllocateCode(size, offset); CallCodeCall() local [all...] |
/arkcompiler/runtime_core/libpandafile/ |
H A D | file.cpp | 151 os::mem::BytePtr ptr(reinterpret_cast<std::byte *>(mem), size_to_mmap, os::mem::MmapDeleter); in OpenPandaFileFromZipFile() 155 auto ret = os::mem::TagAnonymousMemory(reinterpret_cast<void *>(ptr.Get()), size_to_mmap, it->second.c_str()); in OpenPandaFileFromZipFile() 161 auto extract_error = ExtractToMemory(handle, reinterpret_cast<uint8_t *>(ptr.Get()), size_to_mmap); in OpenPandaFileFromZipFile() 167 os::mem::ConstBytePtr ConstPtr = ptr.ToConst(); in OpenPandaFileFromZipFile() 293 os::mem::ConstBytePtr ptr(reinterpret_cast<std::byte *>(mem), size_to_mmap, os::mem::MmapDeleter); in OpenPandaFileFromMemory() 294 if (ptr.Get() == nullptr) { in OpenPandaFileFromMemory() 299 return panda_file::File::OpenFromMemory(std::move(ptr), std::to_string(hash(mem))); in OpenPandaFileFromMemory() 315 os::mem::ConstBytePtr ptr(mem, size, nullptr); in OpenPandaFileFromSecureMemory() 316 if (ptr.Get() == nullptr) { in OpenPandaFileFromSecureMemory() 322 return panda_file::File::OpenFromMemory(std::move(ptr), st in OpenPandaFileFromSecureMemory() 548 os::mem::ConstBytePtr ptr = os::mem::MapFile(file, GetProt(open_mode), os::mem::MMAP_FLAG_PRIVATE, size).ToConst(); Open() local 577 os::mem::ConstBytePtr ptr = OpenUncompressedArchive() local 600 CheckHeader(const os::mem::ConstBytePtr &ptr, const std::string_view &filename) CheckHeader() argument 697 OpenFromMemory(os::mem::ConstBytePtr &&ptr) OpenFromMemory() argument 707 OpenFromMemory(os::mem::ConstBytePtr &&ptr, std::string_view filename) OpenFromMemory() argument [all...] |
/arkcompiler/ets_runtime/test/fuzztest/jsnapisetloop_fuzzer/ |
H A D | jsnapisetloop_fuzzer.cpp | 33 void *ptr = reinterpret_cast<void*>(const_cast<uint8_t*>(data)); in JSNApiSetLoopFuzzTest() local 34 JSNApi::SetLoop(vm, ptr); in JSNApiSetLoopFuzzTest() 47 uint8_t *ptr = nullptr; in JSNApiSynchronizVMInfoFuzzTest() local 48 ptr = const_cast<uint8_t*>(data); in JSNApiSynchronizVMInfoFuzzTest()
|