Open fniephaus opened 3 years ago
If you don't mind the hacky bits, this is how TruffleSOM integrates your #basicNew
into a dispatch chain: https://github.com/SOM-st/TruffleSOM/pull/56/commits/d2f04f3bf3de79fb13176d6566cf331577a4f8bc
Specifically this for the standard dispatch, similar for super:
Both,
SqueakObjectNewNode
and thePrimNewNode
s cache the receiverClass in some cases:https://github.com/hpi-swa/trufflesqueak/blob/a0f1de39da15d304958b89b326b8dad177344e44/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/accessing/SqueakObjectNewNode.java#L74-L87
https://github.com/hpi-swa/trufflesqueak/blob/a0f1de39da15d304958b89b326b8dad177344e44/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/primitives/impl/StoragePrimitives.java#L182-L253
It may make sense to revise this to avoid cache duplication.