Skip to content

avm1: Remove Gc indirection for SuperObject #20369

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moulins
Copy link
Contributor

@moulins moulins commented May 8, 2025

Follow-up to #20204.

@moulins moulins added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-perf Type: Performance Improvements labels May 8, 2025
depth: u8,

/// Adds a niche, so that enums contaning this type can use it for their discriminant.
_niche: crate::utils::ZeroU8,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work exactly? Shouldn't Rust reuse this space for the discriminant anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust will never overlap a discriminant with padding, because padding can have any value (it's roughly like an invisible MaybeUninit<[u8; _]> field); adding the ZeroU8 field instead says that any SuperObject must have a zero byte at this offset.

@moulins moulins force-pushed the avm1-no-super-indirection branch 3 times, most recently from 4043a71 to dc58c1f Compare May 13, 2025 18:33
@moulins moulins force-pushed the avm1-no-super-indirection branch from dc58c1f to 6ccb56a Compare May 17, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) T-perf Type: Performance Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants