Chromium Code Reviews

Unified Diff: src/heap/incremental-marking.cc

Issue 1647123002: Write barrier for storing a code entry, and usage in CompileLazy builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index 52d0ca4e51b6e297c04c94bfb686116722d32bba..a0243aa9cc92a03e8bf05ba12fca807cf38639e9 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -91,6 +91,18 @@ void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, Object** slot,
marking->RecordWrite(obj, slot, *slot);
}
+// static
+void IncrementalMarking::RecordWriteOfCodeEntryFromCode(JSFunction* host,
+ Object** slot,
+ Isolate* isolate) {
+ DCHECK(host->IsJSFunction());
+ IncrementalMarking* marking = isolate->heap()->incremental_marking();
+ Code* value = Code::cast(
+ Code::GetObjectFromEntryAddress(reinterpret_cast<Address>(slot)));
+ // TODO(mvstanton): Verify that we only come in here when we _need_ to be
+ // here, the slow case should be dealt with before calling into C.
+ marking->RecordWriteOfCodeEntry(host, slot, value);
+}
void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc,
HeapObject* value) {

Powered by Google App Engine