[Vm-dev] Problem changing primitiveBitOr or primitiveBitAnd
Mariano Martinez Peck
marianopeck at gmail.com
Thu Oct 7 07:39:40 UTC 2010
Hi, I want to change #primitiveBitOr or #primitiveBitAnd and in both cases,
I compile the VM, I run an image, and the image cannot even start and CPU
100% :(
I have a loop somewhere.
This is the current implementation of #primitiveBitOr for example:
primitiveBitOr
| integerReceiver integerArgument |
integerArgument := self popPos32BitInteger.
integerReceiver := self popPos32BitInteger.
successFlag
ifTrue: [self push: (self positive32BitIntegerFor:
(integerReceiver bitOr: integerArgument))]
ifFalse: [self unPop: 2]
I NEED to have the receiver oop and the argument oop. So, I've change it to:
primitiveBitOr
| integerReceiver integerArgument arg rcvr |
arg := self popStack.
integerArgument := self positive32BitValueOf: arg.
rcvr := self popStack.
integerReceiver := self positive32BitValueOf: rcvr.
successFlag
ifTrue: [
self push: (self positive32BitIntegerFor:
(integerReceiver bitOr: integerArgument))]
ifFalse: [self unPop: 2]
And then to:
primitiveBitOr
| integerReceiver integerArgument arg rcvr |
arg := self stackValue: 0.
integerArgument := self positive32BitValueOf: arg.
rcvr := self stackValue: 1.
integerReceiver := self positive32BitValueOf: rcvr.
successFlag
ifTrue: [
self push: (self positive32BitIntegerFor:
(integerReceiver bitOr: integerArgument))]
ifFalse: [self unPop: 2]
But in both cases, while trying to start an image, I have cpu 100%
Of course, the same happens if I do this in #primitiveBitAnd
Any ideas what can be happening? because I tried to understand but nothing
:(
Thanks in advance
Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101007/8c823fd4/attachment-0001.htm
More information about the Vm-dev
mailing list