show bytecodes?

tim Rowledge tim at rowledge.org
Sat Oct 13 21:52:53 UTC 2007


On 13-Oct-07, at 2:02 PM, Robert Withers wrote:

> Ok, this gets me into the CompiledMethod, with which I have very  
> little experience.  I did find that the 'source' toggle button in a  
> browser has a bytecodes option.  It didn't help me much, seeing the  
> bytecodes.  I am trying to find a way to invoke a bytecode  
> primitive from the image.

Why?

> So, for instance, given 2 SmallIntegers in hand, I want to run  
> bytecodePrimAdd without running #+.

Err, given a bytecode named 'bytecodePrimAdd' what would you expect  
it to do? Why, it runs the same code that primitiveAdd does, modulo  
the bytecode version knowing that it will be inlined into the big  
bytecode loop. And oddly enough, that very fact means that if you  
*did* manage to invoke it by some devious magic, it would cause some  
interesting issue because you'd be affecting the in-loop values of  
stack pointer etc, which could cause all sorts of fun.

> Is there a way to do this?  I am digging through  
> #lookupInMethodCacheSel:class: at the moment to see how primitive  
> dispatch works.
Why? What on earth are you doing? Message sending is designed to be  
atomic and trying to insert yourself in the middle is likely to go  
boom. You really are in danger of branching to the Halt and Catch  
Fire instruction...

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
I came, I saw, I deleted all your files.





More information about the Squeak-dev mailing list