1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-10-01 00:10:47 +00:00
CC-Tweaked/projects
Jonathan Coates 71669cf49c
Replace ASM generation with MethodHandles
This is the second time I've rewritten our class generation in a little
over a month. Oh dear!

Back in d562a051c7 we started using method
handles inside our generated ASM, effectively replacing a direct call
with .invokeExact on a constant method handle.

This goes one step further and removes our ASM entirely, building up a
MethodHandle that checks arguments and then wraps the return value.
Rather than generating a class, we just return a new LuaFunction
instance that invokeExacts the method handle.

This is definitely slower than what we had before, but in the order of
8ns vs 12ns (in the worst case, sometimes they're much more comparable),
so I'm not too worried in practice.

However, generation of the actual method is now a bit faster. I've not
done any proper benchmarking, but it's about 20-30% faster.

This also gives us a bit more flexibility in the future, for instance
uisng bound MethodHandles in generation (e.g. for instance methods on
GenericSources). Not something I'm planning on doing right now, but is
an option.
2023-10-11 20:05:37 +01:00
..
common Fix common jar not actually being published 2023-10-11 19:15:36 +01:00
common-api Replace several Guava classes with Java stdlib 2023-10-11 09:59:55 +01:00
core Replace ASM generation with MethodHandles 2023-10-11 20:05:37 +01:00
core-api Build a web-based emulator for the documentation site (#1597) 2023-10-03 09:19:19 +01:00
fabric Ensure the terminal exists when creating a monitor peripheral 2023-10-09 22:09:01 +01:00
fabric-api Publish Fabric jars to CF/Modrinth 2023-03-15 23:20:13 +00:00
forge Relicense a couple of more files 2023-10-11 08:00:07 +01:00
forge-api License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00
lints Flesh out MemoryMount into a writable mount 2023-09-29 22:15:23 +01:00
web Replace ASM generation with MethodHandles 2023-10-11 20:05:37 +01:00
ARCHITECTURE.md License CC:T according to the REUSE specification (#1351) 2023-03-15 21:52:13 +00:00