Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /dev-notes/primop-list.md
ViewVC logotype

Diff of /dev-notes/primop-list.md

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4885, Wed Oct 10 15:10:01 2018 UTC revision 4888, Wed Oct 10 18:18:19 2018 UTC
# Line 122  Line 122 
122    * `setvar : 'a -> unit`<br/>    * `setvar : 'a -> unit`<br/>
123      `P.SETVAR`      `P.SETVAR`
124    
   * `setpseudo : 'a * int -> unit`<br/>  
     `P.SETPSEUDO`  
   
   * `getpseudo : int -> 'a`<br/>  
     `P.GETPSEUDO`  
   
125    * `mkspecial : int * 'a -> 'b`<br/>    * `mkspecial : int * 'a -> 'b`<br/>
126      `P.MKSPECIAL`      `P.MKSPECIAL`
127    
# Line 146  Line 140 
140    * `gettag : 'a -> int`<br/>    * `gettag : 'a -> int`<br/>
141      `P.GETTAG`      `P.GETTAG`
142    
143    * `setmark : 'a -> unit`<br/>    * `objlength : 'a -> int`<br/>
144      `P.SETMARK`      extracts the length field from an object's header word.
145        `P.OBJLENGTH`
   * `dispose : 'a -> unit`<br/>  
     `P.DISPOSE`  
146    
147    
148  #### Inline operations  #### Inline operations
149    These primops are Basis Library functions that should be inlined for efficiency.
150    * `compose : ('b -> 'c) * ('a -> 'b) -> 'a -> 'c`<br/>    * `compose : ('b -> 'c) * ('a -> 'b) -> 'a -> 'c`<br/>
151      `P.INLCOMPOSE`      `P.INLCOMPOSE`
152    
# Line 166  Line 159 
159    * `identity : 'a -> 'a`<br/>    * `identity : 'a -> 'a`<br/>
160      `P.INLIDENTITY`      `P.INLIDENTITY`
161    
   * `objlength : 'a -> int`<br/>  
     extracts the length field from an object's header word.  
     `P.OBJLENGTH`  
   
162    * `bool_not : bool -> bool`<br/>    * `bool_not : bool -> bool`<br/>
163      `P.INLNOT`      `P.INLNOT`
164    
165    Some additional candidates for inlined operations include `hd`, `tl`, `null`, `chr`, and `ord`.
166    If the compiler had the `option` and `order` datatypes builtin (like `bool` and `list`),
167    then `valOf`, `isSome`, `isNone` and some of the `compare` functions could be inlined.
168    
169    
170  #### Bytearray and bytevector operations  #### Bytearray and bytevector operations
171  Operations on byte/char array/vectors.  We renamed these to make it clear  Operations on byte/char array/vectors.  We renamed these to make it clear

Legend:
Removed from v.4885  
changed lines
  Added in v.4888

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0