Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 72) sorted by relevance

123

/art/test/712-varhandle-invocations/src/
DVarHandleUnitTestHelpers.java88 public static boolean getBytesAs_boolean(ByteBuffer buffer, int index, ByteOrder order) { in getBytesAs_boolean() argument
89 return buffer.order(order).get(index) != 0; in getBytesAs_boolean()
92 public static byte getBytesAs_byte(ByteBuffer buffer, int index, ByteOrder order) { in getBytesAs_byte() argument
93 return buffer.order(order).get(index); in getBytesAs_byte()
96 public static char getBytesAs_char(ByteBuffer buffer, int index, ByteOrder order) { in getBytesAs_char() argument
97 return buffer.order(order).getChar(index); in getBytesAs_char()
100 public static short getBytesAs_short(ByteBuffer buffer, int index, ByteOrder order) { in getBytesAs_short() argument
101 return buffer.order(order).getShort(index); in getBytesAs_short()
104 public static int getBytesAs_int(ByteBuffer buffer, int index, ByteOrder order) { in getBytesAs_int() argument
105 return buffer.order(order).getInt(index); in getBytesAs_int()
[all …]
DVarHandleBadCoordinateTests.java580 for (ByteBuffer buffer : buffers) { in doTest()
582 vh.get(buffer, -1); in doTest()
587 vh.get(buffer, buffer.limit()); in doTest()
592 vh.get(buffer, Integer.MAX_VALUE - 1); in doTest()
597 vh.get(buffer, buffer.limit() - Integer.SIZE / 8 + 1); in doTest()
601 vh.get(buffer, buffer.limit() - Integer.SIZE / 8); in doTest()
630 for (ByteBuffer buffer : buffers) { in doTest()
631 int alignedIndex = VarHandleUnitTestHelpers.alignedOffset_int(buffer, 0); in doTest()
635 vh.set(buffer, i, 380); in doTest()
636 vh.get(buffer, i); in doTest()
[all …]
/art/libprofile/profile/
Dprofile_helpers.h29 inline bool WriteBuffer(int fd, const uint8_t* buffer, size_t byte_count) { in WriteBuffer() argument
31 int bytes_written = TEMP_FAILURE_RETRY(write(fd, buffer, byte_count)); in WriteBuffer()
36 buffer += bytes_written; // Move the buffer forward. in WriteBuffer()
42 inline void AddStringToBuffer(std::vector<uint8_t>* buffer, const std::string& value) { in AddStringToBuffer() argument
43 buffer->insert(buffer->end(), value.begin(), value.end()); in AddStringToBuffer()
48 inline void AddUintToBuffer(std::vector<uint8_t>* buffer, T value) { in AddUintToBuffer() argument
50 buffer->push_back((value >> (i * kBitsPerByte)) & 0xff); in AddUintToBuffer()
Dprofile_boot_info.cc42 std::vector<uint8_t> buffer; in Save() local
45 AddUintToBuffer(&buffer, static_cast<uint8_t>(dex_file->GetLocation().size())); in Save()
46 AddStringToBuffer(&buffer, dex_file->GetLocation()); in Save()
49 AddUintToBuffer(&buffer, static_cast<uint8_t>(0)); in Save()
53 AddUintToBuffer(&buffer, pair.first); in Save()
54 AddUintToBuffer(&buffer, pair.second); in Save()
56 if (!WriteBuffer(fd, buffer.data(), buffer.size())) { in Save()
Dprofile_compilation_info.cc338 static bool WriteBuffer(int fd, const uint8_t* buffer, size_t byte_count) { in WriteBuffer() argument
340 int bytes_written = TEMP_FAILURE_RETRY(write(fd, buffer, byte_count)); in WriteBuffer()
345 buffer += bytes_written; // Move the buffer forward. in WriteBuffer()
351 static void AddStringToBuffer(std::vector<uint8_t>* buffer, const std::string& value) { in AddStringToBuffer() argument
352 buffer->insert(buffer->end(), value.begin(), value.end()); in AddStringToBuffer()
357 static void AddUintToBuffer(std::vector<uint8_t>* buffer, T value) { in AddUintToBuffer() argument
359 buffer->push_back((value >> (i * kBitsPerByte)) & 0xff); in AddUintToBuffer()
395 std::vector<uint8_t> buffer; in Save() local
404 WriteProfileIndex(&buffer, static_cast<ProfileIndexType>(info_.size())); in Save()
426 AddUintToBuffer(&buffer, required_capacity); in Save()
[all …]
/art/libartbase/base/unix_file/
Dfd_file_test.cc81 uint8_t buffer[16]; in TEST_F() local
82 EXPECT_FALSE(file.ReadFully(&buffer, 4)); in TEST_F()
112 char buffer[sizeof(read_suffix)]; in TEST_F() local
113 EXPECT_TRUE(file.PreadFully(buffer, sizeof(read_suffix), offset)); in TEST_F()
114 EXPECT_STREQ(&read_suffix[0], &buffer[0]); in TEST_F()
216 uint8_t buffer[16] = { 0 }; in TEST_F() local
217 EXPECT_TRUE(file.WriteFully(&buffer, sizeof(buffer))); in TEST_F()
228 std::vector<uint8_t> buffer; in TEST_F() local
231 buffer.push_back(static_cast<uint8_t>(i)); in TEST_F()
241 EXPECT_TRUE(tmp.GetFile()->WriteFully(&buffer[0], length)); in TEST_F()
[all …]
Dfd_file.h100 bool ReadFully(void* buffer, size_t byte_count) WARN_UNUSED;
101 bool PreadFully(void* buffer, size_t byte_count, size_t offset) WARN_UNUSED;
102 bool WriteFully(const void* buffer, size_t byte_count) WARN_UNUSED;
103 bool PwriteFully(const void* buffer, size_t byte_count, size_t offset) WARN_UNUSED;
154 bool WriteFullyGeneric(const void* buffer, size_t byte_count, size_t offset);
Dfd_file.cc421 static bool ReadFullyGeneric(int fd, void* buffer, size_t byte_count, size_t offset) { in ReadFullyGeneric() argument
422 char* ptr = static_cast<char*>(buffer); in ReadFullyGeneric()
437 bool FdFile::ReadFully(void* buffer, size_t byte_count) { in ReadFully() argument
438 return ReadFullyGeneric<ReadIgnoreOffset>(fd_, buffer, byte_count, 0); in ReadFully()
441 bool FdFile::PreadFully(void* buffer, size_t byte_count, size_t offset) { in PreadFully() argument
442 return ReadFullyGeneric<pread>(fd_, buffer, byte_count, offset); in PreadFully()
446 bool FdFile::WriteFullyGeneric(const void* buffer, size_t byte_count, size_t offset) { in WriteFullyGeneric() argument
450 const char* ptr = static_cast<const char*>(buffer); in WriteFullyGeneric()
465 bool FdFile::PwriteFully(const void* buffer, size_t byte_count, size_t offset) { in PwriteFully() argument
466 return WriteFullyGeneric<true>(buffer, byte_count, offset); in PwriteFully()
[all …]
/art/compiler/debug/
Delf_debug_frame_writer.h38 static void WriteCIE(InstructionSet isa, /*inout*/ std::vector<uint8_t>* buffer) { in WriteCIE() argument
65 WriteCIE(is64bit, return_reg, opcodes, buffer); in WriteCIE()
88 WriteCIE(is64bit, return_reg, opcodes, buffer); in WriteCIE()
114 WriteCIE(is64bit, return_reg, opcodes, buffer); in WriteCIE()
140 WriteCIE(is64bit, return_reg, opcodes, buffer); in WriteCIE()
188 std::vector<uint8_t> buffer; // Small temporary buffer. in WriteCFISection() local
189 WriteCIE(builder->GetIsa(), &buffer); in WriteCFISection()
190 cfi_section->WriteFully(buffer.data(), buffer.size()); in WriteCFISection()
191 buffer.clear(); in WriteCFISection()
206 &buffer); in WriteCFISection()
[all …]
Delf_debug_writer.cc122 std::vector<uint8_t> buffer; in MakeMiniDebugInfoInternal() local
123 buffer.reserve(KB); in MakeMiniDebugInfoInternal()
124 VectorOutputStream out("Mini-debug-info ELF file", &buffer); in MakeMiniDebugInfoInternal()
143 compressed_buffer.reserve(buffer.size() / 4); in MakeMiniDebugInfoInternal()
144 XzCompress(ArrayRef<const uint8_t>(buffer), &compressed_buffer); in MakeMiniDebugInfoInternal()
185 std::vector<uint8_t> buffer; in MakeElfFileForJIT() local
186 buffer.reserve(KB); in MakeElfFileForJIT()
187 VectorOutputStream out("Debug ELF file", &buffer); in MakeElfFileForJIT()
209 Reader reader(buffer); in MakeElfFileForJIT()
226 return buffer; in MakeElfFileForJIT()
[all …]
/art/libartbase/base/
Dbit_table_test.cc34 std::vector<uint8_t> buffer; in TEST() local
35 BitMemoryWriter<std::vector<uint8_t>> writer(&buffer); in TEST()
39 BitMemoryReader reader(buffer.data()); in TEST()
51 std::vector<uint8_t> buffer; in TEST() local
52 BitMemoryWriter<std::vector<uint8_t>> writer(&buffer); in TEST()
60 BitMemoryReader reader(buffer.data()); in TEST()
77 std::vector<uint8_t> buffer; in TEST() local
78 BitMemoryWriter<std::vector<uint8_t>> writer(&buffer, start_bit_offset); in TEST()
83 BitMemoryReader reader(buffer.data(), start_bit_offset); in TEST()
97 std::vector<uint8_t> buffer; in TEST() local
[all …]
/art/test/070-nio-buffer/
Dexpected.txt1 Direct byte buffer has array: true
2 Got expected buffer overflow exception
4 Got expected buffer overflow exception
/art/compiler/utils/
Dassembler.h182 explicit EnsureCapacity(AssemblerBuffer* buffer) { in EnsureCapacity() argument
183 if (buffer->cursor() > buffer->limit()) { in EnsureCapacity()
184 buffer->ExtendCapacity(buffer->Size() + kMinimumGap); in EnsureCapacity()
190 buffer_ = buffer; in EnsureCapacity()
196 CHECK(!buffer->HasEnsuredCapacity()); // Cannot nest. in EnsureCapacity()
197 buffer->has_ensured_capacity_ = true; in EnsureCapacity()
223 explicit EnsureCapacity(AssemblerBuffer* buffer) { in EnsureCapacity() argument
224 if (buffer->cursor() > buffer->limit()) { in EnsureCapacity()
225 buffer->ExtendCapacity(buffer->Size() + kMinimumGap); in EnsureCapacity()
296 explicit DebugFrameOpCodeWriterForAssembler(Assembler* buffer) in DebugFrameOpCodeWriterForAssembler() argument
[all …]
/art/compiler/optimizing/
Dliveness_test.cc36 std::ostream& buffer, in DumpBitVector() argument
39 buffer << prefix; in DumpBitVector()
40 buffer << '('; in DumpBitVector()
42 buffer << vector->IsBitSet(i); in DumpBitVector()
44 buffer << ")\n"; in DumpBitVector()
57 std::ostringstream buffer; in TestCode() local
59 buffer << "Block " << block->GetBlockId() << std::endl; in TestCode()
62 DumpBitVector(live_in, buffer, ssa_values, " live in: "); in TestCode()
64 DumpBitVector(live_out, buffer, ssa_values, " live out: "); in TestCode()
66 DumpBitVector(kill, buffer, ssa_values, " kill: "); in TestCode()
[all …]
/art/test/2036-jni-filechannel/src/
DMain.java28 MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, 0); in main() local
29 checkBufferCapacity(buffer, 0); in main()
32 static native void checkBufferCapacity(Buffer buffer, int expectedCapacity); in checkBufferCapacity() argument
/art/dexlayout/
Ddex_writer.cc35 static size_t EncodeIntValue(int32_t value, uint8_t* buffer) { in EncodeIntValue() argument
39 buffer[length++] = static_cast<uint8_t>(value); in EncodeIntValue()
44 buffer[length++] = static_cast<uint8_t>(value); in EncodeIntValue()
48 buffer[length++] = static_cast<uint8_t>(value); in EncodeIntValue()
52 static size_t EncodeUIntValue(uint32_t value, uint8_t* buffer) { in EncodeUIntValue() argument
55 buffer[length++] = static_cast<uint8_t>(value); in EncodeUIntValue()
61 static size_t EncodeLongValue(int64_t value, uint8_t* buffer) { in EncodeLongValue() argument
65 buffer[length++] = static_cast<uint8_t>(value); in EncodeLongValue()
70 buffer[length++] = static_cast<uint8_t>(value); in EncodeLongValue()
74 buffer[length++] = static_cast<uint8_t>(value); in EncodeLongValue()
[all …]
/art/tools/ahat/src/main/com/android/ahat/heapdump/
DAhatClassInstance.java242 public final byte[] buffer; field in AhatClassInstance.BitmapInfo
244 public BitmapInfo(int width, int height, byte[] buffer) { in BitmapInfo() argument
247 this.buffer = buffer; in BitmapInfo()
270 byte[] buffer = getByteArrayField("mBuffer"); in getBitmapInfo()
271 if (buffer == null) { in getBitmapInfo()
275 if (buffer.length < 4 * height * width) { in getBitmapInfo()
279 return new BitmapInfo(width, height, buffer); in getBitmapInfo()
294 (((int) info.buffer[i * 4 + 3] & 0xFF) << 24) in asBitmap()
295 + (((int) info.buffer[i * 4 + 0] & 0xFF) << 16) in asBitmap()
296 + (((int) info.buffer[i * 4 + 1] & 0xFF) << 8) in asBitmap()
[all …]
/art/libelffile/stream/
Dbuffered_output_stream.cc32 bool BufferedOutputStream::WriteFully(const void* buffer, size_t byte_count) { in WriteFully() argument
37 return out_->WriteFully(buffer, byte_count); in WriteFully()
44 const uint8_t* src = reinterpret_cast<const uint8_t*>(buffer); in WriteFully()
Dvector_output_stream.h34 bool WriteFully(const void* buffer, size_t byte_count) override { in WriteFully() argument
36 const uint8_t* start = reinterpret_cast<const uint8_t*>(buffer); in WriteFully()
42 memcpy(&(*vector_)[offset_], buffer, byte_count); in WriteFully()
Dfile_output_stream.cc28 bool FileOutputStream::WriteFully(const void* buffer, size_t byte_count) { in WriteFully() argument
29 return file_->WriteFully(buffer, byte_count); in WriteFully()
/art/test/2036-jni-filechannel/
Djni_filechannel.cc22 jobject buffer, in Java_Main_checkBufferCapacity() argument
24 jlong capacity = env->GetDirectBufferCapacity(buffer); in Java_Main_checkBufferCapacity()
/art/libelffile/dwarf/
Dexpression.h114 explicit Expression(std::vector<uint8_t>* buffer) : Writer<>(buffer) { in Expression() argument
115 buffer->clear(); in Expression()
Ddebug_abbrev_writer.h44 explicit DebugAbbrevWriter(Vector* buffer) in DebugAbbrevWriter() argument
45 : Writer<Vector>(buffer), in DebugAbbrevWriter()
46 current_abbrev_(buffer->get_allocator()) { in DebugAbbrevWriter()
Dwriter.h127 void PushData(const Vector* buffer) { in PushData() argument
128 data_->insert(data_->end(), buffer->begin(), buffer->end()); in PushData()
173 explicit Writer(Vector* buffer) : data_(buffer) { } in Writer() argument
/art/dex2oat/
Dverifier_deps_test.cc475 bool RunValidation(Fn fn, const std::vector<uint8_t>& buffer, std::string* error_msg) { in RunValidation() argument
482 bool parsed = decoded_deps.ParseStoredData(second_dex_files, ArrayRef<const uint8_t>(buffer)); in RunValidation()
1145 std::vector<uint8_t> buffer; in TEST_F() local
1146 verifier_deps_->Encode(dex_files_, &buffer); in TEST_F()
1147 ASSERT_FALSE(buffer.empty()); in TEST_F()
1150 bool parsed = decoded_deps.ParseStoredData(dex_files_, ArrayRef<const uint8_t>(buffer)); in TEST_F()
1159 std::vector<uint8_t> buffer; in TEST_F() local
1160 verifier_deps_->Encode(dex_files_, &buffer); in TEST_F()
1161 ASSERT_FALSE(buffer.empty()); in TEST_F()
1178 bool parsed = decoded_deps.ParseStoredData(dex_files, ArrayRef<const uint8_t>(buffer)); in TEST_F()
[all …]

123