From 1ab9eeee784164a607258f511fd27caf8e7b2dec Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Wed, 18 May 2011 14:30:43 -0400 Subject: [PATCH] disabling optimizations again; trying to trace test-conform's failure --- Makefile | 5 +++++ compiler.rkt | 13 +++++++------ optimize-il.rkt | 4 +++- test-conform.rkt | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 27a8753..0fe3572 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,8 @@ test-compiler: test-earley: raco make -v --disable-inline test-earley.rkt racket test-earley.rkt + + +test-conform: + raco make -v --disable-inline test-conform.rkt + racket test-conform.rkt diff --git a/compiler.rkt b/compiler.rkt index b8deed0..75cd3ef 100644 --- a/compiler.rkt +++ b/compiler.rkt @@ -965,7 +965,7 @@ (ModuleVariable-module-name op-knowledge)) '#%kernel) (let ([op (ModuleVariable-name op-knowledge)]) - (cond [(KernelPrimitiveName/Inline? op) + (cond #;[(KernelPrimitiveName/Inline? op) (compile-kernel-primitive-application op exp cenv target linkage)] @@ -1025,7 +1025,7 @@ linkage)))) -(: compile-kernel-primitive-application +#;(: compile-kernel-primitive-application (KernelPrimitiveName/Inline App CompileTimeEnvironment Target Linkage -> InstructionSequence)) ;; This is a special case of application, where the operator is statically ;; known to be in the set of hardcoded primitives. @@ -1035,7 +1035,7 @@ ;; stack slots, we can do less than that. ;; ;; We have to be sensitive to mutation. -(define (compile-kernel-primitive-application kernel-op exp cenv target linkage) +#;(define (compile-kernel-primitive-application kernel-op exp cenv target linkage) (let ([singular-context-check (emit-singular-context linkage)]) (cond ;; If all the arguments are primitive enough (all constants, localrefs, or toplevelrefs), @@ -1628,7 +1628,8 @@ ;; We should do more here eventually, including things like type inference or flow analysis, so that ;; we can generate better code. (define (extract-static-knowledge exp cenv) - (cond + '? + #;(cond [(Lam? exp) (make-StaticallyKnownLam (Lam-name exp) (Lam-entry-label exp) @@ -2088,10 +2089,10 @@ -(: adjust-expression-depth (Expression Natural Natural -> Expression)) +#;(: adjust-expression-depth (Expression Natural Natural -> Expression)) ;; Redirects references to the stack to route around a region of size n. ;; The region begins at offset skip into the environment. -(define (adjust-expression-depth exp n skip) +#;(define (adjust-expression-depth exp n skip) (cond [(Top? exp) (make-Top (Top-prefix exp) diff --git a/optimize-il.rkt b/optimize-il.rkt index ce7e0f9..6cf02bc 100644 --- a/optimize-il.rkt +++ b/optimize-il.rkt @@ -13,9 +13,11 @@ (: optimize-il ((Listof Statement) -> (Listof Statement))) (define (optimize-il statements) + + statements ;; For now, replace pairs of PushEnvironment / AssignImmediate(0, ...) ;; We should do some more optimizations here, like peephole... - (let loop ([statements (filter not-no-op? statements)]) + #;(let loop ([statements (filter not-no-op? statements)]) (cond [(empty? statements) empty] diff --git a/test-conform.rkt b/test-conform.rkt index 0da541f..9b9ad66 100644 --- a/test-conform.rkt +++ b/test-conform.rkt @@ -54,5 +54,5 @@ (test (read (open-input-file "tests/conform/program0.sch")) (port->string (open-input-file "tests/conform/expected0.txt")) - ;;#:debug? #t + #:debug? #t )