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

Unified Diff: src/objects.h

Issue 242050: Changed structure of accessor arguments passing to allow accessor (Closed)
Patch Set: Tuned Created 11 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
« src/arguments.h ('K') | « src/heap.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
diff --git a/src/objects.h b/src/objects.h
index 5be492966dbd4a0f18d40981f54e92a15c536c0b..e22eaa11dfba600e60dbc638e7fe3b646464ed71 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4219,25 +4219,44 @@ class ExternalTwoByteString: public ExternalString {
};
+// Utility superclass for stack-allocated objects that must be updated
+// on gc. It provides two ways for the gc to update instances, either
iposva 2009/09/30 22:19:05 gc -> GC
+// iterating or updating after gc.
+class Relocatable BASE_EMBEDDED {
+public:
iposva 2009/09/30 22:19:05 Presubmit Check: Fail
+ inline Relocatable() : prev_(top_) { top_ = this; }
+ virtual ~Relocatable() { ASSERT_EQ(top_, this); top_ = prev_; }
iposva 2009/09/30 22:19:05 Presubmit Check: Fail
+ virtual void IterateInstance(ObjectVisitor* v) { }
+ virtual void PostGarbageCollection() { }
+
+ static void PostGarbageCollectionProcessing();
+ static int ArchiveSpacePerThread();
+ static char* ArchiveState(char* to);
+ static char* RestoreState(char* from);
+ static void Iterate(ObjectVisitor* v);
+ static void Iterate(ObjectVisitor* v, Relocatable* top);
+ static char* Iterate(ObjectVisitor* v, char* t);
+private:
iposva 2009/09/30 22:19:05 Presubmit Check: Fail
+ static Relocatable* top_;
+ Relocatable* prev_;
+};
+
+
// A flat string reader provides random access to the contents of a
// string independent of the character width of the string. The handle
// must be valid as long as the reader is being used.
-class FlatStringReader BASE_EMBEDDED {
+class FlatStringReader : public Relocatable {
public:
explicit FlatStringReader(Handle<String> str);
explicit FlatStringReader(Vector<const char> input);
- ~FlatStringReader();
- void RefreshState();
+ void PostGarbageCollection();
inline uc32 Get(int index);
int length() { return length_; }
- static void PostGarbageCollectionProcessing();
private:
String** str_;
bool is_ascii_;
int length_;
const void* start_;
- FlatStringReader* prev_;
- static FlatStringReader* top_;
};
« src/arguments.h ('K') | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698