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

Unified Diff: runtime/vm/snapshot.h

Issue 343803002: Finishes removing intptr_t from raw object fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
« no previous file with comments | « runtime/vm/scopes.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.h
===================================================================
--- runtime/vm/snapshot.h (revision 40039)
+++ runtime/vm/snapshot.h (working copy)
@@ -93,8 +93,8 @@
kObjectId = 0x3,
};
static const int8_t kHeaderTagBits = 2;
-static const int8_t kObjectIdBits = (kBitsPerWord - (kHeaderTagBits + 1));
-static const intptr_t kMaxObjectId = (kUwordMax >> (kHeaderTagBits + 1));
+static const int8_t kObjectIdBits = (kBitsPerInt32 - (kHeaderTagBits + 1));
+static const intptr_t kMaxObjectId = (kMaxUint32 >> (kHeaderTagBits + 1));
class SerializedHeaderTag : public BitField<enum SerializedHeaderType,
@@ -187,13 +187,6 @@
return ReadStream::Raw<sizeof(T), T>::Read(&stream_);
}
- // Reads an intptr_t type value.
- intptr_t ReadIntptrValue() {
- int64_t value = Read<int64_t>();
- ASSERT((value <= kIntptrMax) && (value >= kIntptrMin));
- return static_cast<intptr_t>(value);
- }
-
intptr_t ReadRawPointerValue() {
int64_t value = Read<int64_t>();
return static_cast<intptr_t>(value);
@@ -440,12 +433,6 @@
WriteStream::Raw<sizeof(T), T>::Write(&stream_, value);
}
- // Writes an intptr_t type value out.
- void WriteIntptrValue(intptr_t value) {
- ASSERT((value >= kMinInt32) && (value <= kMaxInt32));
- Write<int64_t>(value);
- }
-
void WriteRawPointerValue(intptr_t value) {
Write<int64_t>(value);
}
@@ -457,7 +444,7 @@
intptr_t value = 0;
value = SerializedHeaderTag::update(kObjectId, value);
value = SerializedHeaderData::update(object_id, value);
- WriteIntptrValue(value);
+ Write<int32_t>(value);
}
// Write a VM Isolateobject that is serialized as an Id.
@@ -466,7 +453,7 @@
intptr_t value = 0;
value = SerializedHeaderTag::update(kObjectId, value);
value = SerializedHeaderData::update(object_id, value);
- WriteIntptrValue(-value); // Write as a negative value.
+ Write<int32_t>(-value); // Write as a negative value.
}
// Write serialization header information for an object.
@@ -475,7 +462,7 @@
intptr_t value = 0;
value = SerializedHeaderTag::update(kInlined, value);
value = SerializedHeaderData::update(id, value);
- WriteIntptrValue(value);
+ Write<int32_t>(value);
}
void WriteTags(intptr_t tags) {
« no previous file with comments | « runtime/vm/scopes.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698