Skip to content

avm2: Declare correct signature for builtin rust-side getters/setters #17494

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

Aaron1011
Copy link
Member

This only affects the handful of classes that we still implement entirely in Rust (with only an ActionScript stub when compiling playerglobals).

We now expose the proper signatures to describeType, and have more type information for future use in the optimizer.

@torokati44 torokati44 changed the title avm2: Declare correct signature for builtin rust-side getters/settesr avm2: Declare correct signature for builtin rust-side getters/setters Aug 13, 2024
@torokati44 torokati44 force-pushed the builtin-getter-settter-types branch from 7dc3e56 to 06ac6fc Compare August 13, 2024 09:17
@evilpie
Copy link
Collaborator

evilpie commented Sep 8, 2024

This should be even simpler after #17792 lands.

@evilpie evilpie added the waiting-on-author Waiting on the PR author to make the requested changes label Sep 9, 2024
@danielhjacobs danielhjacobs added A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already) labels Sep 17, 2024
@Aaron1011 Aaron1011 force-pushed the builtin-getter-settter-types branch from 06ac6fc to a274833 Compare September 25, 2024 23:21
This only affects the handful of classes that we still implement
entirely in Rust (with only an ActionScript stub when compiling
playerglobals).

We now expose the proper signatures to `describeType`, and have
more type information for future use in the optimizer.
@Aaron1011 Aaron1011 force-pushed the builtin-getter-settter-types branch from a274833 to 8e310c7 Compare September 25, 2024 23:33
@Aaron1011 Aaron1011 removed the waiting-on-author Waiting on the PR author to make the requested changes label Sep 26, 2024
@@ -1155,24 +1156,39 @@ impl<'gc> Class<'gc> {
&'static str,
Option<NativeMethodImpl>,
Option<NativeMethodImpl>,
Option<Gc<'gc, Multiname<'gc>>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be simpler if this accepted Option<&' static str> instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the simplest thing here would be to use the CommonNamespaces fields in the getter/setter definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants