Skip to content

Rewrite conditional String code and add assertions in WB #94

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

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

wks
Copy link

@wks wks commented Sep 12, 2024

This PR makes two changes.

Rewrote string.c to use the WHEN_USING_MMTK, WHEN_NOT_USING_MMTK and WHEN_USING_MMTK2 macros. It should make the code that depending on whether MMTk is used easier to read and maintain.

Added the ability to do assertions in write barriers about whether the source and the target objects are valid references to MMTk objects. This will help catching dangling references as soon as they are written into object fields (if written using write barriers, which should be the common case anyway). The assertions are enabled using the MMTK_WB_ASSERT_VO macro. Note that tests will fail if we enable it now due to existing bugs.

These changes makes preparation for fixing bugs related to strings, including #93

wks added 2 commits September 12, 2024 15:11
Added a feature to assert the source and the target objects are valid
object references in write barriers.  It is controlled by a macro so
that it can be enabled in release build, too.
When the "#if USE_MMTK" directive and the `if (rb_mmtk_enabled_p())`
statement are used together, it will be very complicated and confusing.
We rewrite `string.c` using the convenient `WHEN_USING_MMTK`,
`WHEN_NOT_USING_MMTK` and `WHEN_USING_MMTK2` macros when possible.

This commit does not change the semantics of the existing code in
`string.c`.
@wks wks merged commit cba8733 into mmtk:dev/mmtk-overrides-default Sep 12, 2024
105 of 113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant