<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><br><div><br><br><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div>On Feb 23, 2016, at 6:48 PM, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-02-24 1:35 GMT+01:00 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1696.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1696.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-eem.1696<br>
Author: eem<br>
Time: 23 February 2016, 4:35:02.71435 pm<br>
UUID: 4db47df6-c329-44ca-a255-7483a9cac28f<br>
Ancestors: VMMaker.oscog-tfel.1695<br>
<br>
Fix serious bug in jitted perform: primitive. Thanks to Stéphane Ducasse for finding and to Levente Uzoni for diagnosing </blockquote><div><br></div><div>Rendons à Stéphane Rollandin ce qui n'est pas à César...<br></div></div></div></div></div></blockquote><div><br></div>Pardonnez moi! Je suis desole!<div><br></div><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">the bug. If the argument count is one greater than the max number of register aerguments (2 in Spur, hence perform:with:with:) then the code to remove the receiver and arguments from the stack forgot to remove the receiver and selector.<br>
<br>
=============== Diff against VMMaker.oscog-tfel.1695 ===============<br>
<br>
Item was changed:<br>
----- Method: StackToRegisterMappingCogit>>adjustArgumentsForPerform: (in category 'primitive generators') -----<br>
adjustArgumentsForPerform: numArgs<br>
"Generate code to adjust the possibly stacked arguments immediately<br>
before jumping to a method looked up by a perform primitive."<br>
self assert: self numRegArgs <= 2.<br>
self assert: numArgs >= 1.<br>
numArgs <= self numRegArgs ifTrue:<br>
[numArgs = 2 ifTrue:<br>
[self MoveR: Arg1Reg R: Arg0Reg].<br>
^self].<br>
<br>
+ "If the arity is one more than the max numRegArgs, the receiver and all arguments have to be removed from the stack."<br>
self numRegArgs + 1 = numArgs ifTrue:<br>
[backEnd hasLinkRegister<br>
ifTrue:<br>
+ [self numRegArgs = 2<br>
+ ifTrue:<br>
+ [self MoveMw: 0 r: SPReg R: Arg1Reg.<br>
+ self MoveMw: objectMemory wordSize r: SPReg R: Arg0Reg]<br>
+ ifFalse:<br>
+ [self MoveMw: 0 r: SPReg R: Arg0Reg].<br>
+ self AddCq: numArgs + 1 * objectMemory wordSize R: SPReg]<br>
- [self numRegArgs = 2 ifTrue:<br>
- [self PopR: Arg1Reg].<br>
- self PopR: Arg0Reg]<br>
ifFalse:<br>
+ [self MoveMw: 0 r: SPReg R: TempReg. "save retpc"<br>
+ self numRegArgs = 2<br>
+ ifTrue:<br>
+ [self MoveMw: objectMemory wordSize r: SPReg R: Arg1Reg.<br>
+ self MoveMw: objectMemory wordSize * 2 r: SPReg R: Arg0Reg]<br>
+ ifFalse:<br>
+ [self MoveMw: objectMemory wordSize r: SPReg R: Arg0Reg].<br>
+ self AddCq: numArgs + 1 * objectMemory wordSize R: SPReg.<br>
+ self MoveR: TempReg Mw: 0 r: SPReg "Overwrite pushed receiver; ReceiverResultReg already contains receiver."].<br>
- [self PopR: TempReg. "save retpc"<br>
- self numRegArgs = 2 ifTrue:<br>
- [self PopR: Arg1Reg].<br>
- self MoveMw: 0 r: SPReg R: Arg0Reg.<br>
- self MoveR: TempReg Mw: 0 r: SPReg].<br>
^self].<br>
<br>
"e.g. Receiver Receiver<br>
Selector/Arg0 => Arg1<br>
Arg1 Arg2<br>
Arg2 sp-> Arg3<br>
sp-> Arg3"<br>
super adjustArgumentsForPerform: numArgs!<br>
<br>
</blockquote></div><br></div></div>
</div></blockquote></div></body></html>