Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: [Mops] ^base in inline methods



Mike,

I would have absolutely no problem with being limited to one ^base as
described.  Especially since you can give an error so it all then becomes
pretty much fooolproof.

My .02

-Doug

> From: Mike Hore <[EMAIL PROTECTED]>
> Newsgroups: comp.lang.forth.mac
> Date: Mon, 10 Nov 2003 21:58:38 GMT
> Subject: [Mops] ^base in inline methods
> 
> Hi folks,
> 
> I'm just working through the to-do list before getting the
> new Mops release ready (5.4).
> 
> I decided to add methods and: or: xor: to classes var, int and
> byte, and implementing them the obvious way, e.g.
> 
> :m and:  inline{ ^base @ and ^base !} ;m
> 
> didn't work!  There was a lurking issue with using ^base more
> than once, in that the code generation thought it was finished
> with the register after the first time, and re-used the
> same register which meant that the second time, unrelated
> junk was accessed.
> 
> I worked out a fix, but it would mean that in EVERY use
> of ^base in inline methods, the code generator would
> conservatively hang on to the register till the end of the
> method -- hardly a problem, but it doesn't give optimum
> code in the more usual case where we use ^base only once --
> one unnecessary instruction, would you believe!!
> 
> Still, inline methods are for speed, so plan B would be to
> give an error if you use ^base more than once in an inline
> method.  You can do DUPs and TUCKs and the resulting code
> would still be optimum.
> 
> Any reactions?  Would a limitation of only one use per
> inline method break anyone's code?
> 
> (Of course in the meantime I might figure out a proper
> fix to this problem, but I thought I'd bounce this off the
> group first.)
> 
> Cheers,  Mike.
> 
> 
> ----------------------------------------------------------------
> Mike Hore      [EMAIL PROTECTED]
> (sorry about munged email address, but you should be able to
> figure it out)
> ----------------------------------------------------------------
> 
> 
> 




<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.