Hand coded SIMPLIFY/ENV/FRAME-LOOKUP rather than use
authorStephen Adams <edu/mit/csail/zurich/adams>
Sun, 9 Apr 1995 04:45:59 +0000 (04:45 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Sun, 9 Apr 1995 04:45:59 +0000 (04:45 +0000)
ASSOCIATION-PROCEDURE to get better profiling info.

v8/src/compiler/midend/simplify.scm

index 47fdcf96048da09ea91dfa24a9ed83d53eaf66d5..205323f2363eac8a609c190c5cc5502e47a72034 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: simplify.scm,v 1.9 1995/04/06 18:33:25 adams Exp $
+$Id: simplify.scm,v 1.10 1995/04/09 04:45:59 adams Exp $
 
 Copyright (c) 1994 Massachusetts Institute of Technology
 
@@ -594,8 +594,17 @@ MIT in each case. |#
     result))
 
 
-(define simplify/env/frame-lookup
-    (association-procedure (lambda (x y) (eq? x y)) simplify/binding/name))
+;; The profiler says a lot of time is being spent here in large programs:
+;;(define simplify/env/frame-lookup
+;;    (association-procedure (lambda (x y) (eq? x y)) simplify/binding/name))
+
+(define (simplify/env/frame-lookup name bindings)
+  (let loop ((bindings bindings))
+    (if (pair? bindings)
+       (if (eq? name (simplify/binding/name (car bindings)))
+           (car bindings)
+           (loop (cdr bindings)))
+       #F)))
 
 (define (simplify/lookup*! env name reference kind)
   ;; kind = 'OPERATOR, 'ORDINARY or 'DBG-INFO