mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
Read 64 bits at a time in the bitcode reader.
The reading of 64 bit values could still be optimized, but at least this cuts down on the number of virtual calls to fetch more data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221865 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -90,13 +90,12 @@ uint64_t StreamingMemoryObject::getExtent() const {
|
||||
uint64_t StreamingMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
|
||||
uint64_t Address) const {
|
||||
fetchToPos(Address + Size - 1);
|
||||
uint64_t BufferSize = Bytes.size() - BytesSkipped;
|
||||
if (Address >= BufferSize)
|
||||
if (Address >= BytesRead)
|
||||
return 0;
|
||||
|
||||
uint64_t End = Address + Size;
|
||||
if (End > BufferSize)
|
||||
End = BufferSize;
|
||||
if (End > BytesRead)
|
||||
End = BytesRead;
|
||||
Size = End - Address;
|
||||
assert(Size >= 0);
|
||||
memcpy(Buf, &Bytes[Address + BytesSkipped], Size);
|
||||
|
Reference in New Issue
Block a user