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

Unified Diff: src/heap/mark-compact.cc

Issue 1176263004: Introduce a base pointer field in FixedTypedArrayBase and teach GC about it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/heap/heap.cc ('k') | src/heap/store-buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 0255dfca96b438fc26fc914166216c93cb278d40..b56af23c4931dbf50e19ede19870a6817ed48732 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2779,7 +2779,12 @@ void MarkCompactCollector::MigrateObjectTagged(HeapObject* dst, HeapObject* src,
void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src,
int size) {
- if (FLAG_unbox_double_fields) {
+ if (src->IsFixedTypedArrayBase()) {
+ heap()->MoveBlock(dst->address(), src->address(), size);
+ Address base_pointer_slot =
+ dst->address() + FixedTypedArrayBase::kBasePointerOffset;
+ RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot);
+ } else if (FLAG_unbox_double_fields) {
Address dst_addr = dst->address();
Address src_addr = src->address();
Address src_slot = src_addr;
@@ -3198,7 +3203,10 @@ bool MarkCompactCollector::IsSlotInLiveObject(Address slot) {
}
case HeapObjectContents::kMixedValues: {
- if (FLAG_unbox_double_fields) {
+ if (object->IsFixedTypedArrayBase()) {
+ return static_cast<int>(slot - object->address()) ==
+ FixedTypedArrayBase::kBasePointerOffset;
+ } else if (FLAG_unbox_double_fields) {
// Filter out slots that happen to point to unboxed double fields.
LayoutDescriptorHelper helper(object->map());
DCHECK(!helper.all_fields_tagged());
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/store-buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698