Chromium Code Reviews| Index: src/snapshot-source-sink.h |
| diff --git a/src/snapshot-source-sink.h b/src/snapshot-source-sink.h |
| index 66feaecca4ff5024b63838cf9c040aea3f172591..c105607ef376c84c6263b35acd2e6276d1fb6147 100644 |
| --- a/src/snapshot-source-sink.h |
| +++ b/src/snapshot-source-sink.h |
| @@ -36,16 +36,17 @@ class SnapshotByteSource FINAL { |
| return data_[position_++]; |
| } |
| - int32_t GetUnalignedInt(); |
| - |
| void Advance(int by) { position_ += by; } |
| void CopyRaw(byte* to, int number_of_bytes); |
| inline int GetInt() { |
| - // This way of variable-length encoding integers does not suffer from branch |
| - // mispredictions. |
| - uint32_t answer = GetUnalignedInt(); |
| + // This way of decoding variable-length encoded integers does not |
| + // suffer from branch mispredictions. |
|
vogelheim
2015/03/16 15:23:08
Any idea why the compiler didn't inline GetUnalign
vogelheim
2015/03/16 15:23:08
The DCHECK for exceeding the buffer is gone. Was t
|
| + uint32_t answer = data_[position_]; |
| + answer |= data_[position_ + 1] << 8; |
| + answer |= data_[position_ + 2] << 16; |
| + answer |= data_[position_ + 3] << 24; |
| int bytes = (answer & 3) + 1; |
| Advance(bytes); |
| uint32_t mask = 0xffffffffu; |