[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/12: Use immediate primcalls when unfolding constructo
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/12: Use immediate primcalls when unfolding constructors |
Date: |
Sat, 11 Nov 2017 16:12:25 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 7bfdd46ea5d915fd878be47d08fb1e781d20d163
Author: Andy Wingo <address@hidden>
Date: Thu Nov 9 14:14:35 2017 +0100
Use immediate primcalls when unfolding constructors
* module/language/cps/constructors.scm (inline-vector): Use immediate
primcalls.
---
module/language/cps/constructors.scm | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/module/language/cps/constructors.scm
b/module/language/cps/constructors.scm
index ce6ec84..c35ac74 100644
--- a/module/language/cps/constructors.scm
+++ b/module/language/cps/constructors.scm
@@ -61,25 +61,17 @@
(with-cps out
(let$ next (initialize vec args (1+ n)))
(letk knext ($kargs () () ,next))
- (letv u64)
- (letk kunbox ($kargs ('idx) (u64)
- ($continue knext src
- ($primcall 'vector-set! #f (vec u64 arg)))))
- ($ (with-cps-constants ((idx n))
- (build-term ($continue kunbox src
- ($primcall 'scm->u64 #f (idx))))))))))
+ (build-term
+ ($continue knext src
+ ($primcall 'vector-set!/immediate n (vec arg))))))))
(with-cps out
(letv vec)
(let$ body (initialize vec args 0))
(letk kalloc ($kargs ('vec) (vec) ,body))
- ($ (with-cps-constants ((len (length args))
- (init #f))
- (letv u64)
- (letk kunbox ($kargs ('len) (u64)
- ($continue kalloc src
- ($primcall 'make-vector #f (u64 init)))))
- (build-term ($continue kunbox src
- ($primcall 'scm->u64 #f (len))))))))
+ ($ (with-cps-constants ((init #f))
+ (build-term
+ ($continue kalloc src
+ ($primcall 'make-vector/immediate (length args) (init))))))))
(define (find-constructor-inliner name)
(match name
- [Guile-commits] branch master updated (f96a670 -> 83a03a3), Andy Wingo, 2017/11/11
- [Guile-commits] 01/12: Fix effects analysis bug introduced with primcall param, Andy Wingo, 2017/11/11
- [Guile-commits] 02/12: Refactor numeric comparison bytecode emission, Andy Wingo, 2017/11/11
- [Guile-commits] 05/12: Closure conversion uses immediate variants of vector instructions, Andy Wingo, 2017/11/11
- [Guile-commits] 06/12: Use immediate primcalls when unfolding constructors,
Andy Wingo <=
- [Guile-commits] 09/12: Convert "ash" to "lsh"/"rsh" when lowering to CPS, Andy Wingo, 2017/11/11
- [Guile-commits] 12/12: Specialize rsh/lsh, not ash, Andy Wingo, 2017/11/11
- [Guile-commits] 07/12: Add tag-fixnum instruction, Andy Wingo, 2017/11/11
- [Guile-commits] 08/12: Compiler uses target fixnum range, Andy Wingo, 2017/11/11
- [Guile-commits] 03/12: Canonicalize <=, >=, and > primcalls to <, Andy Wingo, 2017/11/11
- [Guile-commits] 11/12: Add missing lsh/immediate, rsh/immediate type inferrers, Andy Wingo, 2017/11/11
- [Guile-commits] 04/12: Specialize comparisons to SCM as s64, Andy Wingo, 2017/11/11
- [Guile-commits] 10/12: Type folding has "macro reduction" phase, Andy Wingo, 2017/11/11