Closed Bug 411175 Opened 17 years ago Closed 17 years ago

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

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: edwsmith, Assigned: stejohns)

Details

Attachments

(1 file)

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.  
Attached patch PatchSplinter Review
add sbox!/obox!/nsbox! and appropriate usage.
Assignee: nobody → stejohns
Status: NEW → ASSIGNED
Attachment #296173 - Flags: review?(edwsmith)
Comment on attachment 296173 [details] [diff] [review]
Patch

did this help performance at all?
Attachment #296173 - Flags: review?(edwsmith) → review+
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
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
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.

Attachment

General

Creator:
Created:
Updated:
Size: