OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ | 5 #ifndef V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ |
6 #define V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ | 6 #define V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ |
7 | 7 |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 answer |= data_[position_ + 3] << 24; | 50 answer |= data_[position_ + 3] << 24; |
51 int bytes = (answer & 3) + 1; | 51 int bytes = (answer & 3) + 1; |
52 Advance(bytes); | 52 Advance(bytes); |
53 uint32_t mask = 0xffffffffu; | 53 uint32_t mask = 0xffffffffu; |
54 mask >>= 32 - (bytes << 3); | 54 mask >>= 32 - (bytes << 3); |
55 answer &= mask; | 55 answer &= mask; |
56 answer >>= 2; | 56 answer >>= 2; |
57 return answer; | 57 return answer; |
58 } | 58 } |
59 | 59 |
60 bool GetBlob(const byte** data, int* number_of_bytes); | 60 // Returns length. |
61 | 61 int GetBlob(const byte** data); |
62 bool AtEOF(); | |
63 | 62 |
64 int position() { return position_; } | 63 int position() { return position_; } |
65 | 64 |
66 private: | 65 private: |
67 const byte* data_; | 66 const byte* data_; |
68 int length_; | 67 int length_; |
69 int position_; | 68 int position_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(SnapshotByteSource); | 70 DISALLOW_COPY_AND_ASSIGN(SnapshotByteSource); |
72 }; | 71 }; |
(...skipping 25 matching lines...) Expand all Loading... |
98 const List<byte>& data() const { return data_; } | 97 const List<byte>& data() const { return data_; } |
99 | 98 |
100 private: | 99 private: |
101 List<byte> data_; | 100 List<byte> data_; |
102 }; | 101 }; |
103 | 102 |
104 } // namespace internal | 103 } // namespace internal |
105 } // namespace v8 | 104 } // namespace v8 |
106 | 105 |
107 #endif // V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ | 106 #endif // V8_SNAPSHOT_SNAPSHOT_SOURCE_SINK_H_ |
OLD | NEW |