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

Unified Diff: src/objects-inl.h

Issue 335009: New snapshot framework. Doesn't work on ARM yet (code targets... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 3115)
+++ src/objects-inl.h (working copy)
@@ -945,6 +945,25 @@
}
+bool MapWord::IsSerializationAddress() {
+ return HAS_SMI_TAG(reinterpret_cast<Object*>(value_));
+}
+
+
+MapWord MapWord::FromSerializationAddress(int raw) {
+ // When the map word is being used as a serialization address we Smi-encode
+ // the serialization address (which is always a smallish positive integer).
+ return MapWord(reinterpret_cast<uintptr_t>(Smi::FromInt(raw)));
+}
+
+
+int MapWord::ToSerializationAddress() {
+ // When the map word is being used as a serialization address we treat the
+ // map word as a Smi and get the small integer that it encodes.
+ return reinterpret_cast<Smi*>(value_)->value();
+}
+
+
bool MapWord::IsMarked() {
return (value_ & kMarkingMask) == 0;
}

Powered by Google App Engine
This is Rietveld 408576698