[M3devel] frame per procedure instead of frame per TRY?

Jay K jay.krell at cornell.edu
Sun Jul 19 11:10:53 CEST 2015


I'm pretty sure it can work, but you need also a local "dense" volatile integer that describes where in the function you are.  That isn't free, but it is much cheaper than calling setjmp/PushFrame for each try.

Try writing similar C++ for NT/x86 and look at what you get."PushFrame" is highly optimized to build a linked list through fs:0.And even that is only done at most once per function.

Java VM also specifies scope tables with a similar intent.

The key is figuring out the algorithm to assign the scope ids, and computing and interpreting the resulting tables. It is a little tricky.

 - Jay


Date: Sun, 19 Jul 2015 10:57:11 +0200
From: estellnb at elstel.org
To: jay.krell at cornell.edu; m3devel at elegosoft.com
Subject: Re: [M3devel] frame per procedure instead of frame per TRY?


  
    
  
  
    

    Am 2015-07-18 um 13:05 schrieb Jay K:

    
    
      
      
        

        
        However, has anyone considered a form that does use setjmp
          but
        uses at most one frame per procedure, instead of a frame
          per TRY?
      
    
    

    I don`t think that this will work for the general case.

    Consider a try - except in the middle of a code block.

    If you leave it, it needs to continue after the END of

    the TRY-EXCEPT and not after the END of the 

    procedure.

    

    What you can do is re-use the same jumpbuf-frame

    for a nested try-finally and try - except :

    

     TRY

        TRY

          ...

         EXCEPT

          ...

         END;

      FINALLY

        ...

      END;

    

    or simply

    

      TRY

        ....

      EXCEPT

        ....

      FINALLY

       ...

      END;

    

    I can remember having once implemented the latter for PM3.

    However I am no more sure about the intrinsics...

    

    

    

    

  


_______________________________________________
M3devel mailing list
M3devel at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150719/c2b31d95/attachment-0002.html>


More information about the M3devel mailing list