Skip to content

Conversation

@moulins
Copy link
Contributor

@moulins moulins commented Oct 18, 2025

core/src/loader.rs is one of the oldest files in the Ruffle codebase, and was written before gc_arena introduced DynamicRoots, requiring awkward contortions to access GC'd objects from OwnedFutures.

In particular, the Loader variants (except Movie) were only useful for ferrying data into OwnedFutures, and can be completely replaced with judicious DynamicRoots wrappers.

To avoid inflating the already-large diff, I put most of the existing loaders into two dummy modules, ops1 and ops2, keeping the code at the same indentation level.

@Dinnerbone Dinnerbone self-requested a review October 18, 2025 20:24
@moulins moulins added T-refactor Type: Refactor / Cleanup A-core Area: Core player, where no other category fits labels Oct 18, 2025
loader_object,
let future = crate::loader::load_data_into_url_loader(
activation.context,
loader_object.as_script_object().unwrap(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you make this pass a Object instead of a ScriptObject? The latter is technically more precise, but it adds a lot of extra code and goes through an extra useless unwrap+rewrap.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing an Object would require adding a ObjectHandle type, which itself requires either:

  • double-boxing the handle, which is unstatisfying;
  • adding a FooHandle for all objects variants;
  • only support the Object variants which have a Handle, like it was done for DisplayObjectWeak.

IMHO, any of theses solutions is extra code and complexity that isn't warranted.

Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney left a comment

Choose a reason for hiding this comment

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

Everything besides the nits lgtm assuming the ops and ops2 modules will be removed in a future or follow-up PR

@moulins moulins force-pushed the loader-dynamic-roots branch from e3e3178 to 16fbf29 Compare October 20, 2025 21:01
Self(context.dynamic_root.stash(context.gc(), this.0))
}

pub fn fetch<'gc>(&self, context: &UpdateContext<'gc>) -> Object<'gc> {
Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney Oct 20, 2025

Choose a reason for hiding this comment

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

(non-blocking) Looking at this again, it might be better if the fetch methods were associated methods (XXXHandle::fetch) so that it's clear that they correspond to the stash operation

@moulins moulins force-pushed the loader-dynamic-roots branch from 16fbf29 to 95e5278 Compare October 22, 2025 19:48
@moulins moulins merged commit d20376a into ruffle-rs:master Oct 22, 2025
26 checks passed
@moulins moulins deleted the loader-dynamic-roots branch October 22, 2025 20:09
moulins added a commit to moulins/ruffle that referenced this pull request Oct 22, 2025
Dinnerbone pushed a commit to moulins/ruffle that referenced this pull request Oct 23, 2025
Dinnerbone pushed a commit that referenced this pull request Oct 23, 2025
Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request Oct 26, 2025
------------------------------------------------------------------------------------------
dolphin-emu.mk df351b60591140d70d7d1ef87f5332875b2b5322 # Version: Commits on Oct 23, 2025
------------------------------------------------------------------------------------------
Merge pull request #13771 from SuperSamus/gameini-speedhacks

GameINI: Add some speed hacks,

-----------------------------------------------------------------------------------
eden.mk 199bc6a1704842cac675de95c130fc27e03623d6 # Version: Commits on Oct 23, 2025
-----------------------------------------------------------------------------------
[texture_cache] Fix WIN32 #ifdef for texture_cache (#2823)

-------------------------------------------------------------------------------------
hatari.mk fda67f05188a925535fefc1b0ef24eb044a029d2 # Version: Commits on Oct 22, 2025
-------------------------------------------------------------------------------------
List SDL GUI updates in release notes,

----------------------------------------------------
pcsx2.mk v2.5.244 # Version: Commits on Oct 23, 2025
----------------------------------------------------
- [MainWindow: Add a separator between Achievements and Controllers](PCSX2/pcsx2#13437)

,

-------------------------------------------------------------------------------------
ppsspp.mk f8c49ccf23953610087d2166d479a9d1ec6ecbcb # Version: Commits on Oct 23, 2025
-------------------------------------------------------------------------------------
Merge pull request #20914 from hrydgard/more-new-icons

More UI work on portrait mode,

------------------------------------------------------------------------------------
rpcs3.mk ae30cb5557aa4ba85376f6dcdab430f76a679d40 # Version: Commits on Oct 23, 2025
------------------------------------------------------------------------------------
SaveStates/SPU-LLVM: Fix SPU Access Violations on load,

-----------------------------------------------------
ryujinx.mk 1.3.185 # Version: Commits on Oct 22, 2025
-----------------------------------------------------
Canary-1.3.185

-------------------------------------------------------------------------------------------
xenia-native.mk 4644657e83af7e8086be58b11d42d445b1d19ba7 # Version: Commits on Oct 23, 2025
-------------------------------------------------------------------------------------------
[Vulkan] Implement readback_resolve for vulkan,

-------------------------------------------------------------------------------------
ikemen.mk 87249537ed1362dcffd34099024c46a3c7ad249a # Version: Commits on Oct 23, 2025
-------------------------------------------------------------------------------------
Merge pull request #2831 from NeatUnsou/develop

feat: Add ZoomVar Trigger,

---------------------------------------------------------------
ruffle.mk nightly-2025-10-23 # Version: Commits on Oct 23, 2025
---------------------------------------------------------------
## What's Changed

* core: Replace unmaintained `unic-segment` crate with `unicode-segmentation` by @torokati44 in ruffle-rs/ruffle#21990

* chore: Revert `wasm-bindgen` to `0.2.101`, ...`-futures` to `0.4.51`, `js-sys` and `web-sys` to `0.3.78` by @torokati44 in ruffle-rs/ruffle#21985

* avm2: Minor performance improvements by @Lord-McSweeney in ruffle-rs/ruffle#21937

* chore: Bump `wgpu-hal` to `26.0.5` by @torokati44 in ruffle-rs/ruffle#21991

* core: Remove all `Loader` variants (except `Movie`) in favor of using `DynamicRoot`s by @moulins in ruffle-rs/ruffle#21968

* chore: Remove unnecessary calls to drop() by @kjarosh in ruffle-rs/ruffle#21995

* tests: Import swfc tests from gnash by @Dinnerbone in ruffle-rs/ruffle#21963

* web: Note Ruffle does not collect user data (Firefox) by @danielhjacobs in ruffle-rs/ruffle#21983

**Full Changelog**: ruffle-rs/ruffle@nightly-2025-10-22...nightly-2025-10-23,

---------------------------------------------------------------------------------------
thextech.mk cef5085f8bba13a58b3504ccf181e34317295af6 # Version: Commits on Oct 23, 2025
---------------------------------------------------------------------------------------
Translated using Weblate (Tamil)

Currently translated at 100.0% (680 of 680 strings)

Translated using Weblate (Tamil)

Currently translated at 100.0% (393 of 393 strings)

Co-authored-by: தமிழà¯�நேரமà¯� <[email protected]>

Translate-URL: https://hosted.weblate.org/projects/thextech/engine-assets-specific/ta/

Translate-URL: https://hosted.weblate.org/projects/thextech/engine-general/ta/

Translation: TheXTech Engine/Engine Assets-specific

Translation: TheXTech Engine/Engine General,

-------------------------------------------------------------------------------------------
sdl12-compat.mk fbb588618c22cf0d6d99328e39e64ef0d744a3c5 # Version: Commits on Oct 23, 2025
-------------------------------------------------------------------------------------------
update dr_mp3.h from mainstream.,

------------------------------------------------------------------------------------
box64.mk 448ee01f44b0aabb5c39d5c73edf8f8b6a051fe4 # Version: Commits on Oct 23, 2025
------------------------------------------------------------------------------------
[LA64] Fixed LBT signal handling for ABI 1.0 (#3088)

* [LA64] Fixed LBT signal handling for ABI 1.0

* fix,

------------------------------------------------------------------------------------------
devilutionx.mk db9404dcf6b58fae528dcc6affdad2918f45c572 # Version: Commits on Oct 23, 2025
------------------------------------------------------------------------------------------
CMake: Add SDL3_mixer

Requires a not-yet-released SDL 3.4.0.

I tried implementing audio with plain SDL and it's too complicated.,

----------------------------------------------------------------------------------------
supertux2.mk ee76219bfb11b7ce916e3b531d5df40ea0b1626f # Version: Commits on Oct 22, 2025
----------------------------------------------------------------------------------------
Update translation templates,

------------------------------------------------------------------------------------------------
libretro-mame-src.mk 3be1747da6c8c833fe43b16e1dccf2badaba6a50 # Version: Commits on Oct 23, 2025
------------------------------------------------------------------------------------------------
Merge remote-tracking branch 'upstream/master',

----------------------------------------------------------------------------------------
ryzen-smu.mk 21c1e2c51832dccfac64981b345745ce0cccf524 # Version: Commits on Oct 22, 2025
----------------------------------------------------------------------------------------
Added Strix Halo support (#31),

----------------------------------------------------------------------------------------
retroarch.mk 933baca92b406fe80ee3fd1245f958739d7b3ab9 # Version: Commits on Oct 23, 2025
----------------------------------------------------------------------------------------
Smart integer scaling fixup,

---------------------------------------------------------------------------------------
vpinball.mk afc7c38ffb1078076ec523c37b30055061c93ff1 # Version: Commits on Jul 23, 2024
---------------------------------------------------------------------------------------
misc: standalone builds for macos, ios, tvos, android, linux, and rpi,

-----------------------------------------------------------------------------------
tr1x.mk c06025e7070ea862752d9f9c58fbb8608637053e # Version: Commits on Oct 23, 2025
-----------------------------------------------------------------------------------
tr1/strings: update NG+ flare description

The TR1 specific string override for NG+ description is no longer

required as the addition of flares means the common one can be used.,

-----------------------------------------------------------------------------------
tr2x.mk c06025e7070ea862752d9f9c58fbb8608637053e # Version: Commits on Oct 23, 2025
-----------------------------------------------------------------------------------
tr1/strings: update NG+ flare description

The TR1 specific string override for NG+ description is no longer

required as the addition of flares means the common one can be used.,

----------------------------------------------------------------------------------------------
libretro-ppsspp.mk f8c49ccf23953610087d2166d479a9d1ec6ecbcb # Version: Commits on Oct 23, 2025
----------------------------------------------------------------------------------------------
Merge pull request #20914 from hrydgard/more-new-icons

More UI work on portrait mode,

----------------------------------------------------------------------------------------------------
libretro-yabasanshiro.mk f79322453024d29b84c3af364e0da2d578ff36ec # Version: Commits on Oct 23, 2025
----------------------------------------------------------------------------------------------------
MiSTer parity—reset ALFO at OP5

SCSP: Reset ALFO at OP5 (MiSTer parity). Fixes cross-stage ALFO attenuation that

muted/quieted layers during gameplay. Improves House of the Dead (stage BGM/SFX)

and Die Hard Arcade (more complete BGM, clearer hits). Guarded by

PHAENON_SCSP_MISTER_DIEHARD (ON by default). Works alongside the saturating

DSP shifter and optional +18 dB preamp.,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-core Area: Core player, where no other category fits T-refactor Type: Refactor / Cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants