<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div> In the implementation of the dynamically typed vm I'm doing (to give it a name) I need to get the parameters when a method gets activated.</div><div> To do it I implemented a not-inlined method that sends the message #internalStackValue: </div><div> The problem is that the code for that method is not generated. The method gets removed from the methods to generate code because it access "localSP" although not directly but due to inlining #internalStackValue:</div><div> </div><div> How should I access the arguments then? Why I can not use "localSP"?</div><div><br></div><div> The method source is:</div><div><div>keepArgumentTypes<br></div><div><br></div><div><span style="white-space:pre">    </span><inline: false></div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre">      </span>| additionalMethodState tempVarsTypes |</div><div><span style="white-space:pre">       </span></div><div><span style="white-space:pre">      </span>additionalMethodState := self additionalMethodStateOf: newMethod.</div><div><span style="white-space:pre">     </span>additionalMethodState = objectMemory nilObject ifTrue: [ ^self ].</div><div><span style="white-space:pre">     </span>tempVarsTypes := objectMemory followObjField: 2 ofObject: additionalMethodState.</div><div><span style="white-space:pre">      </span>tempVarsTypes = objectMemory nilObject ifTrue: [ ^self ].</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>0 to: argumentCount-1 do: [ :argIndex | </div><div><span style="white-space:pre">             </span>self keepTypeInformationIn: tempVarsTypes at: argIndex for: (self internalStackValue: argIndex) ].</div><div><span style="white-space:pre">    </span></div></div><div> I manage to solve the problem passing localSP as parameter and doing the following, but I should not be doing that:</div><div><div>keepArgumentTypes: sp</div><div><br></div><div><span style="white-space:pre">      </span><inline: false></div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre">      </span>| additionalMethodState tempVarsTypes |</div><div><span style="white-space:pre">       </span></div><div><span style="white-space:pre">      </span>additionalMethodState := self additionalMethodStateOf: newMethod.</div><div><span style="white-space:pre">     </span>additionalMethodState = objectMemory nilObject ifTrue: [ ^self ].</div><div><span style="white-space:pre">     </span>tempVarsTypes := objectMemory followObjField: 2 ofObject: additionalMethodState.</div><div><span style="white-space:pre">      </span>tempVarsTypes = objectMemory nilObject ifTrue: [ ^self ].</div><div><span style="white-space:pre">     </span></div><div><span style="white-space:pre">      </span>0 to: argumentCount-1 do: [ :argIndex | </div><div><span style="white-space:pre">             </span>self keepTypeInformationIn: tempVarsTypes at: argIndex for: (stackPages longAtPointer: sp + (argIndex * objectMemory bytesPerOop)) ].</div><div><span style="white-space:pre"> </span></div></div><div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div><div><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>