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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 11318018: - Represent strings internally in UTF-16 format, this makes it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 14314)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -1715,37 +1715,6 @@
}
-RawFourByteString* FourByteString::ReadFrom(SnapshotReader* reader,
- intptr_t object_id,
- intptr_t tags,
- Snapshot::Kind kind) {
- // Read the length so that we can determine instance size to allocate.
- ASSERT(reader != NULL);
- intptr_t len = reader->ReadSmiValue();
- intptr_t hash = reader->ReadSmiValue();
- FourByteString& str_obj = FourByteString::ZoneHandle(reader->isolate(),
- FourByteString::null());
-
- if (kind == Snapshot::kFull) {
- RawFourByteString* obj = reader->NewFourByteString(len);
- str_obj = obj;
- str_obj.set_tags(tags);
- obj->ptr()->hash_ = Smi::New(hash);
- uint32_t* raw_ptr = (len > 0)? str_obj.CharAddr(0) : NULL;
- for (intptr_t i = 0; i < len; i++) {
- ASSERT(str_obj.CharAddr(i) == raw_ptr); // Will trigger assertions.
- *raw_ptr = reader->Read<uint32_t>();
- raw_ptr += 1;
- }
- ASSERT(String::Hash(str_obj, 0, str_obj.Length()) == hash);
- } else {
- ReadFromImpl<FourByteString, uint32_t>(reader, &str_obj, len, tags, kind);
- }
- reader->AddBackRef(object_id, &str_obj, kIsDeserialized);
- return str_obj.raw();
-}
-
-
template<typename T>
static void StringWriteTo(SnapshotWriter* writer,
intptr_t object_id,
@@ -1812,20 +1781,6 @@
}
-void RawFourByteString::WriteTo(SnapshotWriter* writer,
- intptr_t object_id,
- Snapshot::Kind kind) {
- StringWriteTo(writer,
- object_id,
- kind,
- kFourByteStringCid,
- writer->GetObjectTags(this),
- ptr()->length_,
- ptr()->hash_,
- ptr()->data_);
-}
-
-
RawExternalOneByteString* ExternalOneByteString::ReadFrom(
SnapshotReader* reader,
intptr_t object_id,
@@ -1846,16 +1801,6 @@
}
-RawExternalFourByteString* ExternalFourByteString::ReadFrom(
- SnapshotReader* reader,
- intptr_t object_id,
- intptr_t tags,
- Snapshot::Kind kind) {
- UNREACHABLE();
- return ExternalFourByteString::null();
-}
-
-
void RawExternalOneByteString::WriteTo(SnapshotWriter* writer,
intptr_t object_id,
Snapshot::Kind kind) {
@@ -1886,21 +1831,6 @@
}
-void RawExternalFourByteString::WriteTo(SnapshotWriter* writer,
- intptr_t object_id,
- Snapshot::Kind kind) {
- // Serialize as a non-external four byte string.
- StringWriteTo(writer,
- object_id,
- kind,
- kFourByteStringCid,
- writer->GetObjectTags(this),
- ptr()->length_,
- ptr()->hash_,
- ptr()->external_data_->data());
-}
-
-
RawBool* Bool::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,

Powered by Google App Engine
This is Rietveld 408576698