/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/static_core/libpandabase/tests/ |
D | ring_buffer_test.cpp | 38 RingBuffer<size_t, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 41 buffer.push_back(i); in TEST() 42 ASSERT_EQ(buffer.size(), i + 1U); in TEST() 43 ASSERT_EQ(buffer.front(), 0U); in TEST() 44 ASSERT_EQ(buffer.back(), i); in TEST() 47 ASSERT_EQ(buffer.size(), DEFAULT_BUFFER_SIZE); in TEST() 48 ASSERT_NE(buffer.begin(), buffer.end()); in TEST() 49 ASSERT_FALSE(buffer.empty()); in TEST() 50 ASSERT_TRUE(buffer.full()); in TEST() 53 for (const auto &element : buffer) { in TEST() [all …]
|
/arkcompiler/runtime_core/static_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() 37 buffer.Push(123); in TEST() 38 ASSERT_FALSE(buffer.IsEmpty()); in TEST() 39 buffer.Pop(); in TEST() 40 ASSERT_TRUE(buffer.IsEmpty()); in TEST() 45 LockFreeBuffer<size_t, DEFAULT_BUFFER_SIZE> buffer; in TEST() local 47 buffer.Push(i); in TEST() 50 ASSERT_FALSE(buffer.TryPush(666)); in TEST() 51 buffer.Pop(); in TEST() [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/static_core/libpandabase/utils/ |
D | small_vector.h | 214 buffer.size = 0; in SmallVector() 222 buffer.size = 0; in SmallVector() 235 buffer.size = 0; in SmallVector() 242 buffer.size = other.buffer.size; in SmallVector() 244 for (uint32_t i = 0; i < buffer.size; ++i) { in SmallVector() 246 new (&buffer.data[i]) T(other.buffer.data[i]); in SmallVector() 258 buffer.size = other.buffer.size; in SmallVector() 260 for (uint32_t i = 0; i < buffer.size; ++i) { in SmallVector() 262 new (&buffer.data[i]) T(std::move(other.buffer.data[i])); in SmallVector() 287 buffer.size = other.buffer.size; [all …]
|
/arkcompiler/runtime_core/verifier/tests/ |
D | verify_constant_pool_tests.cpp | 69 std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(base_file), {}); 74 for (size_t i = buffer.size() - 1; i >= 0; --i) { 75 if (buffer[i] == method_id[0] && buffer[i + 1] == method_id[1]) { 76 buffer[i] = static_cast<unsigned char>(new_method_id[0]); 77 buffer[i + 1] = static_cast<unsigned char>(new_method_id[1]); 83 GenerateModifiedAbc(buffer, target_file_name); 110 std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(base_file), {}); 115 for (size_t i = 0; i < buffer.size(); ++i) { 116 if (buffer[i] == literal_id[0] && buffer[i + 1] == literal_id[1]) { 117 buffer[i] = static_cast<unsigned char>(new_literal_id[0]); [all …]
|
D | utils.cpp | 23 void GenerateModifiedAbc(const std::vector<unsigned char> &buffer, const std::string &filename) in GenerateModifiedAbc() argument 31 abc_file.write(reinterpret_cast<const char *>(buffer.data()), buffer.size()); in GenerateModifiedAbc() 44 …difyBuffer(std::unordered_map<uint32_t, uint32_t> &literal_map, std::vector<unsigned char> &buffer) in ModifyBuffer() argument 50 for (size_t i = literal_id; i < buffer.size(); ++i) { in ModifyBuffer() 51 if (buffer[i] == inner_id[0] && buffer[i+1] == inner_id[1]) { in ModifyBuffer() 54 buffer[i] = buffer[i + 1]; in ModifyBuffer() 55 buffer[i + 1] = buffer[i + 2]; in ModifyBuffer()
|
D | verify_checksum_test.cpp | 65 std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(base_file), {}); 70 buffer[8] = new_checksum[0]; 71 buffer[9] = new_checksum[1]; 72 buffer[10] = new_checksum[2]; 73 buffer[11] = new_checksum[3]; 76 GenerateModifiedAbc(buffer, target_file_name); 101 std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(base_file), {}); 106 buffer[12] = new_content[0]; 107 buffer[13] = new_content[1]; 110 GenerateModifiedAbc(buffer, target_file_name);
|
D | verify_register_index_test.cpp | 76 std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(base_file), {}); 80 for (size_t i = 0; i < buffer.size() - 2; i++) { 81 if (buffer[i] == op_code[0] && buffer[i+1] == op_code[1]) { 82 buffer[i + 1] = static_cast<unsigned char>(new_reg_id); 87 GenerateModifiedAbc(buffer, tar_file_name);
|
/arkcompiler/runtime_core/static_core/assembler/ |
D | lexer.cpp | 167 LOG(DEBUG, ASSEMBLER) << std::string_view(&*(currLine_->buffer.begin() + currLine_->pos), in TokenizeString() 195 if (FindDelim(currLine_->buffer[beg]) != Token::Type::ID_BAD) { /* delimiter */ in LexGetType() 196 return FindDelim(currLine_->buffer[beg]); in LexGetType() 199 std::string_view p(&*(currLine_->buffer.begin() + beg), end - beg); in LexGetType() 211 if (IsQuote(currLine_->buffer[beg])) { in LexGetType() 222 char quote = currLine_->buffer[currLine_->pos]; in LexString() 227 char c = currLine_->buffer[currLine_->pos]; in LexString() 243 if (currLine_->buffer[currLine_->pos] != quote) { in LexString() 246 currLine_->buffer); in LexString() 257 if (FindDelim(currLine_->buffer[currLine_->pos]) != Token::Type::ID_BAD) { in UpdateCurLinePos() [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 …]
|
/arkcompiler/toolchain/websocket/ |
D | handshake_helper.cpp | 23 std::string buffer(key.size() + WEB_SOCKET_GUID.size(), 0); in EncodeKey() local 24 key.copy(buffer.data(), key.size()); in EncodeKey() 25 WEB_SOCKET_GUID.copy(buffer.data() + key.size(), WEB_SOCKET_GUID.size()); in EncodeKey() 27 return EncodeKey(reinterpret_cast<unsigned char *>(buffer.data()), buffer.size(), destination); in EncodeKey() 35 unsigned char buffer[bufferSize]; in EncodeKey() local 36 auto *guid = std::copy(key, key + KEY_LENGTH, buffer); in EncodeKey() 39 return EncodeKey(buffer, bufferSize, destination); in EncodeKey()
|
/arkcompiler/ets_runtime/test/fuzztest/stringrefwriteutf16_fuzzer/ |
D | stringrefwriteutf16_fuzzer.cpp | 36 char16_t* buffer = new char16_t[length]; in StringRefWriteUtf16FuzzTest() local 37 if (memset_s(buffer, length, 0, length) != EOK) { in StringRefWriteUtf16FuzzTest() 43 buffer[0] = '\0'; in StringRefWriteUtf16FuzzTest() 45 int count = res->WriteUtf16(buffer, length - 1); in StringRefWriteUtf16FuzzTest() 46 buffer[count] = '\0'; in StringRefWriteUtf16FuzzTest() 48 delete[] buffer; in StringRefWriteUtf16FuzzTest() 49 buffer = nullptr; in StringRefWriteUtf16FuzzTest()
|
/arkcompiler/ets_runtime/ecmascript/pgo_profiler/ap_file/ |
D | pgo_file_info.cpp | 23 bool PGOProfilerHeader::BuildFromLegacy(void *buffer, PGOProfilerHeader **header) in BuildFromLegacy() argument 25 auto *inHeader = reinterpret_cast<PGOProfilerHeaderLegacy *>(buffer); in BuildFromLegacy() 44 bool PGOProfilerHeader::BuildFromElastic(void *buffer, size_t bufferSize, PGOProfilerHeader **heade… in BuildFromElastic() argument 46 auto *inHeader = reinterpret_cast<PGOProfilerHeader *>(buffer); in BuildFromElastic() 47 if (!inHeader->Verify(buffer, bufferSize)) { in BuildFromElastic() 62 bool PGOProfilerHeader::ParseFromBinary(void *buffer, size_t bufferSize, PGOProfilerHeader **header) in ParseFromBinary() argument 64 auto *inHeaderBase = reinterpret_cast<FileHeaderBase *>(buffer); in ParseFromBinary() 67 return BuildFromLegacy(buffer, header); in ParseFromBinary() 69 return BuildFromElastic(buffer, bufferSize, header); in ParseFromBinary() 87 bool PGOProfilerHeader::VerifyConsistency(void *buffer, size_t bufferSize) const in VerifyConsistency() argument [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/templates/stdlib/ |
D | DataView.ets.j2 | 19 /** Underlying buffer */ 20 public readonly buffer: Buffer 23 /** Offset from start of {@link buffer} */ 28 * @param buffer underlying buffer 30 public constructor(buffer: Buffer) { 31 this(buffer, 0) 36 * @param buffer underlying buffer 40 public constructor(buffer: Buffer, byteOffset: int) { 41 this(buffer, byteOffset, buffer.getByteLength() - byteOffset) 46 * @param buffer underlying buffer [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
D | Atomics.ets | 39 private static requireSharedMemory(buffer: Buffer): SharedMemory { 40 if (buffer instanceof ArrayBuffer) { 43 let mem = (buffer as SharedArrayBuffer).getSharedMemory() 62 let buffer = typedArray.buffer 63 if (buffer instanceof ArrayBuffer) { 69 let mem = (buffer as SharedArrayBuffer).getSharedMemory() 76 let buffer = typedArray.buffer 77 if (buffer instanceof ArrayBuffer) { 83 let mem = (buffer as SharedArrayBuffer).getSharedMemory() 90 let buffer = typedArray.buffer [all …]
|
/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()
|
/arkcompiler/ets_runtime/test/perform/dataview/ |
D | dataview.ts | 22 var buffer = new ArrayBuffer(8); 23 var dataview = new DataView(buffer); 36 var buffer = new ArrayBuffer(8); 37 var dataview = new DataView(buffer); 48 var buffer = new ArrayBuffer(8); 49 var dataview = new DataView(buffer);
|
/arkcompiler/runtime_core/static_core/dprof/libstorage/dprof/ |
D | storage.cpp | 43 std::unique_ptr<AppData> AppData::CreateByBuffer(const std::vector<uint8_t> &buffer) in CreateByBuffer() argument 47 const uint8_t *data = buffer.data(); in CreateByBuffer() 48 size_t size = buffer.size(); in CreateByBuffer() 73 bool AppData::ToBuffer(std::vector<uint8_t> &buffer) const in ToBuffer() 76 if (!serializer::StructToBuffer<3>(commonInfo_, buffer)) { in ToBuffer() 80 auto ret = serializer::TypeToBuffer(featuresMap_, buffer); in ToBuffer() 121 std::vector<uint8_t> buffer; in SaveAppData() local 122 if (!appData.ToBuffer(buffer)) { in SaveAppData() 134 file.write(reinterpret_cast<const char *>(buffer.data()), buffer.size()); in SaveAppData() 194 std::vector<uint8_t> buffer; in ForEachApps() local [all …]
|
/arkcompiler/runtime_core/static_core/runtime/profilesaver/ |
D | profile_dump_info.cpp | 45 static bool WriteBuffer(int fd, const uint8_t *buffer, size_t byteCount) in WriteBuffer() argument 48 int bytesWritten = write(fd, buffer, byteCount); // real place to write in WriteBuffer() 54 buffer += bytesWritten; in WriteBuffer() 59 static void AddStringToBuffer(PandaVector<uint8_t> *buffer, const PandaString &value) in AddStringToBuffer() argument 61 buffer->insert(buffer->end(), value.begin(), value.end()); in AddStringToBuffer() 65 static void AddUintToBuffer(PandaVector<uint8_t> *buffer, T value) in AddUintToBuffer() argument 68 buffer->push_back((value >> (i * K_BITS_PER_BYTE)) & 0xff); // NOLINT in AddUintToBuffer() 83 uint8_t buffer[1]; in TestEof() local 84 return read(fd, buffer, 1); in TestEof() 98 uint8_t *buffer = ptrCurrent_; in FillFromFd() local [all …]
|
/arkcompiler/ets_runtime/ecmascript/compiler/ |
D | typed_array_stub_builder.h | 37 GateRef GetValueFromBuffer(GateRef buffer, GateRef index, GateRef offset, GateRef jsType); 38 GateRef IsDetachedBuffer(GateRef buffer); 60 GateRef GetArrayBufferData(GateRef buffer) in GetArrayBufferData() argument 63 return Load(VariableType::JS_ANY(), buffer, offset); in GetArrayBufferData() 66 GateRef GetArrayBufferByteLength(GateRef buffer) in GetArrayBufferByteLength() argument 69 return Load(VariableType::INT32(), buffer, offset); in GetArrayBufferByteLength() 72 GateRef GetExternalPointer(GateRef buffer) in GetExternalPointer() argument 75 return Load(VariableType::JS_ANY(), buffer, offset); in GetExternalPointer()
|
/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/runtime_core/static_core/plugins/ets/stdlib/std/core/ |
D | StringBuilder.ets | 30 * Construct a new builder instance with the initial buffer of 16 chars 73 * Appends an object representation as string to the builder's internal buffer 77 * @returns builder with updated internal buffer 85 * Appends a string to the builder's internal buffer 89 * @returns builder with updated internal buffer 94 * Appends a boolean as string to the builder's internal buffer 98 * @returns builder with updated internal buffer 103 * Appends a byte as string to the builder's internal buffer 107 * @returns builder with updated internal buffer 112 * Appends a short as string to the builder's internal buffer [all …]
|