irken-compiler icon indicating copy to clipboard operation
irken-compiler copied to clipboard

need to add back in the single-immediate optimization

Open samrushing opened this issue 12 years ago • 2 comments

This was originally in the python compiler, if a datatype contains an alt with a single immediate in it, and this immediate type is not present again in the datatype, then we can skip the box layer and use that immediate directly.

Example:

(datatype thing
  (:level int)
  (:abbrev char)
  )

This version of thing can actually be always stored as an immediate, quite a handy optimization. This version cannot:

(datatype thing
  (:level int)
  (:abbrev int)
  )

... because there is no way at runtime to distinguish between the two ints.

samrushing avatar Mar 04 '13 01:03 samrushing

This might be moot with precise gc and untagged immediates.

samrushing avatar Oct 14 '15 07:10 samrushing

I would not bother with this. I think this is premature optimization, and is adding complexity to a tag system that will be moot with untagged immediates and precise gc.

jeske avatar May 22 '17 22:05 jeske