Whilst getting back to generating sources to make the stack vm for Pi, I stumbled across this problem; during VMMaker>generateInterpreterFile the #buildCodeGeneratorForInterpreter method did not result in initBytesPerWord: running. Thus when actually generating code for ObjectMemory>byteSwapped: which uses Byte3ShiftNegated we get a dNu because Byte3ShiftNegated is actually nil.
It's a bit of a rat's nest in there these days so following the code is a bit tricky. In the debugger at VMMaker>generateInterpreterFile I did a restart and went to trace things but it then actually did the job perfectly. Weird. Anybody else been bitten?
I'm using VMMaker.oscog-tpr.301
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do
On 04-07-2013, at 5:01 PM, tim Rowledge tim@rowledge.org wrote:
Whilst getting back to generating sources to make the stack vm for Pi, I stumbled across this problem; during VMMaker>generateInterpreterFile the #buildCodeGeneratorForInterpreter method did not result in initBytesPerWord: running. Thus when actually generating code for ObjectMemory>byteSwapped: which uses Byte3ShiftNegated we get a dNu because Byte3ShiftNegated is actually nil.
Oh, of course if you save the image after doing it right once, it now has the class vars all set up and will be happy. That makes it a bit more fun to work out.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: MTP: MounT Programmer
On Thu, Jul 04, 2013 at 05:01:46PM -0700, tim Rowledge wrote:
Whilst getting back to generating sources to make the stack vm for Pi, I stumbled across this problem; during VMMaker>generateInterpreterFile the #buildCodeGeneratorForInterpreter method did not result in initBytesPerWord: running. Thus when actually generating code for ObjectMemory>byteSwapped: which uses Byte3ShiftNegated we get a dNu because Byte3ShiftNegated is actually nil.
It's a bit of a rat's nest in there these days so following the code is a bit tricky. In the debugger at VMMaker>generateInterpreterFile I did a restart and went to trace things but it then actually did the job perfectly. Weird. Anybody else been bitten?
I'm using VMMaker.oscog-tpr.301
ObjectMemory class>>initBytesPerWord: is obsolete in VMM trunk. I have not encountered the error you describe in the oscog branch, but I would expect that if you reinitialize the ObjectMemory et al, then all will be well. Many of the VMM class constants have been moved into pool variables, and I have occasionally seen issues with these not being initialized properly, so maybe you are seeing that sort of problem.
Dave
On 04-07-2013, at 7:15 PM, "David T. Lewis" lewis@mail.msen.com wrote:
On Thu, Jul 04, 2013 at 05:01:46PM -0700, tim Rowledge wrote:
Whilst getting back to generating sources to make the stack vm for Pi, I stumbled across this problem; during VMMaker>generateInterpreterFile the #buildCodeGeneratorForInterpreter method did not result in initBytesPerWord: running. Thus when actually generating code for ObjectMemory>byteSwapped: which uses Byte3ShiftNegated we get a dNu because Byte3ShiftNegated is actually nil.
It's a bit of a rat's nest in there these days so following the code is a bit tricky. In the debugger at VMMaker>generateInterpreterFile I did a restart and went to trace things but it then actually did the job perfectly. Weird. Anybody else been bitten?
I'm using VMMaker.oscog-tpr.301
ObjectMemory class>>initBytesPerWord: is obsolete in VMM trunk. I have not encountered the error you describe in the oscog branch, but I would expect that if you reinitialize the ObjectMemory et al, then all will be well.
The weird part is that the initBytesPerWord: appears to be called correctly the first time but still leaves those values undefined. When I restart and proceed from the buildCodeGenerator… it goes ok.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Useful random insult:- One sandwich short of a picnic.
vm-dev@lists.squeakfoundation.org