Assert that all NativeObject slot accesses touch only slot indices within the slot span
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
People
(Reporter: mismith, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Previously, slot accessors in NativeObject
asserted only that slot indices were within capacity (i.e., slot < numFixedSlots()
or slot < numFixedSlots() + numDynamicSlots()
). However, slot accesses should also be within the actual slot span. If a shape says that "objects with this shape span 3 slots", then slot indices accessed on those objects should be within [0, 3), even if we allocate 4 slots' worth of capacity in practice to avoid reallocation. Add asserts to ensure this is truly the case.
The attached patch passes all jstests and jit-tests, but a broader try
run may be in order before fully landing it.
Reporter | ||
Comment 1•3 years ago
|
||
Previously, slot accessors in NativeObject
asserted only that slot
indices were within capacity (i.e., slot < numFixedSlots()
or slot < numFixedSlots() + numDynamicSlots()
). However, slot accesses should
also be within the actual slot span. If a shape says that "objects
with this shape span 3 slots", then slot indices accessed on those
objects should be within [0, 3), even if we allocate 4 slots' worth of
capacity in practice to avoid reallocation. Add asserts to ensure this
is truly the case.
This patch gets there in a few steps:
-
Add a few more
xxxMaybeForwarded
method variants toNativeObject
to account for accesses coming from trace hooks. -
Change
NativeObject::slotInRange
from checking the slot index
against the slot capacity to checking it against the slot span, while
still asserting that the slot span is within capacity. -
Annotate anywhere we assert
NativeObject::slotIsFixed(slot)
with an
additionalNativeObject::slotInRange(slot)
.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Required Rationale: Changing severity to S3 because enhancement
Updated•3 years ago
|
Comment 3•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:mismith, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Comment 4•2 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Comment 5•2 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:sdetar, since the bug has recent activity, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Description
•