Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/snapshot-source-sink.h

Issue 376223002: Refactor ScriptData class for cached compile data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« src/preparse-data.h ('K') | « src/serialize.cc ('k') | src/snapshot-source-sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698