One bytecode missing in initializePushConstantBytecodeTable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

One bytecode missing in initializePushConstantBytecodeTable

André Wendt-3
 
Hello everybody,

is there any reason for pushConstantTrueBytecode to be missing from
Interpreter class>>#initializePushConstantBytecodeTable ? There's only
seven instead of eight values in the table.

BTW, this is on 3.9, I didn't check 3.10.

Regards,
André
Reply | Threaded
Open this post in threaded view
|

Re: One bytecode missing in initializePushConstantBytecodeTable

timrowledge


On 8-Apr-08, at 1:02 PM, André Wendt wrote:

>
> Hello everybody,
>
> is there any reason for pushConstantTrueBytecode to be missing from
> Interpreter class>>#initializePushConstantBytecodeTable ? There's only
> seven instead of eight values in the table.

What? Where did this method come from? It's not in the One True  
Official VM Making Image on my machine. I have
initializeBytecodeTable
        "Interpreter initializeBytecodeTable"
        "Note: This table will be used to generate a C switch statement."

        BytecodeTable := Array new: 256.
        self table: BytecodeTable from:
        #(
                (  0  15 pushReceiverVariableBytecode)
                ( 16  31 pushTemporaryVariableBytecode)
                ( 32  63 pushLiteralConstantBytecode)
                ( 64  95 pushLiteralVariableBytecode)
                ( 96 103 storeAndPopReceiverVariableBytecode)
                (104 111 storeAndPopTemporaryVariableBytecode)
                (112 pushReceiverBytecode)
                (113 pushConstantTrueBytecode)
                (114 pushConstantFalseBytecode)
                (115 pushConstantNilBytecode)
                (116 pushConstantMinusOneBytecode)
                (117 pushConstantZeroBytecode)
                (118 pushConstantOneBytecode)
                (119 pushConstantTwoBytecode)
                (120 returnReceiver)
                (121 returnTrue)
                (122 returnFalse)
                (123 returnNil)
                (124 returnTopFromMethod)
                (125 returnTopFromBlock)
                (126 unknownBytecode)
                (127 unknownBytecode)
                (128 extendedPushBytecode)
                (129 extendedStoreBytecode)
                (130 extendedStoreAndPopBytecode)
                (131 singleExtendedSendBytecode)
                (132 doubleExtendedDoAnythingBytecode)
                (133 singleExtendedSuperBytecode)
                (134 secondExtendedSendBytecode)
                (135 popStackBytecode)
                (136 duplicateTopBytecode)
                (137 pushActiveContextBytecode)
                (138 143 experimentalBytecode)
                (144 151 shortUnconditionalJump)
                (152 159 shortConditionalJump)
                (160 167 longUnconditionalJump)
                (168 171 longJumpIfTrue)
                (172 175 longJumpIfFalse)

                "176-191 were sendArithmeticSelectorBytecode"
                (176 bytecodePrimAdd)
                (177 bytecodePrimSubtract)
                (178 bytecodePrimLessThan)
                (179 bytecodePrimGreaterThan)
                (180 bytecodePrimLessOrEqual)
                (181 bytecodePrimGreaterOrEqual)
                (182 bytecodePrimEqual)
                (183 bytecodePrimNotEqual)
                (184 bytecodePrimMultiply)
                (185 bytecodePrimDivide)
                (186 bytecodePrimMod)
                (187 bytecodePrimMakePoint)
                (188 bytecodePrimBitShift)
                (189 bytecodePrimDiv)
                (190 bytecodePrimBitAnd)
                (191 bytecodePrimBitOr)

                "192-207 were sendCommonSelectorBytecode"
                (192 bytecodePrimAt)
                (193 bytecodePrimAtPut)
                (194 bytecodePrimSize)
                (195 bytecodePrimNext)
                (196 bytecodePrimNextPut)
                (197 bytecodePrimAtEnd)
                (198 bytecodePrimEquivalent)
                (199 bytecodePrimClass)
                (200 bytecodePrimBlockCopy)
                (201 bytecodePrimValue)
                (202 bytecodePrimValueWithArg)
                (203 bytecodePrimDo)
                (204 bytecodePrimNew)
                (205 bytecodePrimNewWithArg)
                (206 bytecodePrimPointX)
                (207 bytecodePrimPointY)

                (208 255 sendLiteralSelectorBytecode)
        ).

... which as you can see includes pushConstantTrueBytecode.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: SG: Show Garbage


Reply | Threaded
Open this post in threaded view
|

Re: One bytecode missing in initializePushConstantBytecodeTable

André Wendt-3
In reply to this post by André Wendt-3
 
tim Rowledge wrote:

>
>
> On 8-Apr-08, at 1:02 PM, André Wendt wrote:
>
>>
>> Hello everybody,
>>
>> is there any reason for pushConstantTrueBytecode to be missing from
>> Interpreter class>>#initializePushConstantBytecodeTable ? There's only
>> seven instead of eight values in the table.
>
> What? Where did this method come from? It's not in the One True Official
> VM Making Image on my machine.

OK, I feel *very* stupid: I wrote the method myself some time ago. I
promise to check the method versions before posting questions like this!

It's things like this why some day people won't help me anymore... Does
"it was late and I couldn't think clearly" count as an excuse? ;-)

Best,
André