Lines Matching refs:BYTES
28 void StreamingDecoder::OnBytesReceived(Vector<const uint8_t> bytes) {
29 TRACE_STREAMING("OnBytesReceived(%zu bytes)\n", bytes.size());
31 while (ok() && current < bytes.size()) {
33 state_->ReadBytes(this, bytes.SubVector(current, bytes.size()));
40 total_size_ += bytes.size();
47 Vector<const uint8_t> bytes) {
48 size_t num_bytes = std::min(bytes.size(), remaining());
49 TRACE_STREAMING("ReadBytes(%zu bytes)\n", num_bytes);
50 memcpy(buffer() + offset(), &bytes.first(), num_bytes);
67 OwnedVector<uint8_t> bytes = OwnedVector<uint8_t>::New(total_size_);
68 uint8_t* cursor = bytes.start();
70 #define BYTES(x) (x & 0xFF), (x >> 8) & 0xFF, (x >> 16) & 0xFF, (x >> 24) & 0xFF
71 uint8_t module_header[]{BYTES(kWasmMagic), BYTES(kWasmVersion)};
72 #undef BYTES
77 DCHECK_LE(cursor - bytes.start() + buffer->length(), total_size_);
78 memcpy(cursor, buffer->bytes(), buffer->length());
81 processor_->OnFinishedStream(std::move(bytes));
105 Vector<const uint8_t> bytes) override;
130 // Checks if the magic bytes of the module header are correct.
179 return section_buffer_->bytes() + section_buffer_->payload_offset();
238 return section_buffer_->bytes() + buffer_offset_;
252 StreamingDecoder* streaming, Vector<const uint8_t> bytes) {
253 size_t bytes_read = std::min(bytes.size(), remaining());
255 memcpy(buffer() + offset(), &bytes.first(), bytes_read);
259 // The number of bytes we actually needed to read.
262 TRACE_STREAMING(" ==> %zu bytes consumed\n", bytes_consumed_);
266 // We only report an error if we read all bytes.
274 // We read all the bytes we needed.
357 // Copy the bytes we read into the section buffer.
359 memcpy(section_buffer_->bytes() + section_buffer_->payload_offset(),
374 return streaming->Error("not all code section bytes were consumed");
384 // Copy the bytes we consumed into the section buffer.
386 memcpy(section_buffer_->bytes() + buffer_offset_, buffer(),
397 streaming->Error("not enough code section bytes");
420 return streaming->Error("not all code section bytes were used");