|
From: Anthony H. <ajh...@ya...> - 2004-04-10 15:54:26
|
Anthony Hannan <aj...@co...> wrote: > n serves as the identity hash for variable structures (usually variable > structures sit inside tuples so their identityHashes won't be used > much). I forgot about Symbols which are variable structures. I would make Symbols tuples with one field pointing to its string, or with internationalization the one field would probably be an index into a String table. Also, I think selectors someday might be more than just a name, for example to contain type information (message signatures). But there is another problem. Become won't work between variable structures of different sizes because there identity hashes would be different (you can no longer substitute one hash for the other). One solution to this problem is to simply declare that variable structures don't have identity, ie. they can't be put into identity hash tables nor can they be compared using == (only =). Another solution is to change the proposed object format by either adding a third header word for variable structures containing the identity hash, or to narrow the size (n), so the first header word encodes 3 fields instead of 2, ie. the size, the identity hash, and flag bits for gc (and immutable, etc. if desired) and a flag to indicate if the variable structure is so large that its size is stored in a third header word. I like this last solution. So to recap here is my complete object format proposal #2: -8 n if large otherwise this field does not exist -4 identityHash, gc flags, isOops flag, isLarge flag, n if small 0 class oop 4 (for class objects only) primitive type, isBytes & isWeak flags, m .. n primitive type is Code (00), Data (01), Array (10), or Tuple (11). isOops is 1 for Arrays and Tuples, and 0 for Code and Data (redundant with primitive type in class but might make garbage collection faster). m is number of fixed fields for Arrays and Tuples, m = n for Tuples. This proposal is actually not much different from the current format. The difference is replacing object format with isOops, replacing header type with isLarge, and removing the compact class index as already suggested. Cheers, Anthony __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html |