Index: src/snapshot-common.cc |
=================================================================== |
--- src/snapshot-common.cc (revision 3302) |
+++ src/snapshot-common.cc (working copy) |
@@ -38,15 +38,8 @@ |
namespace internal { |
bool Snapshot::Deserialize(const byte* content, int len) { |
- Deserializer des(content, len); |
- des.GetFlags(); |
- return V8::Initialize(&des); |
-} |
- |
- |
-bool Snapshot::Deserialize2(const byte* content, int len) { |
SnapshotByteSource source(content, len); |
- Deserializer2 deserializer(&source); |
+ Deserializer deserializer(&source); |
return V8::Initialize(&deserializer); |
} |
@@ -56,46 +49,17 @@ |
int len; |
byte* str = ReadBytes(snapshot_file, &len); |
if (!str) return false; |
- bool result = Deserialize(str, len); |
+ Deserialize(str, len); |
DeleteArray(str); |
- return result; |
- } else if (size_ > 0) { |
- return Deserialize(data_, size_); |
- } |
- return false; |
-} |
- |
- |
-bool Snapshot::Initialize2(const char* snapshot_file) { |
- if (snapshot_file) { |
- int len; |
- byte* str = ReadBytes(snapshot_file, &len); |
- if (!str) return false; |
- Deserialize2(str, len); |
- DeleteArray(str); |
return true; |
} else if (size_ > 0) { |
- Deserialize2(data_, size_); |
+ Deserialize(data_, size_); |
return true; |
} |
return false; |
} |
-bool Snapshot::WriteToFile(const char* snapshot_file) { |
- Serializer ser; |
- ser.Serialize(); |
- byte* str; |
- int len; |
- ser.Finalize(&str, &len); |
- |
- int written = WriteBytes(snapshot_file, str, len); |
- |
- DeleteArray(str); |
- return written == len; |
-} |
- |
- |
class FileByteSink : public SnapshotByteSink { |
public: |
explicit FileByteSink(const char* snapshot_file) { |
@@ -121,9 +85,9 @@ |
}; |
-bool Snapshot::WriteToFile2(const char* snapshot_file) { |
+bool Snapshot::WriteToFile(const char* snapshot_file) { |
FileByteSink file(snapshot_file); |
- Serializer2 ser(&file); |
+ Serializer ser(&file); |
ser.Serialize(); |
return true; |
} |