add dedicated boxing primitives for use in Forth when the value being boxed is known not-null and/or not-NaN eliminates null pointer checks and/or CMOV for common code paths. e.g. SUPER: setrawboxtypeornull (( i i -- x )) OVER NOT INEG | setrawboxtype ; : obox ( obj -- x ) BoxedObj setrawboxtypeornull ; : obox! ( obj -- x ) BoxedObj setrawboxtype ;
How frequently do such occurrences actually happen? (ie do you already have a list of candidate words that would benefit from this optimization)
sure, any time we box a string constant, for example, or any time we box a new object we just created. (OP_newobject, OP_newarray, result of constructing an object, etc). I dont have a concrete list however.
Created attachment 296173 [details] [diff] [review] Patch add sbox!/obox!/nsbox! and appropriate usage.
Comment on attachment 296173 [details] [diff] [review] Patch did this help performance at all?
Not measurably on the AS3Chess test, no, it's within the noise level at this point. But it's definitely fewer ops in a lot of places and so worth doing.
pushed as changeset: 279:101e97c2d1c5
Closing out all TT: transfer bugs that are resolved fixed.