mescc: Tinycc support: more function stack space.
* module/mes/as-i386.mes (function-locals): Increase local space from 64 (16 vars) to 2*1025 + 80 (20 vars).
This commit is contained in:
parent
7e795763f3
commit
10e65b35ce
|
@ -2315,9 +2315,14 @@
|
||||||
(format (current-error-port) " :~a\n" name)
|
(format (current-error-port) " :~a\n" name)
|
||||||
(let loop ((statements (.statements o))
|
(let loop ((statements (.statements o))
|
||||||
(info (clone info #:locals locals #:function (.name o) #:text text)))
|
(info (clone info #:locals locals #:function (.name o) #:text text)))
|
||||||
(if (null? statements) (clone info
|
(if (null? statements) (let* ((locals (.locals info))
|
||||||
|
(local (and (pair? locals) (car locals)))
|
||||||
|
(count (and=> local (compose local:id cdr)))
|
||||||
|
(stack (and count (* count 4))))
|
||||||
|
(if (and stack (getenv "MESC_DEBUG")) (stderr " stack: ~a\n" stack))
|
||||||
|
(clone info
|
||||||
#:function #f
|
#:function #f
|
||||||
#:functions (append (.functions info) (list (cons name (assert-return (.text info))))))
|
#:functions (append (.functions info) (list (cons name (assert-return (.text info)))))))
|
||||||
(let* ((statement (car statements)))
|
(let* ((statement (car statements)))
|
||||||
(loop (cdr statements)
|
(loop (cdr statements)
|
||||||
((ast->info info) (car statements)))))))))
|
((ast->info info) (car statements)))))))))
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
("mov____%esp,%ebp")))
|
("mov____%esp,%ebp")))
|
||||||
|
|
||||||
(define (i386:function-locals)
|
(define (i386:function-locals)
|
||||||
'(("sub____%esp,$i8" (#:immediate1 #x40)))) ; sub %esp,$0x40 # 16 local vars
|
`(("sub____%esp,$i32" (#:immediate ,(+ (* 4 1025) (* 20 4)))))) ; sub %esp,xxx 4*1024 buf, 20 local vars
|
||||||
|
|
||||||
(define (i386:push-label label)
|
(define (i386:push-label label)
|
||||||
`(("push___$i32" (#:address ,label)))) ; push $0x<label>
|
`(("push___$i32" (#:address ,label)))) ; push $0x<label>
|
||||||
|
|
|
@ -143,6 +143,7 @@ DEFINE sub____%dl,%al 28c2
|
||||||
DEFINE sub____%eax,%edx 29c2
|
DEFINE sub____%eax,%edx 29c2
|
||||||
DEFINE sub____%edx,%eax 29d0
|
DEFINE sub____%edx,%eax 29d0
|
||||||
DEFINE sub____%edx,%eax 29d0
|
DEFINE sub____%edx,%eax 29d0
|
||||||
|
DEFINE sub____%esp,$i32 81ec
|
||||||
DEFINE sub____%esp,$i8 83ec
|
DEFINE sub____%esp,$i8 83ec
|
||||||
DEFINE test___%al,%al 84c0
|
DEFINE test___%al,%al 84c0
|
||||||
DEFINE test___%eax,%eax 85c0
|
DEFINE test___%eax,%eax 85c0
|
||||||
|
|
Loading…
Reference in a new issue