Lines Matching refs:size

151 // instructions_and_sizes_, followed by a representation of its size
152 // if the opcode does not implicitly give the instruction size.
155 // of which contains the opcode 0x02 (ADD size 1). Because that was the
157 // EncodeInstruction is then called with inst = VCD_COPY, size = 4, mode = 0.
159 // opcode 0xA3 (ADD size 1 + COPY size 4 mode 0).
162 // have implicit sizes, meaning that the size of the instruction will not
166 // double-instruction opcode (say, COPY size 0 mode 0 + ADD size 0)
167 // followed by the size of the COPY, then by the size of the ADD.
169 // would follow its size, so the ordering would be
173 size_t size,
192 if (size <= UCHAR_MAX) {
196 static_cast<unsigned char>(size),
205 // Try finding a compound opcode with size 0.
214 AppendSizeToString(size, &instructions_and_sizes_);
219 if (size <= UCHAR_MAX) {
222 static_cast<unsigned char>(size),
226 last_opcode_index_ = static_cast<int>(instructions_and_sizes_.size() - 1);
230 // There should always be an opcode with size 0.
234 << ", mode " << mode << ", size 0" << VCD_ENDL;
238 last_opcode_index_ = static_cast<int>(instructions_and_sizes_.size() - 1);
239 AppendSizeToString(size, &instructions_and_sizes_);
242 void VCDiffCodeTableWriter::Add(const char* data, size_t size) {
243 EncodeInstruction(VCD_ADD, size);
244 data_for_add_and_run_->append(data, size);
245 target_length_ += size;
248 void VCDiffCodeTableWriter::Copy(int32_t offset, size_t size) {
258 // *after* the instruction and its size.
264 EncodeInstruction(VCD_COPY, size, mode);
270 target_length_ += size;
273 void VCDiffCodeTableWriter::Run(size_t size, unsigned char byte) {
274 EncodeInstruction(VCD_RUN, size);
276 target_length_ += size;
279 size_t VCDiffCodeTableWriter::CalculateLengthOfSizeAsVarint(size_t size) {
280 return VarintBE<int32_t>::Length(static_cast<int32_t>(size));
283 void VCDiffCodeTableWriter::AppendSizeToString(size_t size, string* out) {
284 VarintBE<int32_t>::AppendToString(static_cast<int32_t>(size), out);
288 size_t size,
290 VarintBE<int32_t>::AppendToOutputString(static_cast<int32_t>(size), out);
299 CalculateLengthOfSizeAsVarint(separate_data_for_add_and_run_.size()) +
300 CalculateLengthOfSizeAsVarint(instructions_and_sizes_.size()) +
301 CalculateLengthOfSizeAsVarint(separate_addresses_for_copy_.size()) +
302 separate_data_for_add_and_run_.size() +
303 instructions_and_sizes_.size() +
304 separate_addresses_for_copy_.size();
334 // Source segment size: dictionary size
344 const size_t size_before_delta_encoding = out->size();
347 AppendSizeToOutputString(separate_data_for_add_and_run_.size(), out);
348 AppendSizeToOutputString(instructions_and_sizes_.size(), out);
349 AppendSizeToOutputString(separate_addresses_for_copy_.size(), out);
357 separate_data_for_add_and_run_.size());
359 instructions_and_sizes_.size());
361 separate_addresses_for_copy_.size());
363 const size_t size_after_delta_encoding = out->size();