Hi Eliot. I am not sure if you are interested in completly support SmallInteger as methods. If not, please let me know and I don't bather again.<br><br>I was trying them in Cog, and I have a crash in primitiveFlushCacheByMethod() when it calls primitiveIndexOf:<br>
because <br><br>primitiveIndexOf: methodPointer<br> "Note: We now have 10 bits of primitive index, but they are in two places<br> for temporary backward compatibility. The time to unpack is negligible,<br> since the derived primitive function pointer is stored in the method cache."<br>
<api><br> | primBits |<br> primBits := ((self headerOf: methodPointer) >> 1) bitAnd: 16r100001FF.<br> ^(primBits bitAnd: 16r1FF) + (primBits >> 19)<br><br><br><br>But....."methodPointer" can be a Smallnteger...so headerOf: fails, because rawHeaderOf: fails because it does a "objectMemory fetchPointer: HeaderIndex ofObject: methodPointer"<br>
which send ObjectMemory >> fetchPointer: fieldIndex ofObject: oop<br>which does the final "self longAt: oop + BaseHeaderSize + (fieldIndex << ShiftForWord)"<br><br>ok, you got it ;)<br><br>Now....do you consider this a bug? how could I fix it ?<br>
<br>Thanks<br><br>Mariano<br>