From 92bd4daadd6cfaed81bc9ae953fc001a4ac7c2c3 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Thu, 6 Jul 1995 20:23:37 +0000 Subject: [PATCH] Removed dead code. Profiled frequency distribution of forms and reordered dispacth accordingly (we might want to do this on a bigger sample). --- v8/src/compiler/midend/cleanup.scm | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/v8/src/compiler/midend/cleanup.scm b/v8/src/compiler/midend/cleanup.scm index 7e4e3b56a..87abaabd0 100644 --- a/v8/src/compiler/midend/cleanup.scm +++ b/v8/src/compiler/midend/cleanup.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: cleanup.scm,v 1.20 1995/07/04 05:47:49 adams Exp $ +$Id: cleanup.scm,v 1.21 1995/07/06 20:23:37 adams Exp $ Copyright (c) 1994-1995 Massachusetts Institute of Technology @@ -40,21 +40,6 @@ MIT in each case. |# (define (cleanup/top-level program) (cleanup/expr (cleanup/env/initial) program)) -;;(define-macro (define-cleanup-handler keyword bindings . body) -;; (let ((proc-name (symbol-append 'CLEANUP/ keyword))) -;; (call-with-values -;; (lambda () (%matchup (cdr bindings) '(handler env) '(cdr form))) -;; (lambda (names code) -;; `(DEFINE ,proc-name -;; (LET ((HANDLER (LAMBDA ,(cons (car bindings) names) ,@body))) -;; (NAMED-LAMBDA (,proc-name ENV FORM) -;; (LET ((TRANSFORM-CODE (LAMBDA () ,code))) -;; (LET ((INFO (CLEANUP/GET-DBG-INFO ENV FORM))) -;; (LET ((CODE (TRANSFORM-CODE))) -;; (IF INFO -;; (CODE-REWRITE/REMEMBER* CODE INFO)) -;; CODE)))))))))) - (define-macro (define-cleanup-handler keyword bindings . body) (let ((proc-name (symbol-append 'CLEANUP/ keyword))) (call-with-values @@ -657,16 +642,18 @@ MIT in each case. |# (define (cleanup/expr env expr) (if (not (pair? expr)) (illegal expr)) + ;;(sample/1 '(cleanup/dispatch histogram) (car expr)) + ;; Dynamic Freqency: quote: 48%, call: 24%, lookup: 20%, let: 4%, ... (case (car expr) ((QUOTE) (cleanup/quote env expr)) + ((CALL) (cleanup/call env expr)) ((LOOKUP) (cleanup/lookup env expr)) - ((LAMBDA) (cleanup/lambda env expr)) ((LET) (cleanup/let env expr)) - ((DECLARE) (cleanup/declare env expr)) - ((CALL) (cleanup/call env expr)) - ((BEGIN) (cleanup/begin env expr)) + ((LAMBDA) (cleanup/lambda env expr)) ((IF) (cleanup/if env expr)) ((LETREC) (cleanup/letrec env expr)) + ((BEGIN) (cleanup/begin env expr)) + ((DECLARE) (cleanup/declare env expr)) (else (illegal expr)))) -- 2.25.1