From e24f4a396c836264a152ab7d1b0478a1a223ae32 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Thu, 6 Jul 1995 21:27:14 +0000 Subject: [PATCH] Distribution-profiled & rearranged dispatch. --- v8/src/compiler/midend/simplify.scm | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/v8/src/compiler/midend/simplify.scm b/v8/src/compiler/midend/simplify.scm index 9765dc036..73670d0d5 100644 --- a/v8/src/compiler/midend/simplify.scm +++ b/v8/src/compiler/midend/simplify.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: simplify.scm,v 1.14 1995/06/22 15:22:26 adams Exp $ +$Id: simplify.scm,v 1.15 1995/07/06 21:27:14 adams Exp $ Copyright (c) 1994-1995 Massachusetts Institute of Technology @@ -44,21 +44,6 @@ MIT in each case. |# (define (simplify/top-level program) (simplify/expr #F program)) -;;(define-macro (define-simplifier keyword bindings . body) -;; (let ((proc-name (symbol-append 'SIMPLIFY/ 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 (SIMPLIFY/GET-DBG-INFO ENV FORM))) -;; (LET ((CODE (TRANSFORM-CODE))) -;; (IF INFO -;; (CODE-REWRITE/REMEMBER* CODE INFO)) -;; CODE)))))))))) - (define-macro (define-simplifier keyword bindings . body) (let ((proc-name (symbol-append 'SIMPLIFY/ keyword))) (call-with-values @@ -592,16 +577,18 @@ MIT in each case. |# (define (simplify/expr env expr) (if (not (pair? expr)) (illegal expr)) + ;;(sample/1 '(simplify/dispatch histogram) (car expr)) + ;; Distrubution: quote: 57%, call: 20%, lookup: 17%, let: 3%, lambda: 2% (case (car expr) ((QUOTE) (simplify/quote env expr)) + ((CALL) (simplify/call env expr)) ((LOOKUP) (simplify/lookup env expr)) - ((LAMBDA) (simplify/lambda env expr)) ((LET) (simplify/let env expr)) - ((DECLARE) (simplify/declare env expr)) - ((CALL) (simplify/call env expr)) - ((BEGIN) (simplify/begin env expr)) + ((LAMBDA) (simplify/lambda env expr)) ((IF) (simplify/if env expr)) ((LETREC) (simplify/letrec env expr)) + ((BEGIN) (simplify/begin env expr)) + ((DECLARE) (simplify/declare env expr)) (else (illegal expr)))) (define (simplify/expr* env exprs) -- 2.25.1