-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deps: backport 0d01728 from v8's upstream #2912
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2782,6 +2782,28 @@ void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src, | |
Address base_pointer_slot = | ||
dst->address() + FixedTypedArrayBase::kBasePointerOffset; | ||
RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot); | ||
} else if (src->IsJSArrayBuffer()) { | ||
heap()->MoveBlock(dst->address(), src->address(), size); | ||
|
||
// Visit inherited JSObject properties and byte length of ArrayBuffer | ||
Address regular_slot = | ||
dst->address() + JSArrayBuffer::BodyDescriptor::kStartOffset; | ||
Address regular_slots_end = | ||
dst->address() + JSArrayBuffer::kByteLengthOffset + kPointerSize; | ||
while (regular_slot < regular_slots_end) { | ||
RecordMigratedSlot(Memory::Object_at(regular_slot), regular_slot); | ||
regular_slot += kPointerSize; | ||
} | ||
|
||
// Skip backing store and visit just internal fields | ||
Address internal_field_slot = dst->address() + JSArrayBuffer::kSize; | ||
Address internal_fields_end = | ||
dst->address() + JSArrayBuffer::kSizeWithInternalFields; | ||
while (internal_field_slot < internal_fields_end) { | ||
RecordMigratedSlot(Memory::Object_at(internal_field_slot), | ||
internal_field_slot); | ||
internal_field_slot += kPointerSize; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if I read this right, it basically iterates over the arraybuffer's properties skipping the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bnoordhuis yeah, this is what v8 team advised me to do... |
||
} else if (FLAG_unbox_double_fields) { | ||
Address dst_addr = dst->address(); | ||
Address src_addr = src->address(); | ||
|
@@ -3206,6 +3228,12 @@ bool MarkCompactCollector::IsSlotInLiveObject(Address slot) { | |
if (object->IsFixedTypedArrayBase()) { | ||
return static_cast<int>(slot - object->address()) == | ||
FixedTypedArrayBase::kBasePointerOffset; | ||
} else if (object->IsJSArrayBuffer()) { | ||
int off = static_cast<int>(slot - object->address()); | ||
return (off >= JSArrayBuffer::BodyDescriptor::kStartOffset && | ||
off <= JSArrayBuffer::kByteLengthOffset) || | ||
(off >= JSArrayBuffer::kSize && | ||
off < JSArrayBuffer::kSizeWithInternalFields); | ||
} else if (FLAG_unbox_double_fields) { | ||
// Filter out slots that happen to point to unboxed double fields. | ||
LayoutDescriptorHelper helper(object->map()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
kStartOffset
property is inherited fromJSObject
, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.