<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div> I got compile errors when setting <inline: true> in a method I created.</div><div> The errors where a label redefinition such as:</div><div><div>../../spurstack64src/vm/gcc3x-interp.c:4790:2: error: redefinition of label 'l35'</div><div>        l35:    /* end classAtIndex: */;</div><div>        ^</div><div>../../spurstack64src/vm/gcc3x-interp.c:4634:2: note: previous definition is here</div><div>        l35:    /* end classAtIndex: */;</div><div>        ^</div><div><br></div><div> After some research I concluded that the problem was at SpurMemoryManager>>#classAtIndex: due to how it returns:</div><div>...</div><div><div><span style="white-space:pre">    </span>classTablePage = nilObj ifTrue:</div><div><span style="white-space:pre">               </span>[^nil].</div><div><span style="white-space:pre">       </span>^self</div><div><span style="white-space:pre">         </span>fetchPointer: (classIndex bitAnd: self classTableMinorIndexMask)</div><div><span style="white-space:pre">              </span>ofObject: classTablePage</div></div><div><br></div><div> I think the source code generator does not support correctly returning at different points when inlining the same method more than once. </div><div> So I changed that implementation to:</div><div>...</div><div><div><span style="white-space:pre">    </span>^classTablePage = nilObj </div><div><span style="white-space:pre">            </span>ifTrue: [nil]</div><div><span style="white-space:pre">         </span>ifFalse: [ self</div><div><span style="white-space:pre">                       </span>fetchPointer: (classIndex bitAnd: self classTableMinorIndexMask)</div><div><span style="white-space:pre">                      </span>ofObject: classTablePage ]</div></div><div><div><br></div></div><div> Doing so the compile errors were gone and the VM keeps working correctly.</div><div> Is this fix correct or does it have some performance hit I do not know?</div><div> Should I inform about this change with a PR? (Sorry about this question but I'm new to this vm stuff :-) )</div><div><br></div><div> Here is the complete code of the method:</div><div><div>classAtIndex: classIndex</div><div><span style="white-space:pre">   </span><api></div><div><span style="white-space:pre">   </span><inline: true></div><div><span style="white-space:pre">  </span>| classTablePage |</div><div><span style="white-space:pre">    </span>self assert: (classIndex >= 0 and: [classIndex <= self tagMask or: [classIndex >= self arrayClassIndexPun and: [classIndex <= self classIndexMask]]]).</div><div><span style="white-space:pre">    </span>classTablePage := self fetchPointer: classIndex >> self classTableMajorIndexShift</div><div><span style="white-space:pre">                                                       </span>ofObject: hiddenRootsObj.</div><div><span style="white-space:pre">     </span>^classTablePage = nilObj </div><div><span style="white-space:pre">            </span>ifTrue: [nil]</div><div><span style="white-space:pre">         </span>ifFalse: [ self</div><div><span style="white-space:pre">                       </span>fetchPointer: (classIndex bitAnd: self classTableMinorIndexMask)</div><div><span style="white-space:pre">                      </span>ofObject: classTablePage ]</div></div><div><br></div><div> Cheers!</div><div> Hernan.</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></div></div></div>