lawrence@chorus.fr (Lawrence Albinson) (04/03/91)
I just spent the Easter weekend porting the SRC Modula-3 (v1.6) system to the Acorn R140 workstation. I started from the R260 release, and from a v1.5 system that I had been playing with, on and off, for some time. The R140 has just 4Mb of memory and when running RISC iX 1.21 this leaves just 3Mb for userland. I found a number of ways to reduce the code size of the compiler and to improve its throughput. I would appreciate comments on the wisdom, or stupidity, of the various measures I took. They were: 1 Turned off ASSERT checking. I imagine this is a bad idea, but I have the release version of the compiler to hand should I suspect this to be a problem. 2 Simplified NILCHECK macros to just evaluate their arguments. Again, I imagine this is a bad idea in principle. Ditto my comment in 1 above. 3 Turned off versions stamp generation. 4 Added an option to control the generation of the CHECKSTACKOVERFLOW macro. I assume this is safe in a single threaded program. Besides, the ARM procedure call standard has support for multi-threaded stacks, and the C compiler knows about it. I might get round to using this feature at some time. 5 Added an option to control the generation of the PrintProc's. 6 Added code to more aggressively eliminate generation of unused MapProc's. 7 Simplified the ZERO1 macro to take just a variable name, and modified the compiler to leave out the &. This is because the ARM C compiler spots define before define chains in the case of: _z = 0; _z = exp; but not in the case of: *(int *)&_z = 0; _z = exp; Also collapsed all the bigger ZERO macros into bzero calls. The net result of the above changes was to reduce the compiler from a static size of 1.8Mb to 1.3Mb. This made the difference between heavy paging and barely paging at all for most compilations. The command 'time m3 -D../Interfaces -C SetExpr.m3' gave 34.4u 4.7s 1:12 54% for the release version and 19.9u 2.1s 0:30 72% for the modified version. I have no feel for the actual level of interest in the ARM version of SRC Modula-3. If there is interest, I will be more than happy to make my changes available. Finally, thanks to all of you at SRC and in the user community for doing such a good job. The system is a real treat to use. Keep up the good work. Lawrence Albinson