[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 10/21: Always emit return-values
From: |
Andy Wingo |
Subject: |
[Guile-commits] 10/21: Always emit return-values |
Date: |
Wed, 28 Oct 2015 22:31:18 +0000 |
wingo pushed a commit to branch wip-2.1.2
in repository guile.
commit 696339a603b08d2b6a8f87482f63ef41358988e7
Author: Andy Wingo <address@hidden>
Date: Wed Oct 28 11:20:00 2015 +0000
Always emit return-values
* module/language/cps/compile-bytecode.scm (compile-function): Remove
special cases for nullary and unary returns; instead always use
return-values and rely on hinting to try to place values in the right
slot already.
* module/system/vm/assembler.scm (emit-init-constants): Use
return-values.
* module/system/vm/disassembler.scm (code-annotation): Add annotation
for return-values.
---
module/language/cps/compile-bytecode.scm | 10 ----------
module/system/vm/assembler.scm | 4 ++--
module/system/vm/disassembler.scm | 4 ++++
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/module/language/cps/compile-bytecode.scm
b/module/language/cps/compile-bytecode.scm
index 22af821..1f7c664 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -122,16 +122,6 @@
((src . dst) (emit-mov asm (from-sp dst) (from-sp src))))
(lookup-parallel-moves label allocation))
(emit-tail-call-label asm (1+ (length args)) k))
- (($ $values ())
- (emit-return-values asm 1))
- (($ $values (arg))
- (if (maybe-slot arg)
- (emit-return asm (from-sp (slot arg)))
- (begin
- (when (< frame-size 2)
- (emit-alloc-frame asm 2))
- (emit-load-constant asm (from-sp 1) (constant arg))
- (emit-return asm (from-sp 1)))))
(($ $values args)
(for-each (match-lambda
((src . dst) (emit-mov asm (from-sp dst) (from-sp src))))
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index d50ab13..c989ec6 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -1243,8 +1243,8 @@ a procedure to do that and return its label. Otherwise
return
`((begin-program ,label ())
(assert-nargs-ee/locals 1 1)
,@(reverse inits)
- (load-constant 1 ,*unspecified*)
- (return 1)
+ (load-constant 0 ,*unspecified*)
+ (return-values 2)
(end-program)))
label))))
diff --git a/module/system/vm/disassembler.scm
b/module/system/vm/disassembler.scm
index 233ba75..5e8b020 100644
--- a/module/system/vm/disassembler.scm
+++ b/module/system/vm/disassembler.scm
@@ -224,6 +224,10 @@ address of that offset."
(list "~a slot~:p" nlocals))
(('reset-frame nlocals)
(list "~a slot~:p" nlocals))
+ (('return-values nlocals)
+ (if (zero? nlocals)
+ (list "all values")
+ (list "~a value~:p" (1- nlocals))))
(('bind-rest dst)
(list "~a slot~:p" (1+ dst)))
(('tail-call nargs proc)
- [Guile-commits] branch wip-2.1.2 created (now b5b6721), Andy Wingo, 2015/10/28
- [Guile-commits] 01/21: Release v2.1.1, Andy Wingo, 2015/10/28
- [Guile-commits] 02/21: Bootstrap build doesn't have to expand CPS optimizations, Andy Wingo, 2015/10/28
- [Guile-commits] 05/21: Run CSE to clean up after closure conversion, Andy Wingo, 2015/10/28
- [Guile-commits] 03/21: Revert "Bootstrap build doesn't have to expand CPS optimizations", Andy Wingo, 2015/10/28
- [Guile-commits] 06/21: Fix slot-allocation to make 'return' not need to alloc-frame, Andy Wingo, 2015/10/28
- [Guile-commits] 08/21: Don't emit redundant reset-frame before return, Andy Wingo, 2015/10/28
- [Guile-commits] 07/21: return-values opcode resets the frame, Andy Wingo, 2015/10/28
- [Guile-commits] 11/21: rtl.test uses return-values, Andy Wingo, 2015/10/28
- [Guile-commits] 10/21: Always emit return-values,
Andy Wingo <=
- [Guile-commits] 12/21: Remove use of return in disassembler.scm, Andy Wingo, 2015/10/28
- [Guile-commits] 04/21: CSE can run on first-order CPS, Andy Wingo, 2015/10/28
- [Guile-commits] 09/21: Replace return primcalls with $values, Andy Wingo, 2015/10/28
- [Guile-commits] 13/21: Remove return opcode, Andy Wingo, 2015/10/28
- [Guile-commits] 14/21: Treat tail $values as generating lazy allocations, Andy Wingo, 2015/10/28
- [Guile-commits] 17/21: Stack slots can hold a double, Andy Wingo, 2015/10/28
- [Guile-commits] 18/21: Add VM ops to pack and unpack raw f64 values., Andy Wingo, 2015/10/28
- [Guile-commits] 21/21: Scalar replacement for f64->scm, Andy Wingo, 2015/10/28
- [Guile-commits] 20/21: bv-f32-set!, bv-f64-set! take unboxed args, Andy Wingo, 2015/10/28
- [Guile-commits] 15/21: VM support for raw slots, Andy Wingo, 2015/10/28