/arkcompiler/runtime_core/libpandabase/tests/ |
D | ring_buffer_test.cpp | 25 constexpr RingBuffer<int, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 27 ASSERT_EQ(buffer.size(), 0U); in TEST() 28 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 29 ASSERT_EQ(buffer.begin(), buffer.end()); in TEST() 30 ASSERT_EQ(buffer.cbegin(), buffer.cend()); in TEST() 31 ASSERT_TRUE(buffer.empty()); in TEST() 32 ASSERT_EQ(buffer.capacity(), DEFAULT_BUFFER_SIZE); in TEST() 33 ASSERT_FALSE(buffer.full()); in TEST() 38 RingBuffer<size_t, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 41 buffer.push_back(i); in TEST() [all …]
|
D | serializer_test.cpp | 25 buffer.resize(0); in SetUp() 27 std::vector<uint8_t> buffer; member in panda::SerializatorTest 31 void SerializerTypeToBuffer(const T &type, /* out */ std::vector<uint8_t> &buffer, size_t ret_val) in SerializerTypeToBuffer() argument 33 auto ret = serializer::TypeToBuffer(type, buffer); in SerializerTypeToBuffer() 39 void SerializerBufferToType(const std::vector<uint8_t> &buffer, /* out */ T &type, size_t ret_val) in SerializerBufferToType() argument 41 auto ret = serializer::BufferToType(buffer.data(), buffer.size(), type); in SerializerBufferToType() 52 std::vector<uint8_t> buffer; in DoTest() local 53 SerializerTypeToBuffer(a, buffer, ret_val); in DoTest() 54 buffer.resize(IMM_FOUR * buffer.size()); in DoTest() 55 SerializerBufferToType(buffer, b, ret_val); in DoTest() [all …]
|
/arkcompiler/runtime_core/libpandabase/tests/ringbuf/ |
D | lock_free_ring_buffer_test.cpp | 33 LockFreeBuffer<size_t, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 34 ASSERT_TRUE(buffer.IsEmpty()); in TEST() 36 buffer.Push(123); in TEST() 37 ASSERT_FALSE(buffer.IsEmpty()); in TEST() 38 buffer.Pop(); in TEST() 39 ASSERT_TRUE(buffer.IsEmpty()); in TEST() 44 LockFreeBuffer<size_t, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 46 buffer.Push(i); in TEST() 49 ASSERT_FALSE(buffer.TryPush(666)); in TEST() 50 buffer.Pop(); in TEST() [all …]
|
/arkcompiler/runtime_core/assembler/ |
D | lexer.cpp | 170 LOG(DEBUG, ASSEMBLER) << std::string_view(&*(curr_line_->buffer.begin() + curr_line_->pos), in TokenizeString() 199 if (FindDelim(curr_line_->buffer[beg]) != Token::Type::ID_BAD) { /* delimiter */ in LexGetType() 200 return FindDelim(curr_line_->buffer[beg]); in LexGetType() 203 std::string_view p(&*(curr_line_->buffer.begin() + beg), end - beg); in LexGetType() 217 if (IsQuote(curr_line_->buffer[beg])) { in LexGetType() 228 char quote = curr_line_->buffer[curr_line_->pos]; in LexString() 233 char c = curr_line_->buffer[curr_line_->pos]; in LexString() 249 if (curr_line_->buffer[curr_line_->pos] != quote) { in LexString() 252 curr_line_->buffer); in LexString() 282 << std::string_view(&*(curr_line_->buffer.begin() + curr_line_->pos), in LexTokens() [all …]
|
/arkcompiler/ets_runtime/ecmascript/base/ |
D | bit_helper.h | 33 inline T ReadBuffer(void **buffer, size_t offset) in ReadBuffer() argument 35 T result = *(reinterpret_cast<T *>(*buffer)); in ReadBuffer() 36 *buffer = reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(*buffer) + offset); in ReadBuffer() 41 inline T ReadBuffer(void **buffer) in ReadBuffer() argument 43 T result = *(reinterpret_cast<T *>(*buffer)); in ReadBuffer() 44 *buffer = reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(*buffer) + result.offset_); in ReadBuffer() 48 inline char *ReadBuffer(void **buffer) in ReadBuffer() argument 50 auto result = reinterpret_cast<char *>(*buffer); in ReadBuffer() 51 *buffer = reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(*buffer) + strlen(result) + 1); in ReadBuffer() 56 inline T *ReadBufferInSize(void **buffer) in ReadBufferInSize() argument [all …]
|
D | atomic_helper.cpp | 27 JSTaggedValue buffer = TypedArrayHelper::ValidateTypedArray(thread, typedArray); in ValidateIntegerTypedArray() local 30 JSHandle<JSTaggedValue> bufferHandle(thread, buffer); in ValidateIntegerTypedArray() 100 JSHandle<JSTaggedValue> buffer(thread, bufferValue); in AtomicStore() local 116 if (BuiltinsArrayBuffer::IsDetachedBuffer(buffer.GetTaggedValue())) { in AtomicStore() 120 …BuiltinsArrayBuffer::SetValueInBuffer(thread, buffer.GetTaggedValue(), indexedPosition, type, buff… in AtomicStore() 128 JSHandle<JSTaggedValue> buffer(thread, bufferValue); in AtomicLoad() local 132 if (BuiltinsArrayBuffer::IsDetachedBuffer(buffer.GetTaggedValue())) { in AtomicLoad() 139 return BuiltinsArrayBuffer::GetValueFromBuffer(thread, buffer.GetTaggedValue(), in AtomicLoad()
|
/arkcompiler/runtime_core/platforms/unix/libpandabase/ |
D | native_stack.cpp | 30 std::vector<char> buffer(BUFF_SIZE); in ReadOsFile() local 31 auto res = cmdfile.Read(&buffer[0], buffer.size()); in ReadOsFile() 33 result->append(&buffer[0], res.Value()); in ReadOsFile() 39 bool WriterOsFile(const void *buffer, size_t count, int fd) in WriterOsFile() argument 43 return myfile.WriteAll(buffer, count); in WriterOsFile()
|
D | file.h | 148 std::array<char, BUFFER_SIZE> buffer = {0}; in GetExecutablePath() local 151 if (_NSGetExecutablePath(buffer.data(), &size) != 0) { in GetExecutablePath() 155 ssize_t len = readlink("/proc/self/exe", buffer.data(), buffer.size() - 1); in GetExecutablePath() 161 std::string::size_type pos = std::string(buffer.data()).find_last_of(File::GetPathDelim()); in GetExecutablePath() 163 … return (pos != std::string::npos) ? std::string(buffer.data()).substr(0, pos) : std::string(""); in GetExecutablePath() 168 std::array<char, PATH_MAX> buffer = {0}; in GetAbsolutePath() local 169 auto fp = realpath(relative_path.data(), buffer.data()); in GetAbsolutePath()
|
/arkcompiler/ets_runtime/ecmascript/compiler/ |
D | typed_array_stub_builder.h | 34 GateRef GetValueFromBuffer(GateRef buffer, GateRef index, GateRef offset, GateRef jsType); 35 GateRef IsDetachedBuffer(GateRef buffer); 55 GateRef GetArrayBufferData(GateRef buffer) in GetArrayBufferData() argument 58 return Load(VariableType::JS_ANY(), buffer, offset); in GetArrayBufferData() 61 GateRef GetArrayBufferByteLength(GateRef buffer) in GetArrayBufferByteLength() argument 64 return Load(VariableType::INT32(), buffer, offset); in GetArrayBufferByteLength() 67 GateRef GetExternalPointer(GateRef buffer) in GetExternalPointer() argument 70 return Load(VariableType::JS_ANY(), buffer, offset); in GetExternalPointer()
|
D | typed_array_stub_builder.cpp | 22 GateRef TypedArrayStubBuilder::IsDetachedBuffer(GateRef buffer) in IsDetachedBuffer() argument 32 Branch(IsByteArray(buffer), &isByteArray, ¬ByteArray); in IsDetachedBuffer() 39 GateRef dataSlot = GetArrayBufferData(buffer); in IsDetachedBuffer() 93 GateRef buffer = GetViewedArrayBuffer(array); in FastGetPropertyByIndex() local 94 Branch(IsDetachedBuffer(buffer), &isDetached, ¬Detached); in FastGetPropertyByIndex() 106 result = GetValueFromBuffer(buffer, index, offset, jsType); in FastGetPropertyByIndex() 137 GateRef buffer = GetViewedArrayBuffer(typedArray); in FastCopyElementToArray() local 138 Branch(IsDetachedBuffer(buffer), &isDetached, ¬Detached); in FastCopyElementToArray() 157 GateRef value = GetValueFromBuffer(buffer, *start, offset, jsType); in FastCopyElementToArray() 177 GateRef TypedArrayStubBuilder::GetValueFromBuffer(GateRef buffer, GateRef index, GateRef offset, Ga… in GetValueFromBuffer() argument [all …]
|
/arkcompiler/ets_runtime/test/aottest/typedarray_load_store/ |
D | typedarray_load_store.ts | 22 let buffer = new ArrayBuffer(120); variable 60 let arr1 = new Int32Array(buffer, 20, 4); 65 let arr2 = new Int32Array(buffer, 28, 5); 70 let arr3 = new Int32Array(buffer, 0, 5); 107 let arr1 = new Float64Array(buffer, 16, 4); 112 let arr2 = new Float64Array(buffer, 24, 5); 117 let arr3 = new Float64Array(buffer, 0, 5);
|
/arkcompiler/ets_runtime/ecmascript/platform/unix/ohos/ |
D | backtrace.cpp | 58 void *buffer[MAX_STACK_SIZE] = { nullptr }; in Backtrace() local 59 int level = unwBackTrace(reinterpret_cast<void**>(&buffer), MAX_STACK_SIZE); in Backtrace() 63 auto iter = stackInfoCache.find(buffer[i]); in Backtrace() 67 if (!dladdr(buffer[i], &info)) { in Backtrace() 71 stackInfoCache.emplace(buffer[i], info); in Backtrace() 75 uint64_t offset = info.dli_fbase ? ToUintPtr(buffer[i]) - ToUintPtr(info.dli_fbase) : 0; in Backtrace()
|
/arkcompiler/runtime_core/libpandabase/serializer/ |
D | serializer.h | 45 inline auto TypeToBuffer(const T &value, /* out */ std::vector<uint8_t> &buffer) 49 std::copy(ptr, ToUint8tPtr(ToUintPtr(ptr) + sizeof(value)), std::back_inserter(buffer)); 55 inline auto TypeToBuffer(const VecT &vec, /* out */ std::vector<uint8_t> &buffer) 62 auto ret = TypeToBuffer(size, buffer); 70 std::copy(ptr, ptr_end, std::back_inserter(buffer)); 76 inline auto TypeToBuffer(const UnMap &map, /* out */ std::vector<uint8_t> &buffer) 80 auto ret = TypeToBuffer(static_cast<uint32_t>(map.size()), buffer); 92 auto k = TypeToBuffer(it.first, buffer); 99 auto v = TypeToBuffer(it.second, buffer); 217 explicit Serializer(std::vector<uint8_t> &buffer) : buffer_(buffer) {} in Serializer() argument [all …]
|
/arkcompiler/ets_runtime/ecmascript/jspandafile/ |
D | js_pandafile_executor.h | 31 …static Expected<JSTaggedValue, bool> ExecuteFromBuffer(JSThread *thread, const void *buffer, size_… 34 …static Expected<JSTaggedValue, bool> ExecuteModuleBuffer(JSThread *thread, const void *buffer, siz… 37 … const CString &entry, const void *buffer, size_t size); 42 …static Expected<JSTaggedValue, bool> ExecuteFromBufferSecure(JSThread *thread, uint8_t *buffer, si… 45 …cted<JSTaggedValue, bool> ExecuteModuleBufferSecure(JSThread *thread, uint8_t *buffer, size_t size,
|
D | js_pandafile_executor.cpp | 114 …const void *buffer, size_t size, std::string_view entryPoint, const CString &filename, bool needUp… in ExecuteFromBuffer() argument 119 …JSPandaFileManager::GetInstance()->LoadJSPandaFile(thread, normalName, entryPoint, buffer, size, n… in ExecuteFromBuffer() 137 return CommonExecuteBuffer(thread, isBundle, normalName, entry, buffer, size); in ExecuteFromBuffer() 144 JSThread *thread, const void *buffer, size_t size, const CString &filename, bool needUpdate) in ExecuteModuleBuffer() argument 162 … JSPandaFileManager::GetInstance()->LoadJSPandaFile(thread, name, entry, buffer, size, needUpdate); in ExecuteModuleBuffer() 189 return CommonExecuteBuffer(thread, isBundle, name, entry, buffer, size); in ExecuteModuleBuffer() 194 bool isBundle, const CString &filename, const CString &entry, const void *buffer, size_t size) in CommonExecuteBuffer() argument 201 moduleRecord.Update(moduleManager->HostResolveImportedModule(buffer, size, filename)); in CommonExecuteBuffer() 214 SourceTextModule::Evaluate(thread, module, buffer, size); in CommonExecuteBuffer() 247 …STaggedValue, bool> JSPandaFileExecutor::ExecuteFromBufferSecure(JSThread *thread, uint8_t *buffer, in ExecuteFromBufferSecure() argument [all …]
|
/arkcompiler/ets_runtime/ecmascript/platform/unix/linux/ |
D | backtrace.cpp | 29 void *buffer[MAX_STACK_SIZE]; in Backtrace() local 31 int framesLen = backtrace(buffer, MAX_STACK_SIZE); in Backtrace() 32 stackList = backtrace_symbols(buffer, framesLen); in Backtrace()
|
/arkcompiler/runtime_core/compiler/tests/ |
D | encoders_test.cpp | 74 auto buffer = GetEncoder()->GetMasm()->GetBuffer(); in TestPcRelativeLoad() local 75 … T *data = reinterpret_cast<T *>(buffer->template GetOffsetAddress<uint8_t *>(data_size) + offset); in TestPcRelativeLoad() 91 buffer->Rewind(data_size); in TestPcRelativeLoad() 101 auto start_addr = buffer->GetOffsetAddress<const char *>(data_size); in TestPcRelativeLoad() 102 exec_module_->SetInstructions(start_addr, buffer->GetEndAddress<const char *>()); in TestPcRelativeLoad() 113 … for (uint32_t i = data_size; i < buffer->GetCursorOffset() && inst != insts.end(); ++inst) { in TestPcRelativeLoad() 198 auto buffer = masm->GetBuffer(); in TEST_F() local 203 buffer->Emit32(GetBadValue<uint32_t>()); in TEST_F() 207 buffer->Emit32(0); in TEST_F() 210 buffer->Emit32(GetBadValue<uint32_t>()); in TEST_F()
|
/arkcompiler/ets_runtime/ecmascript/mem/ |
D | tlab_allocator-inl.h | 110 uintptr_t buffer = heap_->AllocateYoungSync(MIN_BUFFER_SIZE); in ExpandYoung() local 111 if (buffer == 0) { in ExpandYoung() 117 uintptr_t end = buffer + MIN_BUFFER_SIZE; in ExpandYoung() 119 if (buffer == youngAllocator_.GetEnd()) { in ExpandYoung() 120 buffer = youngAllocator_.GetTop(); in ExpandYoung() 126 youngAllocator_.Reset(buffer, end); in ExpandYoung()
|
/arkcompiler/ets_runtime/test/moduletest/typedarraynan/ |
D | typedarraynan.js | 43 var buffer = new ArrayBuffer(8); variable 44 var array1 = new Int32Array(buffer); 47 var array2 = new Float64Array(buffer);
|
/arkcompiler/ets_runtime/ecmascript/platform/windows/ |
D | file.cpp | 55 char buffer[PATH_MAX] = { '\0' }; in RealPath() local 56 if (!_fullpath(buffer, path.c_str(), sizeof(buffer) - 1)) { in RealPath() 60 realPath = std::string(buffer); in RealPath() 64 void DPrintf(fd_t fd, const std::string &buffer) in DPrintf() argument 66 LOG_ECMA(DEBUG) << "Unsupport dprintf fd(" << fd << ") in windows, buffer:" << buffer; in DPrintf()
|
/arkcompiler/ets_runtime/test/moduletest/dataview/ |
D | dataview.js | 22 const buffer = new ArrayBuffer(16); constant 23 const view = new DataView(buffer);
|
/arkcompiler/ets_runtime/ecmascript/pgo_profiler/ |
D | pgo_profiler_info.cpp | 46 bool PGOProfilerHeader::BuildFromLegacy(void *buffer, PGOProfilerHeader **header) in BuildFromLegacy() argument 48 auto *inHeader = reinterpret_cast<PGOProfilerHeaderLegacy *>(buffer); in BuildFromLegacy() 67 bool PGOProfilerHeader::BuildFromElastic(void *buffer, size_t bufferSize, PGOProfilerHeader **heade… in BuildFromElastic() argument 69 auto *inHeader = reinterpret_cast<PGOProfilerHeader *>(buffer); in BuildFromElastic() 70 if (!inHeader->Verify(buffer, bufferSize)) { in BuildFromElastic() 85 bool PGOProfilerHeader::ParseFromBinary(void *buffer, size_t bufferSize, PGOProfilerHeader **header) in ParseFromBinary() argument 87 auto *inHeaderBase = reinterpret_cast<FileHeaderBase *>(buffer); in ParseFromBinary() 90 return BuildFromLegacy(buffer, header); in ParseFromBinary() 92 return BuildFromElastic(buffer, bufferSize, header); in ParseFromBinary() 110 bool PGOProfilerHeader::VerifyConsistency(void *buffer, size_t bufferSize) const in VerifyConsistency() argument [all …]
|
/arkcompiler/ets_runtime/ecmascript/platform/unix/ |
D | file.cpp | 42 char buffer[PATH_MAX] = { '\0' }; in RealPath() local 43 if (!realpath(path.c_str(), buffer)) { in RealPath() 52 realPath = std::string(buffer); in RealPath() 56 void DPrintf(fd_t fd, const std::string &buffer) in DPrintf() argument 58 int ret = dprintf(fd, "%s", buffer.c_str()); in DPrintf()
|
/arkcompiler/ets_runtime/ecmascript/base/tests/ |
D | atomic_helper_test.cpp | 61 JSHandle<JSArrayBuffer> buffer = factory->NewJSArrayBuffer(bufferSize); in HWTEST_F_L0() local 62 JSHandle<JSTaggedValue> bufferVal = JSHandle<JSTaggedValue>::Cast(buffer); in HWTEST_F_L0() 66 EXPECT_EQ(resultBuffer.GetTaggedValue(), buffer.GetTaggedValue()); in HWTEST_F_L0() 81 JSHandle<JSArrayBuffer> buffer = factory->NewJSArrayBuffer(bufferSize); in HWTEST_F_L0() local 82 JSHandle<JSTaggedValue> bufferVal = JSHandle<JSTaggedValue>::Cast(buffer); in HWTEST_F_L0() 111 JSHandle<JSArrayBuffer> buffer = factory->NewJSArrayBuffer(bufferSize); in HWTEST_F_L0() local 112 JSHandle<JSTaggedValue> bufferVal = JSHandle<JSTaggedValue>::Cast(buffer); in HWTEST_F_L0()
|
/arkcompiler/ets_runtime/ecmascript/regexp/ |
D | regexp_executor.cpp | 29 DynChunk buffer(buf, chunk_); in Execute() local 32 uint32_t size = buffer.GetU32(0); in Execute() 33 nCapture_ = buffer.GetU32(RegExpParser::NUM_CAPTURE__OFFSET); in Execute() 34 nStack_ = buffer.GetU32(RegExpParser::NUM_STACK_OFFSET); in Execute() 35 flags_ = buffer.GetU32(RegExpParser::FLAGS_OFFSET); in Execute() 65 return ExecuteInternal(buffer, size); in Execute() 277 CVector<uint8_t> buffer(len + 1); in GetResult() local 278 uint8_t *dest = buffer.data(); in GetResult() 286 factory->NewFromUtf8(reinterpret_cast<const uint8_t *>(buffer.data()), len); in GetResult()
|