From: Guillermo J. Rozas Date: Sat, 24 Oct 1992 16:01:10 +0000 (+0000) Subject: Move a few things around to accomodate the C back end. X-Git-Tag: 20090517-FFI~8821 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=280bce9a6c70a5a38c3af9fdcea0c9d285e781d2;p=mit-scheme.git Move a few things around to accomodate the C back end. --- diff --git a/v7/src/compiler/back/lapgn1.scm b/v7/src/compiler/back/lapgn1.scm index 00bb99008..f291f32e3 100644 --- a/v7/src/compiler/back/lapgn1.scm +++ b/v7/src/compiler/back/lapgn1.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/back/lapgn1.scm,v 4.12 1991/10/22 09:53:38 cph Exp $ +$Id: lapgn1.scm,v 4.13 1992/10/24 16:01:03 jinx Exp $ -Copyright (c) 1987-91 Massachusetts Institute of Technology +Copyright (c) 1987-1992 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -54,14 +54,7 @@ MIT in each case. |# (constant->label (vector-ref remote-link 0))) unspecific) remote-links) - (with-values - (lambda () - (generate/constants-block *interned-constants* - *interned-variables* - *interned-assignments* - *interned-uuo-links* - *interned-global-links* - *interned-static-variables*)) + (with-values prepare-constants-block (or process-constants-block (lambda (constants-code environment-label free-ref-label n-sections) diff --git a/v7/src/compiler/back/lapgn3.scm b/v7/src/compiler/back/lapgn3.scm index 13e4f9712..ba1cd0a0c 100644 --- a/v7/src/compiler/back/lapgn3.scm +++ b/v7/src/compiler/back/lapgn3.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: lapgn3.scm,v 4.10 1992/10/19 19:14:11 jinx Exp $ +$Id: lapgn3.scm,v 4.11 1992/10/24 16:01:10 jinx Exp $ Copyright (c) 1987-1992 Massachusetts Institute of Technology @@ -151,4 +151,12 @@ MIT in each case. |# (uuo-link-label (lambda () *interned-global-links*) (lambda (new) (set! *interned-global-links* new)) - "GLOBAL-")) \ No newline at end of file + "GLOBAL-")) + +(define (prepare-constants-block) + (generate/constants-block *interned-constants* + *interned-variables* + *interned-assignments* + *interned-uuo-links* + *interned-global-links* + *interned-static-variables*)) \ No newline at end of file diff --git a/v7/src/compiler/base/asstop.scm b/v7/src/compiler/base/asstop.scm index ddce6473c..ce759cdee 100644 --- a/v7/src/compiler/base/asstop.scm +++ b/v7/src/compiler/base/asstop.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: asstop.scm,v 1.1 1992/10/19 19:11:52 jinx Exp $ +$Id: asstop.scm,v 1.2 1992/10/24 16:00:56 jinx Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -45,7 +45,9 @@ MIT in each case. |# (define (compiled-scode->procedure scode environment) (scode-eval scode environment)) -;;; State variables for the assembler and linker +;;; Global variables for the assembler and linker + +(define *recursive-compilation-results*) ;; First set: phase/rtl-generation ;; Last used: phase/link @@ -78,6 +80,10 @@ MIT in each case. |# (lap:make-entry-point entry-label *block-label*)) ,@some-lap)) +(define (bind-assembler&linker-top-level-variables thunk) + (fluid-let ((*recursive-compilation-results* '())) + (thunk))) + (define (bind-assembler&linker-variables thunk) (fluid-let ((*block-label*) (*external-labels*) @@ -96,6 +102,7 @@ MIT in each case. |# (thunk))) (define (assembler&linker-reset!) + (set! *recursive-compilation-results* '()) (set! *block-label*) (set! *external-labels*) (set! *end-of-block-code*) diff --git a/v7/src/compiler/base/toplev.scm b/v7/src/compiler/base/toplev.scm index 6cea94baa..62d89fae7 100644 --- a/v7/src/compiler/base/toplev.scm +++ b/v7/src/compiler/base/toplev.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: toplev.scm,v 4.46 1992/10/19 19:13:30 jinx Exp $ +$Id: toplev.scm,v 4.47 1992/10/24 16:00:50 jinx Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -256,7 +256,6 @@ MIT in each case. |# (define *recursive-compilation-count*) (define *recursive-compilation-number*) -(define *recursive-compilation-results*) (define *procedure-result?*) (define *remote-links*) (define *process-time*) @@ -351,12 +350,13 @@ MIT in each case. |# (run-compiler)) (fluid-let ((*recursive-compilation-number* 0) (*recursive-compilation-count* 1) - (*recursive-compilation-results* '()) (*procedure-result?* false) (*remote-links* '()) (*process-time* 0) (*real-time* 0)) - (bind-compiler-variables run-compiler))))) + (bind-assembler&linker-top-level-variables + (lambda () + (bind-compiler-variables run-compiler))))))) (define (bind-compiler-variables thunk) ;; Split this fluid-let because compiler was choking on it. @@ -392,7 +392,6 @@ MIT in each case. |# (define (compiler:reset!) (set! *recursive-compilation-number* 0) (set! *recursive-compilation-count* 1) - (set! *recursive-compilation-results* '()) (set! *procedure-result?* false) (set! *remote-links* '()) (set! *process-time* 0)