* Switched order of two compiler passes: specify-representation and

insert-stack-overflow-check.  This will make it easier to remove 
   unnecessary stack checks and to add some that we *may* be
   missing.
* Added a $stack-overflow-check primitive that takes care of checking
  and calling ikrt_stack_overflow if we did detect an overflow.
This commit is contained in:
Abdulaziz Ghuloum 2007-11-05 15:30:42 -05:00
parent 90a243ee63
commit 8e85c3303b
5 changed files with 19 additions and 23 deletions

Binary file not shown.

View File

@ -1790,7 +1790,7 @@ syntax, shared graphs, fasl objects, etc.) can be enabled/disabled as needed.
The following procedures are missing from \texttt{(rnrs base)}:
\begin{Verbatim}
angle imag-part magnitude make-polar make-rectangular real-part
angle magnitude make-polar make-rectangular
\end{Verbatim}
The following procedures are missing form \texttt{(rnrs bytevectors)}:

View File

@ -203,11 +203,6 @@
[(_ e* ... e)
(make-seq (seq* e* ...) e)]))
(include "pass-specify-rep.ss")
(define (insert-engine-checks x)
(define (Tail x)
(make-seq
@ -227,21 +222,14 @@
(make-codes (map CodeExpr list) (Tail body))]))
(CodesExpr x))
(define (insert-stack-overflow-check x)
(define who 'insert-stack-overflow-check)
(define (Tail x) #t)
(define (insert-check x)
(make-seq
(make-shortcut
(make-conditional
(make-primcall '<
(list esp (make-primcall 'mref (list pcr (make-constant 16)))))
(make-primcall 'interrupt '())
(make-primcall 'nop '()))
(make-forcall "ik_stack_overflow" '()))
x))
(make-seq (make-primcall '$stack-overflow-check '()) x))
(define (ClambdaCase x)
(struct-case x
@ -265,7 +253,7 @@
;;;
(Program x))
(include "pass-specify-rep.ss")
(define parameter-registers '(%edi))
(define return-value-register '%eax)
@ -2831,8 +2819,8 @@
(let* ([x (introduce-primcalls x)]
[x (eliminate-fix x)]
[x (insert-engine-checks x)]
[x (specify-representation x)]
[x (insert-stack-overflow-check x)]
[x (specify-representation x)]
[x (impose-calling-convention/evaluation-order x)]
[x (time-it "frame" (lambda () (assign-frame-sizes x)))]
[x (time-it "register" (lambda () (color-by-chaitin x)))]

View File

@ -1127,8 +1127,6 @@
/section)
(section ;;; characters
(define-primop char? safe
@ -1530,6 +1528,16 @@
(interrupt)
(prm 'incr/zero? pcr (K 36)))])
(define-primop $stack-overflow-check unsafe
[(E)
(make-shortcut
(make-conditional
(make-primcall '<
(list esp (make-primcall 'mref (list pcr (make-constant 16)))))
(make-primcall 'interrupt '())
(make-primcall 'nop '()))
(make-forcall "ik_stack_overflow" '()))])
/section)
(section ;;; control operations

View File

@ -145,7 +145,7 @@
[char>=? C ba se]
[char>? C ba se]
[char? C ba se]
[complex? D ba se]
[complex? C ba se]
[cons C ba se]
[cos C ba se]
[denominator C ba se]
@ -170,7 +170,7 @@
[floor C ba se]
[for-each C ba se]
[gcd C ba se]
[imag-part D ba se]
[imag-part C ba se]
[inexact C ba]
[inexact? C ba se]
[infinite? C ba]
@ -208,7 +208,7 @@
[rational-valued? C ba]
[rational? C ba se]
[rationalize C ba se]
[real-part D ba se]
[real-part C ba se]
[real-valued? C ba]
[real? C ba se]
[reverse C ba se]