From: Chris Hanson Date: Wed, 29 Jul 1992 19:56:52 +0000 (+0000) Subject: Add optional stack-overflow checks. By default this is disabled. X-Git-Tag: 20090517-FFI~9178 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7fc67d246dda275d829059753d58d4c56cacabfc;p=mit-scheme.git Add optional stack-overflow checks. By default this is disabled. --- diff --git a/v7/src/compiler/base/make.scm b/v7/src/compiler/base/make.scm index 944c3ec17..1becebd77 100644 --- a/v7/src/compiler/base/make.scm +++ b/v7/src/compiler/base/make.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/make.scm,v 4.91 1992/06/12 01:43:36 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/make.scm,v 4.92 1992/07/29 19:56:21 cph Exp $ -Copyright (c) 1988-1992 Massachusetts Institute of Technology +Copyright (c) 1988-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -46,5 +46,5 @@ MIT in each case. |# (initialize-package! '(COMPILER DECLARATIONS))) (add-system! (make-system (string-append "Liar (" architecture-name ")") - 4 91 + 4 92 '()))) \ No newline at end of file diff --git a/v7/src/compiler/base/switch.scm b/v7/src/compiler/base/switch.scm index 31ad280d4..8bffdfa6c 100644 --- a/v7/src/compiler/base/switch.scm +++ b/v7/src/compiler/base/switch.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/switch.scm,v 4.18 1992/06/12 01:43:29 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/switch.scm,v 4.19 1992/07/29 19:56:52 cph Exp $ -Copyright (c) 1988-1992 Massachusetts Institute of Technology +Copyright (c) 1988-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -60,6 +60,7 @@ MIT in each case. |# (define compiler:intersperse-rtl-in-lap? true) (define compiler:generate-range-checks? false) (define compiler:generate-type-checks? false) +(define compiler:generate-stack-checks? false) (define compiler:open-code-flonum-checks? false) (define compiler:use-multiclosures? true) (define compiler:coalescing-constant-warnings? true) diff --git a/v7/src/compiler/machines/spectrum/compiler.pkg b/v7/src/compiler/machines/spectrum/compiler.pkg index 530db5de9..28af0bdfb 100644 --- a/v7/src/compiler/machines/spectrum/compiler.pkg +++ b/v7/src/compiler/machines/spectrum/compiler.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/compiler.pkg,v 1.36 1992/07/20 22:11:58 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/compiler.pkg,v 1.37 1992/07/29 19:56:08 cph Exp $ $MC68020-Header: /scheme/compiler/bobcat/RCS/comp.pkg,v 1.32 1991/05/06 23:09:24 jinx Exp $ Copyright (c) 1988-92 Massachusetts Institute of Technology @@ -88,6 +88,7 @@ MIT in each case. |# compiler:generate-lap-files? compiler:generate-range-checks? compiler:generate-rtl-files? + compiler:generate-stack-checks? compiler:generate-type-checks? compiler:implicit-self-static? compiler:intersperse-rtl-in-lap? diff --git a/v7/src/compiler/machines/spectrum/lapgen.scm b/v7/src/compiler/machines/spectrum/lapgen.scm index 6627d216d..31a7160e0 100644 --- a/v7/src/compiler/machines/spectrum/lapgen.scm +++ b/v7/src/compiler/machines/spectrum/lapgen.scm @@ -1,9 +1,9 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/lapgen.scm,v 4.38 1992/05/14 03:02:44 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/lapgen.scm,v 4.39 1992/07/29 19:56:09 cph Exp $ $MC68020-Header: /scheme/compiler/bobcat/RCS/lapgen.scm,v 4.41 1991/05/06 23:05:51 jinx Exp $ -Copyright (c) 1988-1992 Massachusetts Institute of Technology +Copyright (c) 1988-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -499,6 +499,9 @@ MIT in each case. |# (define-integrable reg:lexpr-primitive-arity (INST-EA (OFFSET #x001C 0 ,regnum:regs-pointer))) +(define-integrable reg:stack-guard + (INST-EA (OFFSET #x002C 0 ,regnum:regs-pointer))) + (define (lap:make-label-statement label) (LAP (LABEL ,label))) diff --git a/v7/src/compiler/machines/spectrum/rules3.scm b/v7/src/compiler/machines/spectrum/rules3.scm index 568a6714f..38355c0f7 100644 --- a/v7/src/compiler/machines/spectrum/rules3.scm +++ b/v7/src/compiler/machines/spectrum/rules3.scm @@ -1,9 +1,9 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/rules3.scm,v 4.31 1992/02/07 05:58:22 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/rules3.scm,v 4.32 1992/07/29 19:56:10 cph Exp $ $MC68020-Header: /scheme/compiler/bobcat/RCS/rules3.scm,v 4.30 1991/05/07 13:45:31 jinx Exp $ -Copyright (c) 1988-1992 Massachusetts Institute of Technology +Copyright (c) 1988-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -431,7 +431,13 @@ MIT in each case. |# (define (interrupt-check gc-label) (LAP (COMB (>=) ,regnum:free-pointer ,regnum:memtop-pointer (@PCR ,gc-label)) - (LDW () ,reg:memtop ,regnum:memtop-pointer))) + (LDW () ,reg:memtop ,regnum:memtop-pointer) + ,@(if compiler:generate-stack-checks? + (LAP (LDW () ,reg:stack-guard ,regnum:addil-result) + (COMB (<=) ,regnum:stack-pointer ,regnum:addil-result + (@PCR ,gc-label)) + (NOP ())) + (LAP)))) (define-rule statement (CONTINUATION-ENTRY (? internal-label))