TT: add obox!, sbox!, dbox!, nsbox! when boxed value is known not-null or not-NaN

VERIFIED FIXED

Status

Tamarin
Virtual Machine
VERIFIED FIXED
10 years ago
8 years ago

People

(Reporter: Edwin Smith, Assigned: Steven Johnson)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
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 ;
(Assignee)

Comment 1

10 years ago
How frequently do such occurrences actually happen? (ie do you already have a list of candidate words that would benefit from this optimization)
(Reporter)

Comment 2

10 years ago
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.  
(Assignee)

Comment 3

10 years ago
Created attachment 296173 [details] [diff] [review]
Patch

add sbox!/obox!/nsbox! and appropriate usage.
Assignee: nobody → stejohns
Status: NEW → ASSIGNED
Attachment #296173 - Flags: review?(edwsmith)
(Reporter)

Comment 4

10 years ago
Comment on attachment 296173 [details] [diff] [review]
Patch

did this help performance at all?
Attachment #296173 - Flags: review?(edwsmith) → review+
(Assignee)

Comment 5

10 years ago
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.
(Assignee)

Comment 6

10 years ago
pushed as changeset:   279:101e97c2d1c5
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 7

8 years ago
Closing out all TT: transfer bugs that are resolved fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.