From 45c72d0837834db95654d6696661d98597f91002 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 1 Dec 2011 10:32:25 -0600 Subject: [PATCH] add a compiler-hint:cross-module-inline hint. Calling this function: (provide (contract-out [f (-> integer? integer?)])) (define (f x) x) from another module seems to speed up by about 8% with the annotation in this commit. --- collects/racket/contract/private/arrow.rkt | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/collects/racket/contract/private/arrow.rkt b/collects/racket/contract/private/arrow.rkt index 52ebfb39bb..740ad78f61 100644 --- a/collects/racket/contract/private/arrow.rkt +++ b/collects/racket/contract/private/arrow.rkt @@ -75,21 +75,23 @@ v4 todo: [else #,(call-gen rng-checkers)])))) (define tail-marks-match? - (case-lambda - [(m) (and m (null? m))] - [(m rng-ctc) (and m - (not (null? m)) - (null? (cdr m)) - (procedure-closure-contents-eq? (car m) rng-ctc))] - [(m rng-ctc1 rng-ctc2) - (and m - (= (length m) 2) - (procedure-closure-contents-eq? (car m) rng-ctc1) - (procedure-closure-contents-eq? (cadr m) rng-ctc1))] - [(m . rng-ctcs) - (and m - (= (length m) (length rng-ctcs)) - (andmap procedure-closure-contents-eq? m rng-ctcs))])) + (begin + 'compiler-hint:cross-module-inline + (case-lambda + [(m) (and m (null? m))] + [(m rng-ctc) (and m + (not (null? m)) + (null? (cdr m)) + (procedure-closure-contents-eq? (car m) rng-ctc))] + [(m rng-ctc1 rng-ctc2) + (and m + (= (length m) 2) + (procedure-closure-contents-eq? (car m) rng-ctc1) + (procedure-closure-contents-eq? (cadr m) rng-ctc1))] + [(m . rng-ctcs) + (and m + (= (length m) (length rng-ctcs)) + (andmap procedure-closure-contents-eq? m rng-ctcs))]))) (define-syntax (unconstrained-domain-> stx) (syntax-case stx ()