[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 08/16: Flesh out compile-bytecode for all heap objects
From: |
Andy Wingo |
Subject: |
[Guile-commits] 08/16: Flesh out compile-bytecode for all heap objects |
Date: |
Wed, 27 Dec 2017 10:02:47 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 549ad3ce8cfdc507b6b4dd0b31e6e253f6a0e61e
Author: Andy Wingo <address@hidden>
Date: Wed Dec 27 12:11:07 2017 +0100
Flesh out compile-bytecode for all heap objects
* module/language/cps/compile-bytecode.scm (compile-function): Organize
emitters and flesh out with more heap type tag predicates. Remove
now-needless (language cps primitives) import.
---
module/language/cps/compile-bytecode.scm | 39 +++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/module/language/cps/compile-bytecode.scm
b/module/language/cps/compile-bytecode.scm
index aa33b68..2b3b23f 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -27,7 +27,6 @@
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (language cps)
- #:use-module (language cps primitives)
#:use-module (language cps slot-allocation)
#:use-module (language cps utils)
#:use-module (language cps closure-conversion)
@@ -476,10 +475,10 @@
(op asm (from-sp (slot a)) b)
(emit-branch emit-jl emit-jnl))
(match exp
+ ;; Immediate type tag predicates.
+ (($ $primcall 'fixnum? #f (a)) (unary emit-fixnum? a))
(($ $primcall 'heap-object? #f (a)) (unary emit-heap-object? a))
- (($ $primcall 'null? #f (a)) (unary emit-null? a))
- (($ $primcall 'nil? #f (a)) (unary emit-nil? a))
- (($ $primcall 'false? #f (a)) (unary emit-false? a))
+ (($ $primcall 'char? #f (a)) (unary emit-char? a))
(($ $primcall 'eq-false? #f (a)) (unary emit-eq-false? a))
(($ $primcall 'eq-nil? #f (a)) (unary emit-eq-nil? a))
(($ $primcall 'eq-null? #f (a)) (unary emit-eq-null? a))
@@ -487,22 +486,40 @@
(($ $primcall 'unspecified? #f (a)) (unary emit-unspecified? a))
(($ $primcall 'undefined? #f (a)) (unary emit-undefined? a))
(($ $primcall 'eof-object? #f (a)) (unary emit-eof-object? a))
+ (($ $primcall 'null? #f (a)) (unary emit-null? a))
+ (($ $primcall 'false? #f (a)) (unary emit-false? a))
+ (($ $primcall 'nil? #f (a)) (unary emit-nil? a))
+ ;; Heap type tag predicates.
(($ $primcall 'pair? #f (a)) (unary emit-pair? a))
(($ $primcall 'struct? #f (a)) (unary emit-struct? a))
- (($ $primcall 'char? #f (a)) (unary emit-char? a))
(($ $primcall 'symbol? #f (a)) (unary emit-symbol? a))
(($ $primcall 'variable? #f (a)) (unary emit-variable? a))
(($ $primcall 'vector? #f (a)) (unary emit-vector? a))
(($ $primcall 'string? #f (a)) (unary emit-string? a))
+ (($ $primcall 'heap-number? #f (a)) (unary emit-heap-number? a))
+ (($ $primcall 'hash-table? #f (a)) (unary emit-hash-table? a))
+ (($ $primcall 'pointer? #f (a)) (unary emit-pointer? a))
+ (($ $primcall 'fluid? #f (a)) (unary emit-fluid? a))
+ (($ $primcall 'stringbuf? #f (a)) (unary emit-stringbuf? a))
+ (($ $primcall 'dynamic-state? #f (a)) (unary emit-dynamic-state? a))
+ (($ $primcall 'frame? #f (a)) (unary emit-frame? a))
+ (($ $primcall 'keyword? #f (a)) (unary emit-keyword? a))
+ (($ $primcall 'atomic-box? #f (a)) (unary emit-atomic-box? a))
+ (($ $primcall 'syntax? #f (a)) (unary emit-syntax? a))
+ (($ $primcall 'program? #f (a)) (unary emit-program? a))
+ (($ $primcall 'vm-continuation? #f (a)) (unary emit-vm-continuation?
a))
(($ $primcall 'bytevector? #f (a)) (unary emit-bytevector? a))
+ (($ $primcall 'weak-set? #f (a)) (unary emit-weak-set? a))
+ (($ $primcall 'weak-table? #f (a)) (unary emit-weak-table? a))
+ (($ $primcall 'array? #f (a)) (unary emit-array? a))
(($ $primcall 'bitvector? #f (a)) (unary emit-bitvector? a))
- (($ $primcall 'keyword? #f (a)) (unary emit-keyword? a))
- (($ $primcall 'heap-number? #f (a)) (unary emit-heap-number? a))
- (($ $primcall 'fixnum? #f (a)) (unary emit-fixnum? a))
+ (($ $primcall 'smob? #f (a)) (unary emit-smob? a))
+ (($ $primcall 'port? #f (a)) (unary emit-port? a))
(($ $primcall 'bignum? #f (a)) (unary emit-bignum? a))
- ;; Add more TC7 tests here. Keep in sync with
- ;; *branching-primcall-arities* in (language cps primitives) and
- ;; the set of macro-instructions in assembly.scm.
+ (($ $primcall 'flonum? #f (a)) (unary emit-flonum? a))
+ (($ $primcall 'compnum? #f (a)) (unary emit-compnum? a))
+ (($ $primcall 'fracnum? #f (a)) (unary emit-fracnum? a))
+ ;; Binary predicates.
(($ $primcall 'eq? #f (a b)) (binary-test emit-eq? a b))
(($ $primcall 'heap-numbers-equal? #f (a b))
(binary-test emit-heap-numbers-equal? a b))
- [Guile-commits] branch master updated (da7144d -> 108ade6), Andy Wingo, 2017/12/27
- [Guile-commits] 01/16: Fix stack effect/clobber parsing for calls, Andy Wingo, 2017/12/27
- [Guile-commits] 04/16: Reify-primitives removes "/unlikely" ephemeral instructions, Andy Wingo, 2017/12/27
- [Guile-commits] 07/16: Refactor list->seq to make return arity apparent, Andy Wingo, 2017/12/27
- [Guile-commits] 05/16: Remove compile-bytecode cases for ephemeral primitives, Andy Wingo, 2017/12/27
- [Guile-commits] 12/16: CPS conversion avoids residualizing unknown primcalls, Andy Wingo, 2017/12/27
- [Guile-commits] 06/16: Refactor reify-primitives pass, Andy Wingo, 2017/12/27
- [Guile-commits] 08/16: Flesh out compile-bytecode for all heap objects,
Andy Wingo <=
- [Guile-commits] 15/16: Unknown primcalls convert as calls, Andy Wingo, 2017/12/27
- [Guile-commits] 13/16: Contification also inlines "elide-values" pass, Andy Wingo, 2017/12/27
- [Guile-commits] 10/16: CPS conversion expands "list", Andy Wingo, 2017/12/27
- [Guile-commits] 11/16: Inline "elide-values" optimization into CPS conversion, Andy Wingo, 2017/12/27
- [Guile-commits] 09/16: Refactor lowering of Tree-IL primcalls to CPS, Andy Wingo, 2017/12/27
- [Guile-commits] 16/16: Re-add support for logbit?, Andy Wingo, 2017/12/27
- [Guile-commits] 03/16: Refactor boxing/unboxing primcall args/results, Andy Wingo, 2017/12/27
- [Guile-commits] 02/16: Fix mismatch between CPS and Scheme "complex?" predicate, Andy Wingo, 2017/12/27
- [Guile-commits] 14/16: Remove inline-constructors pass, Andy Wingo, 2017/12/27