renaming some functions to make it more clear that the role is for open coding

This commit is contained in:
Danny Yoo 2011-11-02 12:43:53 -04:00
parent 6f89bc60b2
commit c9dc713a00
2 changed files with 14 additions and 11 deletions

View File

@ -20,6 +20,7 @@
(require/typed "compiler-helper.rkt" (require/typed "compiler-helper.rkt"
[ensure-const-value (Any -> const-value)]) [ensure-const-value (Any -> const-value)])
(provide (rename-out [-compile compile]) (provide (rename-out [-compile compile])
compile-general-procedure-call) compile-general-procedure-call)
@ -954,19 +955,20 @@
(let ([id (PrimitiveKernelValue-id op-knowledge)]) (let ([id (PrimitiveKernelValue-id op-knowledge)])
(cond (cond
[(KernelPrimitiveName/Inline? id) [(KernelPrimitiveName/Inline? id)
(compile-kernel-primitive-application id exp cenv target linkage)] (compile-open-codeable-application id exp cenv target linkage)]
[else [else
(default)]))] (default)]))]
[(ModuleVariable? op-knowledge) [(ModuleVariable? op-knowledge)
(cond (cond
[(symbol=? (ModuleLocator-name [(or (symbol=? (ModuleLocator-name
(ModuleVariable-module-name op-knowledge)) (ModuleVariable-module-name op-knowledge))
'#%kernel) '#%kernel)
(symbol=? (ModuleLocator-name
(ModuleVariable-module-name op-knowledge))
'whalesong/lang/kernel.rkt))
(let ([op (ModuleVariable-name op-knowledge)]) (let ([op (ModuleVariable-name op-knowledge)])
(cond [(KernelPrimitiveName/Inline? op) (cond [(KernelPrimitiveName/Inline? op)
(compile-kernel-primitive-application (compile-open-codeable-application op exp cenv target linkage)]
op
exp cenv target linkage)]
[else [else
(default)]))] (default)]))]
[else [else
@ -1022,17 +1024,18 @@
linkage)))) linkage))))
(: compile-kernel-primitive-application (: compile-open-codeable-application
(KernelPrimitiveName/Inline App CompileTimeEnvironment Target Linkage -> InstructionSequence)) (KernelPrimitiveName/Inline App CompileTimeEnvironment Target Linkage -> InstructionSequence))
;; This is a special case of application, where the operator is statically ;; This is a special case of application, where the operator is statically
;; known to be in the set of hardcoded primitives. ;; known to be in the set of hardcoded primitives, and where we can open-code
;; the application.
;; ;;
;; There's a special case optimization we can perform: we can avoid touching ;; There's a special case optimization we can perform: we can avoid touching
;; the stack for constant arguments; rather than allocate (length (App-operands exp)) ;; the stack for constant arguments; rather than allocate (length (App-operands exp))
;; stack slots, we can do less than that. ;; stack slots, we can do less than that.
;; ;;
;; We have to be sensitive to mutation. ;; We have to be sensitive to mutation.
(define (compile-kernel-primitive-application kernel-op exp cenv target linkage) (define (compile-open-codeable-application kernel-op exp cenv target linkage)
(let ([singular-context-check (emit-singular-context linkage)] (let ([singular-context-check (emit-singular-context linkage)]
[n (length (App-operands exp))]) [n (length (App-operands exp))])

View File

@ -6,4 +6,4 @@
(provide version) (provide version)
(: version String) (: version String)
(define version "1.48") (define version "1.49")