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

Unified Diff: src/objects.h

Issue 2950003: Virtually dispatched scavengers (Closed)
Patch Set: Created 10 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/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
diff --git a/src/objects.h b/src/objects.h
index 4a7dee6a836f9a9614d4b4032097db1274195a82..48cb4953daa61703c3d77a3093e332c3a76bc046 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2899,6 +2899,7 @@ class Code: public HeapObject {
DISALLOW_IMPLICIT_CONSTRUCTORS(Code);
};
+typedef void (*Scavenger)(Map* map, HeapObject** slot, HeapObject* object);
// All heap objects have a Map that describes their structure.
// A Map contains information about:
@@ -3100,6 +3101,13 @@ class Map: public HeapObject {
void MapVerify();
#endif
+ inline Scavenger scavenger();
+ inline void set_scavenger(Scavenger callback);
+
+ inline void Scavenge(HeapObject** slot, HeapObject* obj) {
+ scavenger()(this, slot, obj);
+ }
+
static const int kMaxPreAllocatedPropertyFields = 255;
// Layout description.
@@ -3110,7 +3118,8 @@ class Map: public HeapObject {
static const int kInstanceDescriptorsOffset =
kConstructorOffset + kPointerSize;
static const int kCodeCacheOffset = kInstanceDescriptorsOffset + kPointerSize;
- static const int kPadStart = kCodeCacheOffset + kPointerSize;
+ static const int kScavengerCallbackOffset = kCodeCacheOffset + kPointerSize;
+ static const int kPadStart = kScavengerCallbackOffset + kPointerSize;
static const int kSize = MAP_POINTER_ALIGN(kPadStart);
// Layout of pointer fields. Heap iteration code relies on them
« 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