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

Unified Diff: src/serialize.h

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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/scopeinfo.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
===================================================================
--- src/serialize.h (revision 3427)
+++ src/serialize.h (working copy)
@@ -289,7 +289,24 @@
void PutInt(uintptr_t integer, const char* description);
};
+class SerializerPrivateData;
+class SerializerData {
+ public:
+ SerializerPrivateData& private_data_;
+ private:
+ bool serialization_enabled_;
+ // Did we already make use of the fact that serialization was not enabled?
+ bool too_late_to_enable_now_;
+
+ SerializerData();
+ ~SerializerData();
+
+ friend class V8Context;
+ friend class Serializer;
+ DISALLOW_COPY_AND_ASSIGN(SerializerData);
+};
+
class Serializer : public SerDes {
public:
explicit Serializer(SnapshotByteSink* sink);
@@ -299,17 +316,24 @@
void VisitPointers(Object** start, Object** end);
static void Enable() {
- if (!serialization_enabled_) {
- ASSERT(!too_late_to_enable_now_);
+ SerializerData& serializer_data = v8_context()->serializer_data_;
+ if (!serializer_data.serialization_enabled_) {
+ ASSERT(!serializer_data.too_late_to_enable_now_);
}
- serialization_enabled_ = true;
+ serializer_data.serialization_enabled_ = true;
}
- static void Disable() { serialization_enabled_ = false; }
+ static void Disable() {
+ v8_context()->serializer_data_.serialization_enabled_ = false;
+ }
// Call this when you have made use of the fact that there is no serialization
// going on.
- static void TooLateToEnableNow() { too_late_to_enable_now_ = true; }
- static bool enabled() { return serialization_enabled_; }
+ static void TooLateToEnableNow() {
+ v8_context()->serializer_data_.too_late_to_enable_now_ = true;
+ }
+ static bool enabled() {
+ return v8_context()->serializer_data_.serialization_enabled_;
+ }
#ifdef DEBUG
virtual void Synchronize(const char* tag);
#endif
@@ -382,10 +406,6 @@
SnapshotByteSink* sink_;
int current_root_index_;
ExternalReferenceEncoder* external_reference_encoder_;
- static bool serialization_enabled_;
- // Did we already make use of the fact that serialization was not enabled?
- static bool too_late_to_enable_now_;
-
friend class ObjectSerializer;
friend class Deserializer;
« no previous file with comments | « src/scopeinfo.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698