summaryrefslogtreecommitdiff
path: root/module/language/bytecode
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-12-02 21:31:47 +0100
committerAndy Wingo <wingo@pobox.com>2013-12-02 21:31:47 +0100
commit691697de0937c52488952c1d79d3ba4416ccbb0f (patch)
treee7ca4f8431b61523cdb5f47eac261375d6d2edaf /module/language/bytecode
parent7f710308376126e415d109e302d7b4013326d712 (diff)
downloadguile-691697de0937c52488952c1d79d3ba4416ccbb0f.tar.gz
Rename "RTL" to "bytecode"
"RTL" didn't make any sense, and now that there's no other bytecode to disambiguate against, just call it bytecode. * module/Makefile.am: * module/ice-9/eval-string.scm: * module/language/bytecode.scm: * module/language/bytecode/spec.scm: * module/language/cps/arities.scm: * module/language/cps/compile-bytecode.scm: * module/language/cps/compile-rtl.scm: * module/language/cps/contification.scm: * module/language/cps/elide-values.scm: * module/language/cps/primitives.scm: * module/language/cps/reify-primitives.scm: * module/language/cps/spec.scm: * module/language/cps/specialize-primcalls.scm: * module/language/rtl.scm: * module/language/rtl/spec.scm: * module/scripts/compile.scm: * module/system/base/compile.scm: * module/system/repl/common.scm: * module/system/vm/assembler.scm: * module/system/vm/debug.scm: * module/system/vm/disassembler.scm: * module/system/vm/dwarf.scm: * test-suite/tests/cross-compilation.test: * test-suite/tests/dwarf.test: * test-suite/tests/rtl-compilation.test: * test-suite/tests/rtl.test: * test-suite/vm/run-vm-tests.scm: Fixups.
Diffstat (limited to 'module/language/bytecode')
-rw-r--r--module/language/bytecode/spec.scm42
1 files changed, 42 insertions, 0 deletions
diff --git a/module/language/bytecode/spec.scm b/module/language/bytecode/spec.scm
new file mode 100644
index 000000000..89256c5c2
--- /dev/null
+++ b/module/language/bytecode/spec.scm
@@ -0,0 +1,42 @@
+;;; Bytecode
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; This library is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;;; Lesser General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+;;; Code:
+
+(define-module (language bytecode spec)
+ #:use-module (system base language)
+ #:use-module (system vm loader)
+ #:use-module (ice-9 binary-ports)
+ #:export (bytecode))
+
+(define (bytecode->value x e opts)
+ (let ((thunk (load-thunk-from-memory x)))
+ (if (eq? e (current-module))
+ ;; save a cons in this case
+ (values (thunk) e e)
+ (save-module-excursion
+ (lambda ()
+ (set-current-module e)
+ (values (thunk) e e))))))
+
+(define-language bytecode
+ #:title "Bytecode"
+ #:compilers `((value . ,bytecode->value))
+ #:printer (lambda (bytecode port) (put-bytevector port bytecode))
+ #:reader get-bytevector-all
+ #:for-humans? #f)