Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiek committed Nov 13, 2023
2 parents 0d4e430 + 0d8c89c commit e60491a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion interp-Cfun.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
(match fun
[(CFunction xs info blocks def-env)
(define f (dict-ref info 'name))
(define f-start (symbol-append f 'start))
(define f-start (symbol-append f '_start))
(define params-args (for/list ([x xs] [arg arg-vals])
(cons x (box arg))))
(define new-env (append params-args def-env))
Expand Down
10 changes: 5 additions & 5 deletions interp.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@
(match f-val
[(CFunction xs info blocks def-env)
(define f (dict-ref info 'name))
(define f-start (symbol-append f 'start))
(define f-start (symbol-append f '_start))
(define new-env (append (map cons xs arg-vals) def-env))
(parameterize ([get-basic-blocks blocks])
((interp-C-tail new-env) (dict-ref blocks f-start)))]
Expand All @@ -1178,7 +1178,7 @@
(match f-val
[(CFunction xs info blocks def-env)
(define f (dict-ref info 'name))
(define f-start (symbol-append f 'start))
(define f-start (symbol-append f '_start))
(define new-env (append (map cons xs arg-vals) def-env))
(parameterize ([get-basic-blocks blocks])
((interp-C-tail new-env) (dict-ref blocks f-start)))]
Expand Down Expand Up @@ -1260,7 +1260,7 @@
(define result-env
(parameterize ([get-basic-blocks blocks])
((interp-x86-block new-env)
(dict-ref blocks (symbol-append f 'start)))))
(dict-ref blocks (symbol-append f '_start)))))
(set! root-stack-pointer (- root-stack-pointer root-size))
(define res (lookup 'rax result-env))
;; return and continue after the function call, back in env
Expand Down Expand Up @@ -1343,7 +1343,7 @@
(lambda (ast)
(copious "R4/interp-pseudo-x86" ast)
(match ast
[(ProgramDefs info ds)
[(X86ProgramDefs info ds)
((initialize!) runtime-config:rootstack-size
runtime-config:heap-size)
(set! root-stack-pointer (unbox rootstack_begin))
Expand All @@ -1362,7 +1362,7 @@
(lambda (ast)
(verbose "R4/interp-x86" ast)
(match ast
[(ProgramDefs info ds)
[(X86ProgramDefs info ds)
((initialize!) runtime-config:rootstack-size
runtime-config:heap-size)
(set! root-stack-pointer (unbox rootstack_begin))
Expand Down
2 changes: 1 addition & 1 deletion type-check-Cfun.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
(define new-env (append (map cons xs ps) global-env))
(define env^ (make-hash new-env))
(define-values (env t)
(type-check-blocks info blocks env^ (symbol-append f 'start)))
(type-check-blocks info blocks env^ (symbol-append f '_start)))
(unless (type-equal? t rt)
(error 'type-check "mismatch in return type, ~a != ~a" t rt))
(define locals-types
Expand Down
4 changes: 2 additions & 2 deletions type-check-gradual.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[(`(,ts1 ... -> ,rt1) `(,ts2 ... -> ,rt2))
`(,@(for/list ([t1 ts1] [t2 ts2]) (join t1 t2))
-> ,(join rt1 rt2))]
[(else other) (error 'join "unhandled case types ~a ~a" t1 t2)]
[(other wise) (error 'join "unhandled case types ~a ~a" t1 t2)]
))

(define/public (meet t1 t2)
Expand All @@ -45,7 +45,7 @@
[(`(,ts1 ... -> ,rt1) `(,ts2 ... -> ,rt2))
`(,@(for/list ([t1 ts1] [t2 ts2]) (meet t1 t2))
-> ,(meet rt1 rt2))]
[(else other) (error 'meet "unhandled case types ~a ~a" t1 t2)]
[(other wise) (error 'meet "unhandled case types ~a ~a" t1 t2)]
))

))
Expand Down

0 comments on commit e60491a

Please sign in to comment.