?

Log in

No account? Create an account
Pete Zaitcev's Journal -- Day [entries|friends|calendar]
Pete Zaitcev

[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

I'm a Mozilla developer. No, really! [12 Dec 2004|01:05pm]
Chris Aillon asked me to help with the IBM Mainframe assembly. It turned out that Mozilla must have assembly inserts for every platform it supports, and those for s390 were bad (see bug moz#272369). It was rather entertaining. There were a few problems with the code, the biggest was that an assembly function was not forming a new stack frame when calling C code, but also a few problems related to inline assembly and register reuse/allocation with GCC.

The patch I came up with was buggy. In one place, it used 'subtract' instruction instead of intented 'store', for example. Ulrich Weigand looked at it and rejected it. Then he went on to "fix" the assembly his way, which was basically to fiddle with clobbers while leaving stack frames overlapping and corrupting each other.

The resulting code works, because the fixed size stack frames on s390 contain a lot of unused space, and so they overlap in such a way that nothing of significance gets actually corrupted. As long as method has only a small number of arguments, that is. I explained the problem to Ulrich, but he was unfazed.

I thought about raising the issue, but I don't have the desire to argue. Mozilla works, right? Or, to be more precise, passes -register. So, whatever! Who cares about s390 anyway. Just make sure your Javascript methods do not have more than 5 arguments.
post comment

navigation
[ viewing | December 12th, 2004 ]
[ go | previous day|next day ]