-
-
Notifications
You must be signed in to change notification settings - Fork 877
avm2: Use return type of methods in optimizer #20257
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
Lord-McSweeney
wants to merge
43
commits into
ruffle-rs:master
Choose a base branch
from
Lord-McSweeney:avm2-use-return-type
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
c70cb8e
avm2: Make getter functions fields for URLLoader
fc0e585
avm2: Make fields getter/setter functions for MouseEvent
1fb6f57
avm2: Minor fixes in VideoTextureEvent, Video, and Telemetry classes
87cd082
avm2: Make fields getter/setter functions for Gradient*Filter
6286868
avm2: Make fields getter/setter functions for DRMReturnVoucher*Event
c84e0d9
avm2: Make `text` field into an accessor for TextEvent
4407f6a
avm2: Remove incorrect overrides of getter functions in TextLine
9a77685
avm2: Use correct method signatures for Microphone
c62d6c4
avm2: Make x and y fields getter/setter pairs for Stage3D
984364f
avm2: Make Mutex.isSupported a getter
60750c5
avm2: Make fields getter/setter functions for GraphicsGradientFill
575bd85
avm2: Make describeType(QName) match FP's output
8c02717
avm2: Make fields getter/setter for SampleDataEvent
236f518
avm2: Make describeType output for URLVariables and AVPauseAtPeriodEn…
c01a486
avm2: Make `activating` field a getter/setter for ActivityEvent
34b7390
avm2: Make describeType output for UncaughtErrorEvent and VideoStream…
4e10ab1
avm2: Make fields getter/setter functions for DRMAuthenticationComple…
da33263
avm2: Make `info` field an accessor for NetStatusEvent
06cd77a
chore: Format AS3 filter classes
84a971d
avm2: Make `enableErrorChecking` a field for Context3D
4734a4d
avm2: Fix versioning and use accessors for NativeMenuItem properties
b4615e6
avm2: Make fields getter/setter functions for ContextMenuItem
ec7eb52
avm2: Make fields getter/setter functions for AVHTTPStatusEvent
a0b49e9
avm2: Make `changeList` field a getter/setter for SyncEvent
dbf9458
avm2: Make fields getter/setter functions for StatusEvent
02b76d8
avm2: Make fields getter/setter functions for ProgressEvent
c4ccb62
avm2: Make `serverURL` field an accessor for DRMLicenseRequestEvent
6954215
avm2: Use accessors instead of fields for HTTPStatusEvent
58dd4a6
avm2: Make `culling` field an accessor for GraphicsTrianglePath
e7a710a
avm2: Make `relatedObject` field an accessor for SoftKeyboardEvent
d58fb11
avm2: Use accessors instead of fields for FocusEvent properties
eedf4ee
avm2: Use accessors instead of fields for NetConnection properties
040975c
avm2: Use accessors instead of fields for AccelerometerEvent properties
b2f45ec
avm2: Use accessors instead of fields for GestureEvent properties
1f3ddf6
avm2: Use accessors instead of fields for DRMAuthenticationErrorEvent…
71999d8
avm2: Use accessors instead of fields for TouchEvent properties
5247ced
chore: Format TouchEvent.as
89d7cec
avm2: Coerce return value of native methods
0a92420
avm2: Fix incorrect method return values/types for some native methods
101933a
avm2: Fully validate all classes using user-provided traits
1218754
avm2: Verify that overrides of methods have the same return type
f93fbc7
avm2: Return type of Transform.matrix3D should be *, not void
0506f76
avm2: Use type information from return type of getters and methods in…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not do it during (or after)
init_vtable
? It already contains the "check trait kind" logic. If we did it duringinit_vtable
, we could directly comparemethod_table[*disp_id as usize]
just before setting the override. If we did it afterinit_vtable
, we could lookup the name inresolved_traits
instead. Both feel faster and more correct than quadratic loop with name comparisons.Actually...
I was just checking what FP does and turns out it does both: the trait kind check early and signature check late - and it can be observed.
The "is it legal to override trait kind A with B" and "overriding methods without
override
is illegal" checks are done early during initial class loading, preparing the main name->property hashmap; FP does this eagerly, while we doinit_vtable
late - so in FP the class can fail these even if it's never used.(see
Traits::getOverride
and where it's used. It does do a lookup on parent by name just like we domatch resolved_traits.get()
ininit_vtable
.)Meanwhile the overridden methods' signatures are compared late, like in
newclass
. So if the class exists and has a mismatched signature but is never used/referred to, there won't be any VerifyErrors.(see
TraitsBindings::checkOverride
, used inVTable::resolveSignatures(self)
, which is directly called fromMethodEnv::newclass
(and a dozen other places). It also doesn't concern itself with names anymore, it just compares vtable.methods[dispid] vs parent_vtable.methods[dispid]).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.
I'm not saying we need to do it exactly like FP; simply moving the entire logic during/after
init_vtable
will just prevent some quadratic loops and should be conceptually simpler overall.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.
And even if the verification didn't move and stayed before
init_vtable
, couldn't we still lookup the superclass's fields by name without a loop, just likeinit_vtable
does:resolved_traits.get(trait_data.name())
?