Hi guys. I am migrating some old stuff I have about tracing object usage to the latest version of Cog. I have in StackInterpreter a method which looks like this:<br><br>traceObjectUsage: anOop<br> ((self isIntegerObject: anOop) not and: [hasToTrace])<br>
ifTrue: [ <br> objectMemory setExperimentalBitOf: anOop to: true.<br> ]<br><br>So I have also added #setExperimentalBitOf:to: to ObjectMemory, and I have added the instVar 'hasToTrace' to the StackInterpreter. So now from some methods of StackInterpreter, I add sends to this method to trace OOPs. This is working fine, but there is one particular method where I cannot do it. The method is #lookupInMethodCacheSel:class: and I am trying to do something like:<br>
<br>lookupInMethodCacheSel: selector class: class<br> "This method ....."<br><br> | hash probe rcvr |<br> <inline: true><br> <asmLabel: false><br> <span style="background-color:rgb(255,255,0)"> self traceObjectUsage: class.</span><br>
<span style="background-color:rgb(255,255,0)"> rcvr := self internalStackValue: argumentCount.</span><br style="background-color:rgb(255,255,0)"><span style="background-color:rgb(255,255,0)"> self traceObjectUsage: rcvr.</span><br>
hash := selector bitXor: class. "shift drops two low-order zeros from addresses"<br> .......<br><br>In this particular method, the problem is with the two lines:<br> <span style="background-color:rgb(255,255,0)"> rcvr := self internalStackValue: argumentCount.</span><br style="background-color:rgb(255,255,0)">
<span style="background-color:rgb(255,255,0)"> self traceObjectUsage: rcvr.</span><br>
<br>If I DO NOT put those two lines, then it compiles perfect. If I put those lines, I have a compilation error:<br><br>Undefined symbols:<br> "_lookupInMethodCacheSelclass", referenced from:<br> _lookupreceiver in gcc3x-cointerpmt.c.o<br>
_handleMNUInMachineCodeToclassForMessage in gcc3x-cointerpmt.c.o<br> _ceSendsupertonumArgs in gcc3x-cointerpmt.c.o<br> _ceSendFromInLineCacheMiss in gcc3x-cointerpmt.c.o<br> _ceSendAborttonumArgs in gcc3x-cointerpmt.c.o<br>
_interpret in gcc3x-cointerpmt.c.o<br> _interpret in gcc3x-cointerpmt.c.o<br> _sendInvokeCallbackStackRegistersJmpbuf in gcc3x-cointerpmt.c.o<br> _sendInvokeCallbackContext in gcc3x-cointerpmt.c.o<br>
"_findNewMethodInClass", referenced from:<br> _primitivePerform in gcc3x-cointerpmt.c.o<br> _primitiveObjectperformwithArgumentslookedUpIn in gcc3x-cointerpmt.c.o<br> _primitiveInvokeObjectAsMethod in gcc3x-cointerpmt.c.o<br>
ld: symbol(s) not found<br>collect2: ld returned 1 exit status<br>make[2]: *** [/Users/mariano/Pharo/VM/git/cogVMBlessedSSH/blessed/results/CogMTVM.app/Contents/MacOS/CogMTVM] Error 1<br>make[1]: *** [CMakeFiles/CogMTVM.dir/all] Error 2<br>
make: *** [all] Error 2<br><br><br>Moreover, when I ADD those lines, apart from the make error, when translating from SLANG to C, if I open a Transcript I see these "suspicious" lines:<br><br>Removed findNewMethodInClass: because it refers to the local variable localSP of interpret.<br>
But it is either used outside of interpret or exported!!<br>Removed lookupInMethodCacheSel:class: because it refers to the local variable localSP of interpret.<br>But it is either used outside of interpret or exported!!<br>
<br>BUT, none of those methods access localSP. <br><br>Any idea of what can be wrong?<br><br>Thanks in advance,<br><br><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
<br>