Index: src/snapshot-source-sink.h |
diff --git a/src/snapshot-source-sink.h b/src/snapshot-source-sink.h |
index eae8606fbed11f31ff124b66518a9ff19d083292..f98b5d0a4e0283ab1d717ecde0ac4227c6bf66f2 100644 |
--- a/src/snapshot-source-sink.h |
+++ b/src/snapshot-source-sink.h |
@@ -71,9 +71,10 @@ class SnapshotByteSource V8_FINAL { |
class SnapshotByteSink { |
public: |
virtual ~SnapshotByteSink() { } |
- virtual void Put(int byte, const char* description) = 0; |
- virtual void PutSection(int byte, const char* description) { |
- Put(byte, description); |
+ virtual void Put(byte b, const char* description) = 0; |
+ virtual void PutSection(int b, const char* description) { |
+ ASSERT_LE(b, kMaxUInt8); |
+ Put(static_cast<byte>(b), description); |
} |
void PutInt(uintptr_t integer, const char* description); |
void PutRaw(byte* data, int number_of_bytes, const char* description); |
@@ -86,7 +87,7 @@ class DummySnapshotSink : public SnapshotByteSink { |
public: |
DummySnapshotSink() : length_(0) {} |
virtual ~DummySnapshotSink() {} |
- virtual void Put(int byte, const char* description) { length_++; } |
+ virtual void Put(byte b, const char* description) { length_++; } |
virtual int Position() { return length_; } |
private: |
@@ -98,7 +99,7 @@ class DummySnapshotSink : public SnapshotByteSink { |
class DebugSnapshotSink : public SnapshotByteSink { |
public: |
explicit DebugSnapshotSink(SnapshotByteSink* chained) : sink_(chained) {} |
- virtual void Put(int byte, const char* description) V8_OVERRIDE; |
+ virtual void Put(byte b, const char* description) V8_OVERRIDE; |
virtual int Position() V8_OVERRIDE { return sink_->Position(); } |
private: |
@@ -108,14 +109,14 @@ class DebugSnapshotSink : public SnapshotByteSink { |
class ListSnapshotSink : public i::SnapshotByteSink { |
public: |
- explicit ListSnapshotSink(i::List<char>* data) : data_(data) {} |
- virtual void Put(int byte, const char* description) V8_OVERRIDE { |
- data_->Add(byte); |
+ explicit ListSnapshotSink(i::List<byte>* data) : data_(data) {} |
+ virtual void Put(byte b, const char* description) V8_OVERRIDE { |
+ data_->Add(b); |
} |
virtual int Position() V8_OVERRIDE { return data_->length(); } |
private: |
- i::List<char>* data_; |
+ i::List<byte>* data_; |
}; |
} // namespace v8::internal |