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

Unified Diff: src/objects-inl.h

Issue 2895008: Virtually dispatched specialized 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
« src/heap.cc ('K') | « src/objects.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0e455508456d7b23465fa893194b51993e316c78..e764e39fcc5a83c2ed2a57629285b15ec3f1263c 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2060,6 +2060,23 @@ void ExternalFloatArray::set(int index, float value) {
ptr[index] = value;
}
+inline Scavenger Map::scavenger() {
+ Scavenger callback = reinterpret_cast<Scavenger>(
+ READ_INTPTR_FIELD(this, kIterateBodyCallbackOffset));
+
+ ASSERT(callback == Heap::GetScavenger(instance_type(),
+ instance_size()));
+
+ return callback;
+}
+
+inline void Map::set_scavenger(Scavenger callback) {
+ ASSERT(!reinterpret_cast<Object*>(
+ reinterpret_cast<intptr_t>(callback))->IsHeapObject());
+ WRITE_INTPTR_FIELD(this,
+ kIterateBodyCallbackOffset,
+ reinterpret_cast<intptr_t>(callback));
+}
int Map::instance_size() {
return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2;
« src/heap.cc ('K') | « src/objects.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698