[Vm-dev] Is there a smarter way to get the performance of numbered prims without the headaches? (was: Signed at:[put:] primitives for bits classes)
florin.mateoc at gmail.com
Thu Jun 21 03:47:35 UTC 2018
On 6/20/2018 10:04 PM, David T. Lewis wrote:
> Let me take this as an opportunity to issue an official RFT (Request for
> Fresh Thinking).
> Starting with three assertions that I claim to be true:
> 1) Numbered primitives are needed for performance, required by the the JIT.
> 2) Named primitives are good.
> 3) Numbered primmitives are evil.
> Is there some way that we might achieve the benefits of numbered primitives
> for performance, while also using named primitives on the image side for
> maintainability and comprehension?
> In other words, could we invent some scheme whereby primitives are identified
> by name in the image, and those names become associated with primitive numbers
> at load time? Here, "load time" is a hand-waving reference to either "assign
> the numbers at image load time" or "assign an integer primitive number at
> the time of first resolving the primitive name to a function address".
> In the image, named references to primitives are good. In the VM, integer
> references to primitive functions are good. Is it possible to have both?
> I am thinking that a solution might involve statically defined primitive
> numbers assigned in #initializePrimitiveTable, augmented by dynamically
> assigned primitive numbers allocated at primitive function load time.
VisualAge does this by using pool variables.
The pragmas are defined through (and display) the name of the pool variables (e.g. <primitive: VMprObjectBasicAt>), but
the pool variables hold integers - say if you inspect them, you get integers
More information about the Vm-dev