Closed
Bug 513121
Opened 16 years ago
Closed 15 years ago
String doesn't need master/index fields in every instance
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
VERIFIED
WONTFIX
Future
People
(Reporter: stejohns, Unassigned)
Details
Currently, every String has a union that contains a Stringp (master) and int32 (index).
The master field is only used for dependent strings; the index field is only used by parseIndex/getIntAtom, which is (effectively) only used for interned strings.
Since am-I-dependent and am-I-interned are known at String creation time, we could conditionally allocate the extra space for these fields and potentially 4 bytes for a lot of strings.
Comment 1•16 years ago
|
||
Not entirely true, unfortunately; the interned bit is set at an existing instance. If we did not, *every* interned string must be copied - you cannot just intern an arbitrary string, but only strings with a master/index field.
Comment 2•16 years ago
|
||
I think Steven is arguing that we know whether a string will be interned at the time when it is created. If that's true, then we don't need the ability to change the interned bit of an existing instance.
Comment 3•16 years ago
|
||
A savings of four bytes may not matter - the GC size classes are all spaced by 8 bytes, for small objects (and pointer tagging requires this, it's not primarily an artifact of MMgc). So the actual object size would be the same as before even if the logical object size is four bytes smaller.
That said, on a 64-bit system, String objects would actually be one word smaller because the master pointer is an 8-bit word at present.
Updated•16 years ago
|
Target Milestone: --- → Future
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Resolution: FIXED → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•