Fix test failures on nosnap builder.

Review URL: https://chromiumcodereview.appspot.com/10915277

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
erik.corry@gmail.com 2012-09-14 13:19:42 +00:00
parent ad4746c8a3
commit 07ac7a4032
2 changed files with 8 additions and 5 deletions

View File

@ -1618,7 +1618,7 @@ void Serializer::Pad() {
bool SnapshotByteSource::AtEOF() {
if (0u + length_ - position_ > sizeof(uint32_t)) return false;
if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false;
for (int x = position_; x < length_; x++) {
if (data_[x] != SerializerDeserializer::nop()) return false;
}

View File

@ -86,10 +86,13 @@ bool Snapshot::Initialize(const char* snapshot_file) {
int len;
byte* str = ReadBytes(snapshot_file, &len);
if (!str) return false;
SnapshotByteSource source(str, len);
Deserializer deserializer(&source);
ReserveSpaceForSnapshot(&deserializer, snapshot_file);
bool success = V8::Initialize(&deserializer);
bool success;
{
SnapshotByteSource source(str, len);
Deserializer deserializer(&source);
ReserveSpaceForSnapshot(&deserializer, snapshot_file);
success = V8::Initialize(&deserializer);
}
DeleteArray(str);
return success;
} else if (size_ > 0) {