interfaces.scm 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey, Mike Sperber
  3. (define-interface utilities-interface
  4. (export bug
  5. user-error
  6. user-warning
  7. true false
  8. or-map
  9. remove-similar-elts
  10. select-from-table
  11. table->list table->entry-list
  12. table-push table-pop
  13. merge-lists
  14. vector-every?
  15. make-ignorable
  16. sub-vector->list
  17. flag-assq
  18. enforce
  19. writec
  20. mem?
  21. walk-vector
  22. vector-replace
  23. copy-list
  24. copy-vector
  25. string-hash
  26. char->ascii
  27. object-hash
  28. union intersection set-difference
  29. make-xvector xvector-length xvector-ref xvector-set! xvector->vector
  30. (define-subrecord :syntax)
  31. (define-subrecord-type :syntax)
  32. ;(define-simple-record-type :syntax)
  33. (define-local-syntax :syntax)
  34. ))
  35. (define-interface primop-interface
  36. (export primop? make-primop make-proc-primop make-conditional-primop
  37. all-primops get-primop
  38. primop-id primop-trivial? primop-side-effects
  39. primop-cost
  40. simplify-call
  41. primop-procedure? primop-call-index
  42. primop-conditional?
  43. expand-to-conditional
  44. simplify-conditional?
  45. primop-code-data set-primop-code-data!
  46. trivial-call-return-type
  47. (primop :syntax)
  48. ))
  49. (define-interface variable-interface
  50. (export variable? make-variable
  51. global-variable? make-global-variable
  52. variable-name set-variable-name!
  53. variable-id
  54. variable-type set-variable-type!
  55. variable-binder set-variable-binder!
  56. variable-refs set-variable-refs!
  57. variable-flag set-variable-flag!
  58. variable-flags set-variable-flags!
  59. variable-generate set-variable-generate!
  60. erase-variable
  61. variable-index copy-variable used? unused?
  62. variable-flag-accessor variable-flag-setter variable-flag-remover
  63. variable-known-value
  64. add-variable-known-value!
  65. remove-variable-known-value!
  66. variable-simplifier
  67. add-variable-simplifier!
  68. remove-variable-simplifier!
  69. note-known-global-lambda!
  70. variable-known-lambda
  71. ))
  72. (define-interface node-interface
  73. (compound-interface
  74. primop-interface
  75. variable-interface
  76. (export reset-node-id node-hash node-unhash
  77. node? node-variant
  78. node-parent set-node-parent!
  79. node-index set-node-index!
  80. node-simplified? set-node-simplified?!
  81. node-flag set-node-flag!
  82. empty empty? proclaim-empty
  83. erase
  84. detach detach-body
  85. attach attach-body
  86. move move-body
  87. insert-body
  88. replace replace-body
  89. connect-sequence
  90. mark-changed
  91. leaf-node?
  92. literal-node? make-literal-node
  93. literal-value set-literal-value!
  94. literal-type set-literal-type!
  95. copy-literal-node
  96. reference-node? make-reference-node
  97. reference-variable set-reference-variable!
  98. call-node? make-call-node
  99. call-primop set-call-primop!
  100. call-args set-call-args!
  101. call-exits set-call-exits!
  102. call-source set-call-source!
  103. call-arg call-arg-count
  104. lambda-node? make-lambda-node
  105. lambda-body set-lambda-body!
  106. lambda-variables set-lambda-variables!
  107. lambda-name set-lambda-name!
  108. lambda-id
  109. lambda-type
  110. lambda-block set-lambda-block!
  111. lambda-env set-lambda-env!
  112. lambda-protocol set-lambda-protocol!
  113. lambda-source set-lambda-source!
  114. lambda-variable-count
  115. calls-known? set-calls-known?!
  116. proc-lambda?
  117. initialize-lambdas add-lambda add-lambdas
  118. change-lambda-type
  119. walk-lambdas make-lambda-list
  120. loc/owner loc/type loc/rep
  121. set/owner set/type set/rep set/value
  122. node-base containing-procedure
  123. trivial? nontrivial?
  124. nontrivial-ancestor
  125. calls-this-primop?
  126. bound-to-variable
  127. walk-refs-safely
  128. small-node?
  129. side-effects?
  130. called-node? called-node
  131. called-lambda
  132. get-lambda-value
  133. ;set-reference?
  134. attach-call-args remove-call-args replace-call-args
  135. remove-null-arguments
  136. shorten-call-args insert-call-arg remove-call-arg
  137. append-call-arg
  138. remove-body
  139. put-in-letrec make-letrec
  140. remove-lambda-variable remove-variable remove-unused-variables
  141. substitute substitute-vars-in-node-tree
  142. replace-call-with-value
  143. copy-node-tree
  144. mark-ancestors marked-ancestor? unmarked-ancestor?
  145. node-ancestor? marked-ancestor least-common-ancestor
  146. proc-ancestor
  147. hoistable-node?
  148. find-scoping
  149. ((let-nodes new-lambda new-call) :syntax)
  150. node-equal?
  151. no-free-references?
  152. find-calls
  153. node-type
  154. the-undefined-value
  155. undefined-value?
  156. undefined-value-node?
  157. make-undefined-literal
  158. )))
  159. (define-interface simplify-internal-interface
  160. (export simplify-node
  161. default-simplifier
  162. simplify-arg
  163. simplify-args
  164. simplify-lambda-body
  165. simplify-known-lambda
  166. (pattern-simplifier :syntax)
  167. simplify-allocation
  168. simplify-known-call
  169. simplify-known-tail-call
  170. simplify-unknown-call
  171. simplify-return
  172. simplify-jump
  173. ; simplify-undefined-value
  174. simplify-test expand-test simplify-test?
  175. ))
  176. (define-interface front-debug-interface
  177. (export debug-breakpoint
  178. add-checks add-check clear-checks clear-check
  179. add-procs add-proc clear-procs clear-proc))
  180. (define-interface front-interface
  181. (export simplify-all
  182. integrate-jump-procs! ; for debugging
  183. ))
  184. (define-interface annotated-read-interface
  185. (export read-and-annotate
  186. pair-annotation
  187. annotated-cons
  188. annotation?
  189. annotation-file
  190. annotation-form
  191. annotation-row
  192. annotation-column
  193. ))
  194. (define-interface compiler-byte-vector-interface
  195. (export make-byte-vector byte-vector? byte-vector-length
  196. byte-vector-ref byte-vector-word-ref byte-vector-half-word-ref
  197. byte-vector-set! byte-vector-word-set! byte-vector-half-word-set!
  198. byte-vector-endianess set-byte-vector-endianess!
  199. ))
  200. (define-interface parameter-interface
  201. (export lookup-primop
  202. lookup-imported-variable
  203. type/unknown
  204. type-eq?
  205. lambda-node-type
  206. true-value
  207. false-value
  208. determine-lambda-protocol
  209. determine-continuation-protocol
  210. ))