Comments (2)
I don't understand your ask here.
from modlauncher.
Looking through the other issues here, this is basically a corollary (or possibly duplicate) of #4, though with a slightly narrower scope.
It actually boils down to two actualy where Mixin needs to obtain bytecode for a class without actually classloading it, but does need that bytecode to be transformed "normally" by everything except itself. (Using bytecode/classnode interchangably here since the format doesn't matter to me). The two cases are:
-
Obtaining classnode for a "template" class. This is a class which shouldn't be classloaded, it is used as a template for other things. This includes actual mixin bytecode to be loaded, parsed, and applied to targets as well as inner classes of those mixins which need to be synthesized into new versions for the target classes to use. For example if a mixin has an inner class
MyMixin$MyInnerClass
that "class" must not be loaded, it will be loaded asMixinTarget$RepatriatedInnerClass
orOtherMixinTarget$RepatriatedInnerClass
and never as its original self. This means the original code passes through the transformer chain once, like it would under a normal class load operation but it never makes it as far as the ClassLoader. -
Obtaining classnode for an arbitrary class to generate metadata for it. This is because the pipeline is such that a bunch of things in the class hierarchy need to be known before a mixin is applied, but if we wait until class load to obtain those data then it's too late to do anything with them. This includes enumerating fields, methods and interfaces on target classes. Since additional fields, methods and interfaces might be added by transformers - or of course removed - this bytecode needs to travel through the transformer chain as well. This doesn't happen for every class, only classes referenced by mixins.
The ask here is that there isn't an elegant way to obtain the bytecode and run the transformer chain on it without the kind of ugly hacks that I've wrapped in Internals
which
- Obtain the original bytecode in a mundane way
- Pass it through the transformer chain with simple reflection
- Short-circuit the transformer chain by throwing an exception
Which works but is somewhat inelegant.
The duties in question are handled by IClassBytecodeProvider
so you can see the duties required here.
Hopefully that makes more sense? I'll be around this evening anyway if you want to discuss it some more.
from modlauncher.
Related Issues (20)
- Service Providers are not properly propagated to children HOT 3
- ModuleLayerHandler.getLayer throws NPE if layer is missing HOT 15
- GAME layer resources returned from beginScanning are ignored HOT 1
- How to use for own game? HOT 2
- TransformationServices cannot add classes or resources. HOT 1
- Vanilla command line arguments inaccesible
- INameMappingService isn't exposed in API jar HOT 1
- Not compatible with Java 16 HOT 3
- OpenJ9 detection fails for certain builds of the VM HOT 1
- Readme needs updating
- Cannot get jdk class byte from ITransformerLoader HOT 1
- Need to reimplement test harness and testing paradigm if we stick with modular setup HOT 1
- Unable to transform class related to record. HOT 8
- `ClassCastException` due to transformers that implement nonparameterized interfaces HOT 3
- [NPE] Cannot invoke "joptsimple.OptionSet.valueOf(joptsimple.OptionSpec)" because "this.optionSet" is null HOT 1
- Broken feature: ITransformationService::additionalClassesLocator
- Allow registering additional packages in the transformable layer for generated classes HOT 3
- Incompatibility between modlauncher 8.1.x (mc 1.16) and Java 8 u321+ HOT 7
- Modlauncher can't detect interfaces of transformer parents HOT 2
- TransformerDiscoveryService not recognized HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modlauncher.