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

Unified Diff: src/objects-visiting.h

Issue 3615009: Parallelize marking phase of mark-sweep/compact collection cycle. (Closed)
Patch Set: Created 10 years, 2 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/objects-inl.h ('k') | src/platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-visiting.h
diff --git a/src/objects-visiting.h b/src/objects-visiting.h
index 90f7ce0b3dfa9e04b2b63bfd9c6b8e06551711d1..09af40ef068cd87f5556f9fe081862904987422e 100644
--- a/src/objects-visiting.h
+++ b/src/objects-visiting.h
@@ -146,7 +146,7 @@ class VisitorDispatchTable {
void Register(StaticVisitorBase::VisitorId id, Callback callback) {
ASSERT((0 <= id) && (id < StaticVisitorBase::kVisitorIdCount));
- callbacks_[id] = callback;
+ if (callbacks_[id] != callback) callbacks_[id] = callback;
}
template<typename Visitor,
@@ -387,6 +387,29 @@ void Code::CodeIterateBody() {
}
+template<typename StaticVisitor, typename Data>
+void Code::CodeIterateBody(Data data) {
+ int mode_mask = RelocInfo::kCodeTargetMask |
+ RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+ RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
+ RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
+ RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
+ RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
+
+ // Use the relocation info pointer before it is visited by
+ // the heap compaction in the next statement.
+ RelocIterator it(this, mode_mask);
+
+ StaticVisitor::VisitPointer(
+ reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset), data);
+
+ for (; !it.done(); it.next()) {
+ it.rinfo()->template Visit<StaticVisitor, Data>(data);
+ }
+}
+
+
+
} } // namespace v8::internal
#endif // V8_OBJECTS_VISITING_H_
« no previous file with comments | « src/objects-inl.h ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698