Index: src/snapshot-source-sink.cc |
diff --git a/src/snapshot-source-sink.cc b/src/snapshot-source-sink.cc |
index ec05734e9e0af83aa1dd76b08ba24b5ed82fd33e..9935ff73963c7e157b40b33c3e4c2da6dbe5b380 100644 |
--- a/src/snapshot-source-sink.cc |
+++ b/src/snapshot-source-sink.cc |
@@ -12,6 +12,15 @@ |
namespace v8 { |
namespace internal { |
+ |
+ |
+SnapshotByteSource::SnapshotByteSource(const byte* array, int length) |
+ : data_(array), length_(length), position_(0) { |
+} |
+ |
+ |
+SnapshotByteSource::~SnapshotByteSource() { } |
+ |
int32_t SnapshotByteSource::GetUnalignedInt() { |
DCHECK(position_ < length_); // Require at least one byte left. |
@@ -43,17 +52,15 @@ |
if (bytes > 3) Put(static_cast<int>((integer >> 24) & 0xff), "IntPart4"); |
} |
- |
-void SnapshotByteSink::PutRaw(const byte* data, int number_of_bytes, |
+void SnapshotByteSink::PutRaw(byte* data, int number_of_bytes, |
const char* description) { |
- data_.AddAll(Vector<byte>(const_cast<byte*>(data), number_of_bytes)); |
+ data_.AddAll(Vector<byte>(data, number_of_bytes)); |
} |
- |
-void SnapshotByteSink::PutBlob(Vector<const byte> blob, |
+void SnapshotByteSink::PutBlob(byte* data, int number_of_bytes, |
const char* description) { |
- PutInt(blob.length(), description); |
- PutRaw(blob.start(), blob.length(), description); |
+ PutInt(number_of_bytes, description); |
+ PutRaw(data, number_of_bytes, description); |
} |