From: Stephen Adams Date: Fri, 16 Dec 1994 20:18:34 +0000 (+0000) Subject: Changed the rtl parser to hash on symbol names rather than symbol X-Git-Tag: 20090517-FFI~6869 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f7ef36afb6b441bd9737a01927dbc160c309c643;p=mit-scheme.git Changed the rtl parser to hash on symbol names rather than symbol addresses so that the order of basic blocks in the final code is deterministic. --- diff --git a/v8/src/compiler/rtlbase/rtlpars.scm b/v8/src/compiler/rtlbase/rtlpars.scm index f9e110b33..2796bbd6e 100644 --- a/v8/src/compiler/rtlbase/rtlpars.scm +++ b/v8/src/compiler/rtlbase/rtlpars.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: rtlpars.scm,v 1.2 1994/11/26 19:20:28 adams Exp $ +$Id: rtlpars.scm,v 1.3 1994/12/16 20:18:34 adams Exp $ Copyright (c) 1994 Massachusetts Institute of Technology @@ -309,12 +309,18 @@ MIT in each case. |# )) *expressions*))))) +(define make-labels->segments + (let ((symbol-hash-mod + (lambda (symbol modulus) + (string-hash-mod (symbol-name symbol) modulus)))) + (strong-hash-table/constructor symbol-hash-mod eq?))) + (define (parse-rtl rtl-program) (cond ((null? rtl-program) (internal-error "Empty program")) ((not (memq (caar rtl-program) label-like-statements)) (internal-error "Program does not start with label" rtl-program))) - (let ((labels->segments (make-eq-hash-table))) + (let ((labels->segments (make-labels->segments))) (define (found-one label stmts) (hash-table/put! labels->segments