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

Unified Diff: src/serialize.h

Issue 373713006: Introduce code serializer/deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments and rebased Created 6 years, 5 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 | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 70482d8dcfbdef1f963a5257ed3f6b5fdf437506..df9cb68f4d21aa5f869b9033c9d69975133df566 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -8,6 +8,7 @@
#include "src/hashmap.h"
#include "src/heap-profiler.h"
#include "src/isolate.h"
+#include "src/parser.h"
#include "src/snapshot-source-sink.h"
namespace v8 {
@@ -469,6 +470,7 @@ class Serializer : public SerializerDeserializer {
SerializationAddressMapper address_mapper_;
intptr_t root_index_wave_front_;
void Pad();
+ void PadByte();
friend class ObjectSerializer;
friend class Deserializer;
@@ -551,6 +553,29 @@ class StartupSerializer : public Serializer {
};
+class CodeSerializer : public Serializer {
+ public:
+ CodeSerializer(Isolate* isolate, SnapshotByteSink* sink)
+ : Serializer(isolate, sink) {
+ set_root_index_wave_front(Heap::kStrongRootListLength);
+ InitializeCodeAddressMap();
+ }
+
+ static ScriptData* Serialize(Handle<SharedFunctionInfo> info);
+ virtual void SerializeObject(Object* o, HowToCode how_to_code,
+ WhereToPoint where_to_point, int skip);
+
+ static Object* Deserialize(Isolate* isolate, ScriptData* data);
+
+ // The data header consists of int-sized entries:
+ // [0] version hash
+ // [1] length in bytes
+ // [2..8] reservation sizes for spaces from NEW_SPACE to PROPERTY_CELL_SPACE.
+ static const int kHeaderSize = 9;
+ static const int kVersionHashOffset = 0;
+ static const int kPayloadLengthOffset = 1;
+ static const int kReservationsOffset = 2;
+};
} } // namespace v8::internal
#endif // V8_SERIALIZE_H_
« no previous file with comments | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698