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

Unified Diff: src/objects.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/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
===================================================================
--- src/objects.h (revision 3427)
+++ src/objects.h (working copy)
@@ -4191,16 +4191,33 @@
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString);
};
+class Relocatable;
+class RelocatableData {
+ public:
+ inline void save(Relocatable* new_top, Relocatable*& saved_old_top) {
+ saved_old_top = top_;
+ top_ = new_top;
+ }
+ inline void restore(Relocatable* top, Relocatable* saved_old_top) {
+ ASSERT_EQ(top_, top);
+ top_ = saved_old_top;
+ }
+ private:
+ friend class V8Context;
+ friend class Relocatable;
+ Relocatable * top_;
+ RelocatableData();
+ DISALLOW_COPY_AND_ASSIGN(RelocatableData);
+};
// Utility superclass for stack-allocated objects that must be updated
// on gc. It provides two ways for the gc to update instances, either
// iterating or updating after gc.
class Relocatable BASE_EMBEDDED {
public:
- inline Relocatable() : prev_(top_) { top_ = this; }
+ inline Relocatable() { v8_context()->relocatable_data_.save(this, prev_); }
virtual ~Relocatable() {
- ASSERT_EQ(top_, this);
- top_ = prev_;
+ v8_context()->relocatable_data_.restore(this, prev_);
}
virtual void IterateInstance(ObjectVisitor* v) { }
virtual void PostGarbageCollection() { }
@@ -4213,7 +4230,6 @@
static void Iterate(ObjectVisitor* v, Relocatable* top);
static char* Iterate(ObjectVisitor* v, char* t);
private:
- static Relocatable* top_;
Relocatable* prev_;
};
@@ -4867,6 +4883,18 @@
}
};
+class ObjectsData {
+ public:
+ StringInputBuffer string_compare_buffer_a_;
+ StringInputBuffer string_compare_buffer_b_;
+ StaticResource<StringInputBuffer> string_input_buffer_;
+
+ private:
+ friend class V8Context;
+ ObjectsData() {}
+ DISALLOW_COPY_AND_ASSIGN(ObjectsData);
+};
+
} } // namespace v8::internal
#endif // V8_OBJECTS_H_
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698