Skip to content

[cppia] Restore memref object access for haxe 4 - #1457

Merged
tobil4sk merged 3 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/haxe4-cppia-object-fields-performance
Nov 5, 2026
Merged

tobil4sk merged 3 commits into
HaxeFoundation:masterfrom
tobil4sk:fix/haxe4-cppia-object-fields-performance

Conversation

@tobil4sk

@tobil4sk tobil4sk commented Nov 1, 2026

Copy link
Copy Markdown
Member

Removing this in #1324 had a serious impact on performance (see #1365). It only has to be
removed for haxe 5, where functions are now a typed callable object and
accessing a function field using MemReference caused a crash.

I've also included a test for #1321, to make sure this doesn't cause a regression. If #1324 is fully reverted, the test would crash with haxe 5:

$ bin/CppiaHost-debug bin/client.cppia
Running cases.TestCommon...
    testResolvingScriptType
    testInterfaceCalling
    testDynamicMethod
terminate called after throwing an instance of 'Dynamic'
zsh: abort (core dumped)  bin/CppiaHost-debug bin/client.cppia

Removing this had a serious impact on performance. It only has to be
removed for haxe 5, where functions are now a typed callable object and
accessing a function field using MemReference caused a crash.
This type is included from Client, so doesn't need to be included here
explicitly.
@tobil4sk

tobil4sk commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

I'll go ahead and merge this is how it worked before on haxe 4 anyway. The test is adequate to cover any regression.

This will allow us to see the performance loss in haxe 5 more clearly in the benchmarks, which can help guide the work in #1365

@tobil4sk
tobil4sk merged commit 23514a5 into HaxeFoundation:master Nov 5, 2026
61 checks passed
@tobil4sk
tobil4sk deleted the fix/haxe4-cppia-object-fields-performance branch November 5, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant