Hello,
As some of you may know, Pharo is being enhanced with support for multiple bytecode sets. This will allow to run at the same time compiled methods with 2 different bytecode sets for experimentation and to add easily the new bytecode set described in
this ESUG paper.
The virtual machine knows which bytecode set the compiled method uses for its encoding based on the sign of its header. This means that on the contrary to right now, a compiled method *can* have a negative header.
The issue is that typically operations such as #bitAnd: or #+ to access bits of the smallinteger does not work the same way on negative integers (2 complement's implementation of integers), resulting in incorrect values. I am fixing the problematic cases in Pharo.
One case is in Fuel and I can't fix it myself. It's in:
FLCompiledMethodCluster>>#serializeInstance: aCompiledMethodToSerialize with: anEncoder
"some code"
header := aCompiledMethod header.
"some code"
anEncoder encodeUint32: header
"some code"
This looks problematic because now header is not a uint anymore but a sint.
In addition, #encodeUint32: uses #bitAnd: which may work differently on negative integers.
What do you fuel experts think ? Is there anything to fix there ?