LilyPond-Ruby 0.0.2.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/etc/fonts/conf.d/10-hinting-slight.conf +15 -0
- data/etc/fonts/conf.d/10-scale-bitmap-fonts.conf +83 -0
- data/etc/fonts/conf.d/11-lcdfilter-default.conf +17 -0
- data/etc/fonts/conf.d/20-unhint-small-vera.conf +49 -0
- data/etc/fonts/conf.d/30-metric-aliases.conf +637 -0
- data/etc/fonts/conf.d/40-nonlatin.conf +332 -0
- data/etc/fonts/conf.d/45-generic.conf +136 -0
- data/etc/fonts/conf.d/45-latin.conf +301 -0
- data/etc/fonts/conf.d/48-spacing.conf +16 -0
- data/etc/fonts/conf.d/49-sansserif.conf +22 -0
- data/etc/fonts/conf.d/50-user.conf +16 -0
- data/etc/fonts/conf.d/51-local.conf +7 -0
- data/etc/fonts/conf.d/60-generic.conf +64 -0
- data/etc/fonts/conf.d/60-latin.conf +88 -0
- data/etc/fonts/conf.d/65-fonts-persian.conf +418 -0
- data/etc/fonts/conf.d/65-nonlatin.conf +228 -0
- data/etc/fonts/conf.d/69-unifont.conf +28 -0
- data/etc/fonts/conf.d/80-delicious.conf +19 -0
- data/etc/fonts/conf.d/90-synthetic.conf +64 -0
- data/etc/fonts/conf.d/README +23 -0
- data/etc/fonts/fonts.conf +101 -0
- data/etc/relocate/fontconfig.reloc +2 -0
- data/etc/relocate/guile.reloc +2 -0
- data/etc/relocate/libexec.reloc +1 -0
- data/lib/guile/2.2/ccache/ice-9/and-let-star.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/arrays.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/atomic.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/binary-ports.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/boot-9.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/buffered-input.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/calling.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/channel.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/command-line.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/common-list.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/control.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/curried-definitions.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/debug.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/deprecated.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/documentation.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/eval-string.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/eval.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/expect.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/fdes-finalizers.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/format.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/ftw.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/futures.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/gap-buffer.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/getopt-long.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/hash-table.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/hcons.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/history.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/i18n.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/iconv.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/lineio.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/list.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/local-eval.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/ls.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/mapping.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/match.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/networking.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/null.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/occam-channel.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/optargs.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg/cache.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg/codegen.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg/simplify-tree.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg/string-peg.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg/using-parsers.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/peg.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/poe.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/poll.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/popen.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/ports.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/posix.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/pretty-print.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/psyntax-pp.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/q.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/r5rs.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/rdelim.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/receive.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/regex.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/runq.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/rw.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/safe-r5rs.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/safe.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/sandbox.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/save-stack.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/scm-style-repl.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/serialize.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/session.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/slib.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/stack-catch.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/streams.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/string-fun.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/suspendable-ports.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/syncase.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/textual-ports.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/threads.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/time.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/top-repl.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/unicode.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/vlist.go +0 -0
- data/lib/guile/2.2/ccache/ice-9/weak-vector.go +0 -0
- data/lib/guile/2.2/ccache/language/brainfuck/compile-scheme.go +0 -0
- data/lib/guile/2.2/ccache/language/brainfuck/compile-tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/brainfuck/parse.go +0 -0
- data/lib/guile/2.2/ccache/language/brainfuck/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/bytecode/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/bytecode.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/closure-conversion.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/compile-bytecode.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/constructors.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/contification.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/cse.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/dce.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/effects-analysis.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/elide-values.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/handle-interrupts.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/intmap.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/intset.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/licm.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/optimize.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/peel-loops.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/primitives.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/prune-bailouts.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/prune-top-level-scopes.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/reify-primitives.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/renumber.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/rotate-loops.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/self-references.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/simplify.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/slot-allocation.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/specialize-numbers.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/specialize-primcalls.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/split-rec.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/type-checks.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/type-fold.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/types.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/utils.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/verify.go +0 -0
- data/lib/guile/2.2/ccache/language/cps/with-cps.go +0 -0
- data/lib/guile/2.2/ccache/language/cps.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/array.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/base.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/compile-tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/function.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/impl.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/parse.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/ecmascript/tokenize.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/bindings.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/boot.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/compile-tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/falias.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/lexer.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/parser.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/runtime/function-slot.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/runtime/value-slot.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/runtime.go +0 -0
- data/lib/guile/2.2/ccache/language/elisp/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/scheme/compile-tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/scheme/decompile-tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/scheme/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/analyze.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/canonicalize.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/compile-cps.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/debug.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/effects.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/fix-letrec.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/optimize.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/peval.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/primitives.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il/spec.go +0 -0
- data/lib/guile/2.2/ccache/language/tree-il.go +0 -0
- data/lib/guile/2.2/ccache/language/value/spec.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/accessors.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/active-slot.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/composite-slot.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/describe.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/internal.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/save.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/simple.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops/stklos.go +0 -0
- data/lib/guile/2.2/ccache/oop/goops.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/arithmetic/bitwise.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/arithmetic/fixnums.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/arithmetic/flonums.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/base.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/bytevectors.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/conditions.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/control.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/enums.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/eval.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/exceptions.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/files.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/hashtables.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/io/ports.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/io/simple.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/lists.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/mutable-pairs.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/mutable-strings.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/programs.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/r5rs.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/records/inspection.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/records/procedural.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/records/syntactic.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/sorting.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/syntax-case.go +0 -0
- data/lib/guile/2.2/ccache/rnrs/unicode.go +0 -0
- data/lib/guile/2.2/ccache/rnrs.go +0 -0
- data/lib/guile/2.2/ccache/scripts/api-diff.go +0 -0
- data/lib/guile/2.2/ccache/scripts/autofrisk.go +0 -0
- data/lib/guile/2.2/ccache/scripts/compile.go +0 -0
- data/lib/guile/2.2/ccache/scripts/disassemble.go +0 -0
- data/lib/guile/2.2/ccache/scripts/display-commentary.go +0 -0
- data/lib/guile/2.2/ccache/scripts/doc-snarf.go +0 -0
- data/lib/guile/2.2/ccache/scripts/frisk.go +0 -0
- data/lib/guile/2.2/ccache/scripts/generate-autoload.go +0 -0
- data/lib/guile/2.2/ccache/scripts/help.go +0 -0
- data/lib/guile/2.2/ccache/scripts/lint.go +0 -0
- data/lib/guile/2.2/ccache/scripts/list.go +0 -0
- data/lib/guile/2.2/ccache/scripts/punify.go +0 -0
- data/lib/guile/2.2/ccache/scripts/read-rfc822.go +0 -0
- data/lib/guile/2.2/ccache/scripts/read-scheme-source.go +0 -0
- data/lib/guile/2.2/ccache/scripts/read-text-outline.go +0 -0
- data/lib/guile/2.2/ccache/scripts/scan-api.go +0 -0
- data/lib/guile/2.2/ccache/scripts/snarf-check-and-output-texi.go +0 -0
- data/lib/guile/2.2/ccache/scripts/snarf-guile-m4-docs.go +0 -0
- data/lib/guile/2.2/ccache/scripts/summarize-guile-TODO.go +0 -0
- data/lib/guile/2.2/ccache/scripts/use2dot.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-1.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-10.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-11.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-111.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-13.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-14.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-16.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-17.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-18.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-19.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-2.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-26.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-27.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-28.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-31.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-34.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-35.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-37.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-38.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-39.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-4/gnu.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-4.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-41.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-42.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-43.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-45.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-6.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-60.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-64.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-67.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-69.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-71.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-8.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-88.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-9/gnu.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-9.go +0 -0
- data/lib/guile/2.2/ccache/srfi/srfi-98.go +0 -0
- data/lib/guile/2.2/ccache/statprof.go +0 -0
- data/lib/guile/2.2/ccache/sxml/apply-templates.go +0 -0
- data/lib/guile/2.2/ccache/sxml/fold.go +0 -0
- data/lib/guile/2.2/ccache/sxml/match.go +0 -0
- data/lib/guile/2.2/ccache/sxml/simple.go +0 -0
- data/lib/guile/2.2/ccache/sxml/ssax/input-parse.go +0 -0
- data/lib/guile/2.2/ccache/sxml/ssax.go +0 -0
- data/lib/guile/2.2/ccache/sxml/transform.go +0 -0
- data/lib/guile/2.2/ccache/sxml/xpath.go +0 -0
- data/lib/guile/2.2/ccache/system/base/ck.go +0 -0
- data/lib/guile/2.2/ccache/system/base/compile.go +0 -0
- data/lib/guile/2.2/ccache/system/base/lalr.go +0 -0
- data/lib/guile/2.2/ccache/system/base/language.go +0 -0
- data/lib/guile/2.2/ccache/system/base/message.go +0 -0
- data/lib/guile/2.2/ccache/system/base/pmatch.go +0 -0
- data/lib/guile/2.2/ccache/system/base/syntax.go +0 -0
- data/lib/guile/2.2/ccache/system/base/target.go +0 -0
- data/lib/guile/2.2/ccache/system/base/types.go +0 -0
- data/lib/guile/2.2/ccache/system/foreign-object.go +0 -0
- data/lib/guile/2.2/ccache/system/foreign.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/command.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/common.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/coop-server.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/debug.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/error-handling.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/repl.go +0 -0
- data/lib/guile/2.2/ccache/system/repl/server.go +0 -0
- data/lib/guile/2.2/ccache/system/syntax.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/assembler.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/coverage.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/debug.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/disassembler.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/dwarf.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/elf.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/frame.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/inspect.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/linker.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/loader.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/program.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/trace.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/trap-state.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/traps.go +0 -0
- data/lib/guile/2.2/ccache/system/vm/vm.go +0 -0
- data/lib/guile/2.2/ccache/system/xref.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/docbook.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/html.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/indexing.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/plain-text.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/reflection.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/serialize.go +0 -0
- data/lib/guile/2.2/ccache/texinfo/string-utils.go +0 -0
- data/lib/guile/2.2/ccache/texinfo.go +0 -0
- data/lib/guile/2.2/ccache/web/client.go +0 -0
- data/lib/guile/2.2/ccache/web/http.go +0 -0
- data/lib/guile/2.2/ccache/web/request.go +0 -0
- data/lib/guile/2.2/ccache/web/response.go +0 -0
- data/lib/guile/2.2/ccache/web/server/http.go +0 -0
- data/lib/guile/2.2/ccache/web/server.go +0 -0
- data/lib/guile/2.2/ccache/web/uri.go +0 -0
- data/lib/guile.rb +19 -0
- data/lib/lilypond/2.24.1/ccache/lily/accreg.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/auto-beam.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/autochange.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/backend-library.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/bar-line.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/breath.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/c++.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/chord-entry.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/chord-ignatzek-names.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/chord-name.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/clip-region.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/color.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/curried-definitions.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-context-properties.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-event-classes.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-grob-interfaces.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-grob-properties.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-grobs.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-markup-commands.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-music-callbacks.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-music-display-methods.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-music-properties.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-music-types.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-note-names.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-stencil-commands.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/define-woodwind-diagrams.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/display-lily.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/display-woodwind-diagrams.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/file-cache.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/flag-styles.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/font-encodings.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/font.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/framework-cairo.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/framework-ps.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/framework-svg.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/fret-diagrams.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/graphviz.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/harp-pedals.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/layout-beam.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/layout-slur.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/lily-library.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/lily.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/ly-syntax-constructors.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/markup-macros.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/markup.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/midi.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/modal-transforms.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/music-functions.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/output-lib.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/output-ps.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/output-svg.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/page.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/paper-system.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/paper.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/parser-clef.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/parser-ly-from-scheme.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/part-combiner.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/predefined-fretboards.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/ps-to-png.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/scheme-engravers.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/scheme-performers.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/script.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/skyline.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/song-util.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/song.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/stencil.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/tablature.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/time-signature-settings.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/time-signature.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/titling.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/to-xml.go +0 -0
- data/lib/lilypond/2.24.1/ccache/lily/translation-functions.go +0 -0
- data/lib/lilypond/builder.rb +161 -0
- data/lib/lilypond-ruby.rb +18 -3
- data/share/emacs/site-lisp/lilypond-font-lock.el +208 -0
- data/share/emacs/site-lisp/lilypond-indent.el +605 -0
- data/share/emacs/site-lisp/lilypond-init.el +21 -0
- data/share/emacs/site-lisp/lilypond-mode.el +1204 -0
- data/share/emacs/site-lisp/lilypond-song.el +556 -0
- data/share/emacs/site-lisp/lilypond-what-beat.el +279 -0
- data/share/emacs/site-lisp/lilypond-words.el +1428 -0
- data/share/guile/2.2/guile-procedures.txt +8860 -0
- data/share/guile/2.2/ice-9/and-let-star.scm +73 -0
- data/share/guile/2.2/ice-9/arrays.scm +70 -0
- data/share/guile/2.2/ice-9/atomic.scm +38 -0
- data/share/guile/2.2/ice-9/binary-ports.scm +53 -0
- data/share/guile/2.2/ice-9/boot-9.scm +4131 -0
- data/share/guile/2.2/ice-9/buffered-input.scm +109 -0
- data/share/guile/2.2/ice-9/calling.scm +326 -0
- data/share/guile/2.2/ice-9/channel.scm +170 -0
- data/share/guile/2.2/ice-9/command-line.scm +477 -0
- data/share/guile/2.2/ice-9/common-list.scm +278 -0
- data/share/guile/2.2/ice-9/control.scm +110 -0
- data/share/guile/2.2/ice-9/curried-definitions.scm +57 -0
- data/share/guile/2.2/ice-9/debug.scm +25 -0
- data/share/guile/2.2/ice-9/deprecated.scm +93 -0
- data/share/guile/2.2/ice-9/documentation.scm +203 -0
- data/share/guile/2.2/ice-9/eval-string.scm +90 -0
- data/share/guile/2.2/ice-9/eval.scm +723 -0
- data/share/guile/2.2/ice-9/expect.scm +171 -0
- data/share/guile/2.2/ice-9/fdes-finalizers.scm +25 -0
- data/share/guile/2.2/ice-9/format.scm +1626 -0
- data/share/guile/2.2/ice-9/ftw.scm +564 -0
- data/share/guile/2.2/ice-9/futures.scm +308 -0
- data/share/guile/2.2/ice-9/gap-buffer.scm +283 -0
- data/share/guile/2.2/ice-9/getopt-long.scm +371 -0
- data/share/guile/2.2/ice-9/hash-table.scm +45 -0
- data/share/guile/2.2/ice-9/hcons.scm +80 -0
- data/share/guile/2.2/ice-9/history.scm +65 -0
- data/share/guile/2.2/ice-9/i18n.scm +531 -0
- data/share/guile/2.2/ice-9/iconv.scm +95 -0
- data/share/guile/2.2/ice-9/lineio.scm +115 -0
- data/share/guile/2.2/ice-9/list.scm +36 -0
- data/share/guile/2.2/ice-9/local-eval.scm +261 -0
- data/share/guile/2.2/ice-9/ls.scm +94 -0
- data/share/guile/2.2/ice-9/mapping.scm +118 -0
- data/share/guile/2.2/ice-9/match.scm +59 -0
- data/share/guile/2.2/ice-9/match.upstream.scm +917 -0
- data/share/guile/2.2/ice-9/networking.scm +94 -0
- data/share/guile/2.2/ice-9/null.scm +34 -0
- data/share/guile/2.2/ice-9/occam-channel.scm +261 -0
- data/share/guile/2.2/ice-9/optargs.scm +381 -0
- data/share/guile/2.2/ice-9/peg/cache.scm +45 -0
- data/share/guile/2.2/ice-9/peg/codegen.scm +359 -0
- data/share/guile/2.2/ice-9/peg/simplify-tree.scm +97 -0
- data/share/guile/2.2/ice-9/peg/string-peg.scm +273 -0
- data/share/guile/2.2/ice-9/peg/using-parsers.scm +116 -0
- data/share/guile/2.2/ice-9/peg.scm +42 -0
- data/share/guile/2.2/ice-9/poe.scm +116 -0
- data/share/guile/2.2/ice-9/poll.scm +172 -0
- data/share/guile/2.2/ice-9/popen.scm +178 -0
- data/share/guile/2.2/ice-9/ports.scm +566 -0
- data/share/guile/2.2/ice-9/posix.scm +75 -0
- data/share/guile/2.2/ice-9/pretty-print.scm +483 -0
- data/share/guile/2.2/ice-9/psyntax-pp.scm +3542 -0
- data/share/guile/2.2/ice-9/psyntax.scm +3326 -0
- data/share/guile/2.2/ice-9/q.scm +153 -0
- data/share/guile/2.2/ice-9/quasisyntax.scm +136 -0
- data/share/guile/2.2/ice-9/r5rs.scm +45 -0
- data/share/guile/2.2/ice-9/r6rs-libraries.scm +242 -0
- data/share/guile/2.2/ice-9/rdelim.scm +208 -0
- data/share/guile/2.2/ice-9/receive.scm +26 -0
- data/share/guile/2.2/ice-9/regex.scm +229 -0
- data/share/guile/2.2/ice-9/runq.scm +241 -0
- data/share/guile/2.2/ice-9/rw.scm +27 -0
- data/share/guile/2.2/ice-9/safe-r5rs.scm +145 -0
- data/share/guile/2.2/ice-9/safe.scm +34 -0
- data/share/guile/2.2/ice-9/sandbox.scm +1399 -0
- data/share/guile/2.2/ice-9/save-stack.scm +58 -0
- data/share/guile/2.2/ice-9/scm-style-repl.scm +279 -0
- data/share/guile/2.2/ice-9/serialize.scm +114 -0
- data/share/guile/2.2/ice-9/session.scm +530 -0
- data/share/guile/2.2/ice-9/slib.scm +33 -0
- data/share/guile/2.2/ice-9/stack-catch.scm +47 -0
- data/share/guile/2.2/ice-9/streams.scm +168 -0
- data/share/guile/2.2/ice-9/string-fun.scm +280 -0
- data/share/guile/2.2/ice-9/suspendable-ports.scm +788 -0
- data/share/guile/2.2/ice-9/syncase.scm +37 -0
- data/share/guile/2.2/ice-9/textual-ports.scm +70 -0
- data/share/guile/2.2/ice-9/threads.scm +392 -0
- data/share/guile/2.2/ice-9/time.scm +58 -0
- data/share/guile/2.2/ice-9/top-repl.scm +78 -0
- data/share/guile/2.2/ice-9/unicode.scm +26 -0
- data/share/guile/2.2/ice-9/vlist.scm +595 -0
- data/share/guile/2.2/ice-9/weak-vector.scm +31 -0
- data/share/guile/2.2/language/brainfuck/compile-scheme.scm +123 -0
- data/share/guile/2.2/language/brainfuck/compile-tree-il.scm +184 -0
- data/share/guile/2.2/language/brainfuck/parse.scm +95 -0
- data/share/guile/2.2/language/brainfuck/spec.scm +43 -0
- data/share/guile/2.2/language/bytecode/spec.scm +42 -0
- data/share/guile/2.2/language/bytecode.scm +104 -0
- data/share/guile/2.2/language/cps/closure-conversion.scm +848 -0
- data/share/guile/2.2/language/cps/compile-bytecode.scm +610 -0
- data/share/guile/2.2/language/cps/constructors.scm +106 -0
- data/share/guile/2.2/language/cps/contification.scm +448 -0
- data/share/guile/2.2/language/cps/cse.scm +414 -0
- data/share/guile/2.2/language/cps/dce.scm +363 -0
- data/share/guile/2.2/language/cps/effects-analysis.scm +597 -0
- data/share/guile/2.2/language/cps/elide-values.scm +88 -0
- data/share/guile/2.2/language/cps/handle-interrupts.scm +69 -0
- data/share/guile/2.2/language/cps/intmap.scm +765 -0
- data/share/guile/2.2/language/cps/intset.scm +830 -0
- data/share/guile/2.2/language/cps/licm.scm +308 -0
- data/share/guile/2.2/language/cps/optimize.scm +135 -0
- data/share/guile/2.2/language/cps/peel-loops.scm +287 -0
- data/share/guile/2.2/language/cps/primitives.scm +141 -0
- data/share/guile/2.2/language/cps/prune-bailouts.scm +86 -0
- data/share/guile/2.2/language/cps/prune-top-level-scopes.scm +63 -0
- data/share/guile/2.2/language/cps/reify-primitives.scm +179 -0
- data/share/guile/2.2/language/cps/renumber.scm +217 -0
- data/share/guile/2.2/language/cps/rotate-loops.scm +239 -0
- data/share/guile/2.2/language/cps/self-references.scm +79 -0
- data/share/guile/2.2/language/cps/simplify.scm +274 -0
- data/share/guile/2.2/language/cps/slot-allocation.scm +1058 -0
- data/share/guile/2.2/language/cps/spec.scm +51 -0
- data/share/guile/2.2/language/cps/specialize-numbers.scm +724 -0
- data/share/guile/2.2/language/cps/specialize-primcalls.scm +87 -0
- data/share/guile/2.2/language/cps/split-rec.scm +174 -0
- data/share/guile/2.2/language/cps/type-checks.scm +72 -0
- data/share/guile/2.2/language/cps/type-fold.scm +455 -0
- data/share/guile/2.2/language/cps/types.scm +1826 -0
- data/share/guile/2.2/language/cps/utils.scm +550 -0
- data/share/guile/2.2/language/cps/verify.scm +304 -0
- data/share/guile/2.2/language/cps/with-cps.scm +145 -0
- data/share/guile/2.2/language/cps.scm +358 -0
- data/share/guile/2.2/language/ecmascript/array.scm +121 -0
- data/share/guile/2.2/language/ecmascript/base.scm +251 -0
- data/share/guile/2.2/language/ecmascript/compile-tree-il.scm +576 -0
- data/share/guile/2.2/language/ecmascript/function.scm +78 -0
- data/share/guile/2.2/language/ecmascript/impl.scm +169 -0
- data/share/guile/2.2/language/ecmascript/parse.scm +352 -0
- data/share/guile/2.2/language/ecmascript/spec.scm +37 -0
- data/share/guile/2.2/language/ecmascript/tokenize.scm +513 -0
- data/share/guile/2.2/language/elisp/bindings.scm +107 -0
- data/share/guile/2.2/language/elisp/boot.el +617 -0
- data/share/guile/2.2/language/elisp/compile-tree-il.scm +812 -0
- data/share/guile/2.2/language/elisp/falias.scm +47 -0
- data/share/guile/2.2/language/elisp/lexer.scm +430 -0
- data/share/guile/2.2/language/elisp/parser.scm +222 -0
- data/share/guile/2.2/language/elisp/runtime/function-slot.scm +63 -0
- data/share/guile/2.2/language/elisp/runtime/value-slot.scm +24 -0
- data/share/guile/2.2/language/elisp/runtime.scm +153 -0
- data/share/guile/2.2/language/elisp/spec.scm +43 -0
- data/share/guile/2.2/language/scheme/compile-tree-il.scm +33 -0
- data/share/guile/2.2/language/scheme/decompile-tree-il.scm +796 -0
- data/share/guile/2.2/language/scheme/spec.scm +63 -0
- data/share/guile/2.2/language/tree-il/analyze.scm +1568 -0
- data/share/guile/2.2/language/tree-il/canonicalize.scm +82 -0
- data/share/guile/2.2/language/tree-il/compile-cps.scm +1149 -0
- data/share/guile/2.2/language/tree-il/debug.scm +246 -0
- data/share/guile/2.2/language/tree-il/effects.scm +591 -0
- data/share/guile/2.2/language/tree-il/fix-letrec.scm +314 -0
- data/share/guile/2.2/language/tree-il/optimize.scm +43 -0
- data/share/guile/2.2/language/tree-il/peval.scm +1669 -0
- data/share/guile/2.2/language/tree-il/primitives.scm +630 -0
- data/share/guile/2.2/language/tree-il/spec.scm +46 -0
- data/share/guile/2.2/language/tree-il.scm +630 -0
- data/share/guile/2.2/language/value/spec.scm +30 -0
- data/share/guile/2.2/oop/goops/accessors.scm +72 -0
- data/share/guile/2.2/oop/goops/active-slot.scm +63 -0
- data/share/guile/2.2/oop/goops/composite-slot.scm +83 -0
- data/share/guile/2.2/oop/goops/describe.scm +189 -0
- data/share/guile/2.2/oop/goops/internal.scm +30 -0
- data/share/guile/2.2/oop/goops/save.scm +874 -0
- data/share/guile/2.2/oop/goops/simple.scm +30 -0
- data/share/guile/2.2/oop/goops/stklos.scm +74 -0
- data/share/guile/2.2/oop/goops.scm +3176 -0
- data/share/guile/2.2/rnrs/arithmetic/bitwise.scm +92 -0
- data/share/guile/2.2/rnrs/arithmetic/fixnums.scm +291 -0
- data/share/guile/2.2/rnrs/arithmetic/flonums.scm +203 -0
- data/share/guile/2.2/rnrs/base.scm +291 -0
- data/share/guile/2.2/rnrs/bytevectors.scm +83 -0
- data/share/guile/2.2/rnrs/conditions.scm +225 -0
- data/share/guile/2.2/rnrs/control.scm +22 -0
- data/share/guile/2.2/rnrs/enums.scm +152 -0
- data/share/guile/2.2/rnrs/eval.scm +39 -0
- data/share/guile/2.2/rnrs/exceptions.scm +276 -0
- data/share/guile/2.2/rnrs/files.scm +96 -0
- data/share/guile/2.2/rnrs/hashtables.scm +190 -0
- data/share/guile/2.2/rnrs/io/ports.scm +554 -0
- data/share/guile/2.2/rnrs/io/simple.scm +167 -0
- data/share/guile/2.2/rnrs/lists.scm +55 -0
- data/share/guile/2.2/rnrs/mutable-pairs.scm +23 -0
- data/share/guile/2.2/rnrs/mutable-strings.scm +23 -0
- data/share/guile/2.2/rnrs/programs.scm +22 -0
- data/share/guile/2.2/rnrs/r5rs.scm +34 -0
- data/share/guile/2.2/rnrs/records/inspection.scm +81 -0
- data/share/guile/2.2/rnrs/records/procedural.scm +289 -0
- data/share/guile/2.2/rnrs/records/syntactic.scm +248 -0
- data/share/guile/2.2/rnrs/sorting.scm +27 -0
- data/share/guile/2.2/rnrs/syntax-case.scm +68 -0
- data/share/guile/2.2/rnrs/unicode.scm +104 -0
- data/share/guile/2.2/rnrs.scm +289 -0
- data/share/guile/2.2/scripts/api-diff.scm +179 -0
- data/share/guile/2.2/scripts/autofrisk.scm +218 -0
- data/share/guile/2.2/scripts/compile.scm +273 -0
- data/share/guile/2.2/scripts/disassemble.scm +38 -0
- data/share/guile/2.2/scripts/display-commentary.scm +67 -0
- data/share/guile/2.2/scripts/doc-snarf.scm +439 -0
- data/share/guile/2.2/scripts/frisk.scm +290 -0
- data/share/guile/2.2/scripts/generate-autoload.scm +144 -0
- data/share/guile/2.2/scripts/help.scm +188 -0
- data/share/guile/2.2/scripts/lint.scm +318 -0
- data/share/guile/2.2/scripts/list.scm +91 -0
- data/share/guile/2.2/scripts/punify.scm +87 -0
- data/share/guile/2.2/scripts/read-rfc822.scm +131 -0
- data/share/guile/2.2/scripts/read-scheme-source.scm +282 -0
- data/share/guile/2.2/scripts/read-text-outline.scm +253 -0
- data/share/guile/2.2/scripts/scan-api.scm +223 -0
- data/share/guile/2.2/scripts/snarf-check-and-output-texi.scm +303 -0
- data/share/guile/2.2/scripts/snarf-guile-m4-docs.scm +86 -0
- data/share/guile/2.2/scripts/summarize-guile-TODO.scm +213 -0
- data/share/guile/2.2/scripts/use2dot.scm +110 -0
- data/share/guile/2.2/srfi/srfi-1.scm +1061 -0
- data/share/guile/2.2/srfi/srfi-10.scm +89 -0
- data/share/guile/2.2/srfi/srfi-11.scm +146 -0
- data/share/guile/2.2/srfi/srfi-111.scm +37 -0
- data/share/guile/2.2/srfi/srfi-13.scm +132 -0
- data/share/guile/2.2/srfi/srfi-14.scm +99 -0
- data/share/guile/2.2/srfi/srfi-16.scm +51 -0
- data/share/guile/2.2/srfi/srfi-17.scm +174 -0
- data/share/guile/2.2/srfi/srfi-18.scm +382 -0
- data/share/guile/2.2/srfi/srfi-19.scm +1470 -0
- data/share/guile/2.2/srfi/srfi-2.scm +31 -0
- data/share/guile/2.2/srfi/srfi-26.scm +66 -0
- data/share/guile/2.2/srfi/srfi-27.scm +96 -0
- data/share/guile/2.2/srfi/srfi-28.scm +34 -0
- data/share/guile/2.2/srfi/srfi-31.scm +35 -0
- data/share/guile/2.2/srfi/srfi-34.scm +84 -0
- data/share/guile/2.2/srfi/srfi-35.scm +351 -0
- data/share/guile/2.2/srfi/srfi-37.scm +234 -0
- data/share/guile/2.2/srfi/srfi-38.scm +207 -0
- data/share/guile/2.2/srfi/srfi-39.scm +55 -0
- data/share/guile/2.2/srfi/srfi-4/gnu.scm +80 -0
- data/share/guile/2.2/srfi/srfi-4.scm +118 -0
- data/share/guile/2.2/srfi/srfi-41.scm +505 -0
- data/share/guile/2.2/srfi/srfi-42/ec.scm +1053 -0
- data/share/guile/2.2/srfi/srfi-42.scm +66 -0
- data/share/guile/2.2/srfi/srfi-43.scm +1077 -0
- data/share/guile/2.2/srfi/srfi-45.scm +93 -0
- data/share/guile/2.2/srfi/srfi-6.scm +29 -0
- data/share/guile/2.2/srfi/srfi-60.scm +73 -0
- data/share/guile/2.2/srfi/srfi-64/testing.scm +1040 -0
- data/share/guile/2.2/srfi/srfi-64.scm +55 -0
- data/share/guile/2.2/srfi/srfi-67/compare.scm +686 -0
- data/share/guile/2.2/srfi/srfi-67.scm +88 -0
- data/share/guile/2.2/srfi/srfi-69.scm +336 -0
- data/share/guile/2.2/srfi/srfi-71.scm +267 -0
- data/share/guile/2.2/srfi/srfi-8.scm +31 -0
- data/share/guile/2.2/srfi/srfi-88.scm +53 -0
- data/share/guile/2.2/srfi/srfi-9/gnu.scm +168 -0
- data/share/guile/2.2/srfi/srfi-9.scm +351 -0
- data/share/guile/2.2/srfi/srfi-98.scm +44 -0
- data/share/guile/2.2/statprof.scm +988 -0
- data/share/guile/2.2/sxml/apply-templates.scm +102 -0
- data/share/guile/2.2/sxml/fold.scm +250 -0
- data/share/guile/2.2/sxml/match.scm +75 -0
- data/share/guile/2.2/sxml/simple.scm +408 -0
- data/share/guile/2.2/sxml/ssax/input-parse.scm +180 -0
- data/share/guile/2.2/sxml/ssax.scm +265 -0
- data/share/guile/2.2/sxml/sxml-match.ss +1181 -0
- data/share/guile/2.2/sxml/transform.scm +298 -0
- data/share/guile/2.2/sxml/upstream/SSAX.scm +3235 -0
- data/share/guile/2.2/sxml/upstream/SXML-tree-trans.scm +249 -0
- data/share/guile/2.2/sxml/upstream/SXPath-old.scm +1216 -0
- data/share/guile/2.2/sxml/upstream/assert.scm +35 -0
- data/share/guile/2.2/sxml/upstream/input-parse.scm +326 -0
- data/share/guile/2.2/sxml/xpath.scm +493 -0
- data/share/guile/2.2/system/base/ck.scm +55 -0
- data/share/guile/2.2/system/base/compile.scm +282 -0
- data/share/guile/2.2/system/base/lalr.scm +51 -0
- data/share/guile/2.2/system/base/lalr.upstream.scm +2096 -0
- data/share/guile/2.2/system/base/language.scm +119 -0
- data/share/guile/2.2/system/base/message.scm +238 -0
- data/share/guile/2.2/system/base/pmatch.scm +68 -0
- data/share/guile/2.2/system/base/syntax.scm +299 -0
- data/share/guile/2.2/system/base/target.scm +152 -0
- data/share/guile/2.2/system/base/types.scm +561 -0
- data/share/guile/2.2/system/foreign-object.scm +91 -0
- data/share/guile/2.2/system/foreign.scm +200 -0
- data/share/guile/2.2/system/repl/command.scm +946 -0
- data/share/guile/2.2/system/repl/common.scm +263 -0
- data/share/guile/2.2/system/repl/coop-server.scm +200 -0
- data/share/guile/2.2/system/repl/debug.scm +210 -0
- data/share/guile/2.2/system/repl/describe.scm +347 -0
- data/share/guile/2.2/system/repl/error-handling.scm +183 -0
- data/share/guile/2.2/system/repl/repl.scm +233 -0
- data/share/guile/2.2/system/repl/server.scm +332 -0
- data/share/guile/2.2/system/syntax.scm +33 -0
- data/share/guile/2.2/system/vm/assembler.scm +2614 -0
- data/share/guile/2.2/system/vm/coverage.scm +351 -0
- data/share/guile/2.2/system/vm/debug.scm +766 -0
- data/share/guile/2.2/system/vm/disassembler.scm +658 -0
- data/share/guile/2.2/system/vm/dwarf.scm +1852 -0
- data/share/guile/2.2/system/vm/elf.scm +1042 -0
- data/share/guile/2.2/system/vm/frame.scm +485 -0
- data/share/guile/2.2/system/vm/inspect.scm +188 -0
- data/share/guile/2.2/system/vm/linker.scm +732 -0
- data/share/guile/2.2/system/vm/loader.scm +27 -0
- data/share/guile/2.2/system/vm/program.scm +312 -0
- data/share/guile/2.2/system/vm/trace.scm +121 -0
- data/share/guile/2.2/system/vm/trap-state.scm +302 -0
- data/share/guile/2.2/system/vm/traps.scm +608 -0
- data/share/guile/2.2/system/vm/vm.scm +32 -0
- data/share/guile/2.2/system/xref.scm +369 -0
- data/share/guile/2.2/texinfo/docbook.scm +240 -0
- data/share/guile/2.2/texinfo/html.scm +279 -0
- data/share/guile/2.2/texinfo/indexing.scm +75 -0
- data/share/guile/2.2/texinfo/plain-text.scm +322 -0
- data/share/guile/2.2/texinfo/reflection.scm +585 -0
- data/share/guile/2.2/texinfo/serialize.scm +300 -0
- data/share/guile/2.2/texinfo/string-utils.scm +410 -0
- data/share/guile/2.2/texinfo.scm +1263 -0
- data/share/guile/2.2/web/client.scm +513 -0
- data/share/guile/2.2/web/http.scm +2043 -0
- data/share/guile/2.2/web/request.scm +326 -0
- data/share/guile/2.2/web/response.scm +379 -0
- data/share/guile/2.2/web/server/http.scm +183 -0
- data/share/guile/2.2/web/server.scm +397 -0
- data/share/guile/2.2/web/uri.scm +552 -0
- data/share/lilypond/2.24.1/fontconfig/0bd3dc0958fa2205aaaa8ebb13e2872b-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/188ac73a183f12857f63bb60a4a6d603-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/32b6488e5b8292a2e95c79d947e009e8-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/3f7329c5293ffd510edef78f73874cfd-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/57e423e26b20ab21d0f2f29c145174c3-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/826f6b6ef79022e2eac8af26bf4b62f2-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/95530828ff6c81d309f8258d8d02a23e-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/CACHEDIR.TAG +4 -0
- data/share/lilypond/2.24.1/fontconfig/bf3b770c553c462765856025a94f1ce6-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/c855463f699352c367813e37f3f70ea7-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/d3e5c4ee2ceb1fc347f91d4cefc53bc0-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/d82eb4fd963d448e2fcb7d7b793b5df3-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/e52a45a1c8c8fe895fc0fc8c4e6999b8-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fontconfig/f1f2465696798768e9653f19e17ccdc8-le64.cache-8 +0 -0
- data/share/lilypond/2.24.1/fonts/00-lilypond-fonts.conf +99 -0
- data/share/lilypond/2.24.1/fonts/99-lilypond-fonts.conf +28 -0
- data/share/lilypond/2.24.1/fonts/otf/C059-BdIta.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/C059-Bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/C059-Italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/C059-Roman.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-BoldItalic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusMonoPS-Regular.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusSans-BoldItalic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/NimbusSans-Regular.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-11.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-13.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-14.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-16.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-18.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-20.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-23.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-26.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/emmentaler-brace.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-bolditalic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyrecursor-regular.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreheros-bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreheros-bolditalic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreheros-italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreheros-regular.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreschola-bold.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreschola-bolditalic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreschola-italic.otf +0 -0
- data/share/lilypond/2.24.1/fonts/otf/texgyreschola-regular.otf +0 -0
- data/share/lilypond/2.24.1/fonts/source/common-modules-and-initialization.mf +26 -0
- data/share/lilypond/2.24.1/fonts/source/debugging-settings.mf +14 -0
- data/share/lilypond/2.24.1/fonts/source/declare-autometric-parameters.mf +9 -0
- data/share/lilypond/2.24.1/fonts/source/feta-accidentals.mf +58 -0
- data/share/lilypond/2.24.1/fonts/source/feta-accordion.mf +575 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet-generic.mf +16 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet20.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-alphabet26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-arrow.mf +114 -0
- data/share/lilypond/2.24.1/fonts/source/feta-arrowheads.mf +171 -0
- data/share/lilypond/2.24.1/fonts/source/feta-autometric.mf +303 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-a.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-b.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-c.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-d.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-e.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-f.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-g.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-generic.mf +47 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-h.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces-i.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-braces.mf +125 -0
- data/share/lilypond/2.24.1/fonts/source/feta-brackettips.mf +100 -0
- data/share/lilypond/2.24.1/fonts/source/feta-clefs.mf +963 -0
- data/share/lilypond/2.24.1/fonts/source/feta-dots.mf +37 -0
- data/share/lilypond/2.24.1/fonts/source/feta-dynamics.mf +891 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags-generic.mf +17 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags.mf +926 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags20.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flags26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-flats.mf +668 -0
- data/share/lilypond/2.24.1/fonts/source/feta-macros.mf +506 -0
- data/share/lilypond/2.24.1/fonts/source/feta-naturals.mf +223 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads-generic.mf +17 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads.mf +2642 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads20.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-noteheads26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta-numbers.mf +1677 -0
- data/share/lilypond/2.24.1/fonts/source/feta-other-generic.mf +27 -0
- data/share/lilypond/2.24.1/fonts/source/feta-params.mf +323 -0
- data/share/lilypond/2.24.1/fonts/source/feta-parenthesis.mf +63 -0
- data/share/lilypond/2.24.1/fonts/source/feta-pedals.mf +355 -0
- data/share/lilypond/2.24.1/fonts/source/feta-rests.mf +890 -0
- data/share/lilypond/2.24.1/fonts/source/feta-scripts.mf +2206 -0
- data/share/lilypond/2.24.1/fonts/source/feta-sharps.mf +524 -0
- data/share/lilypond/2.24.1/fonts/source/feta-sori-koron.mf +325 -0
- data/share/lilypond/2.24.1/fonts/source/feta-ties.mf +72 -0
- data/share/lilypond/2.24.1/fonts/source/feta-timesignatures.mf +119 -0
- data/share/lilypond/2.24.1/fonts/source/feta-trills.mf +321 -0
- data/share/lilypond/2.24.1/fonts/source/feta11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta20.mf +7 -0
- data/share/lilypond/2.24.1/fonts/source/feta23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/feta26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-accidentals.mf +483 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-clefs.mf +1636 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-custodes.mf +503 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-dots.mf +62 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-flags.mf +319 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-macros.mf +225 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads-generic.mf +16 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads.mf +2191 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads20.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-noteheads26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-other-generic.mf +24 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-rests.mf +428 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-scripts.mf +284 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan-timesignatures.mf +402 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan11.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan13.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan14.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan16.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan18.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan20.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan23.mf +6 -0
- data/share/lilypond/2.24.1/fonts/source/parmesan26.mf +6 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-11.svg +2525 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-11.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-13.svg +2530 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-13.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-14.svg +2526 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-14.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-16.svg +2523 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-16.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-18.svg +2519 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-18.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-20.svg +2512 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-20.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-23.svg +2506 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-23.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-26.svg +2510 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-26.woff +0 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-brace.svg +1757 -0
- data/share/lilypond/2.24.1/fonts/svg/emmentaler-brace.woff +0 -0
- data/share/lilypond/2.24.1/ly/Welcome_to_LilyPond.ly +45 -0
- data/share/lilypond/2.24.1/ly/arabic.ly +185 -0
- data/share/lilypond/2.24.1/ly/articulate.ly +1013 -0
- data/share/lilypond/2.24.1/ly/bagpipe.ly +368 -0
- data/share/lilypond/2.24.1/ly/base-tkit.ly +135 -0
- data/share/lilypond/2.24.1/ly/catalan.ly +23 -0
- data/share/lilypond/2.24.1/ly/chord-modifiers-init.ly +63 -0
- data/share/lilypond/2.24.1/ly/chord-repetition-init.ly +60 -0
- data/share/lilypond/2.24.1/ly/context-mods-init.ly +119 -0
- data/share/lilypond/2.24.1/ly/declarations-init.ly +167 -0
- data/share/lilypond/2.24.1/ly/deutsch.ly +23 -0
- data/share/lilypond/2.24.1/ly/drumpitch-init.ly +366 -0
- data/share/lilypond/2.24.1/ly/dynamic-scripts-init.ly +54 -0
- data/share/lilypond/2.24.1/ly/english.ly +23 -0
- data/share/lilypond/2.24.1/ly/engraver-init.ly +1619 -0
- data/share/lilypond/2.24.1/ly/espanol.ly +23 -0
- data/share/lilypond/2.24.1/ly/event-listener.ly +241 -0
- data/share/lilypond/2.24.1/ly/festival.ly +38 -0
- data/share/lilypond/2.24.1/ly/generate-documentation.ly +7 -0
- data/share/lilypond/2.24.1/ly/grace-init.ly +56 -0
- data/share/lilypond/2.24.1/ly/graphviz-init.ly +174 -0
- data/share/lilypond/2.24.1/ly/gregorian.ly +268 -0
- data/share/lilypond/2.24.1/ly/guile-debugger.ly +55 -0
- data/share/lilypond/2.24.1/ly/hel-arabic.ly +307 -0
- data/share/lilypond/2.24.1/ly/init.ly +96 -0
- data/share/lilypond/2.24.1/ly/italiano.ly +23 -0
- data/share/lilypond/2.24.1/ly/lilypond-book-preamble.ly +47 -0
- data/share/lilypond/2.24.1/ly/lyrics-tkit.ly +68 -0
- data/share/lilypond/2.24.1/ly/makam.ly +166 -0
- data/share/lilypond/2.24.1/ly/midi-init.ly +59 -0
- data/share/lilypond/2.24.1/ly/music-functions-init.ly +2254 -0
- data/share/lilypond/2.24.1/ly/nederlands.ly +23 -0
- data/share/lilypond/2.24.1/ly/norsk.ly +23 -0
- data/share/lilypond/2.24.1/ly/paper-defaults-init.ly +188 -0
- data/share/lilypond/2.24.1/ly/performer-init.ly +398 -0
- data/share/lilypond/2.24.1/ly/persian.ly +335 -0
- data/share/lilypond/2.24.1/ly/piano-tkit.ly +61 -0
- data/share/lilypond/2.24.1/ly/portugues.ly +23 -0
- data/share/lilypond/2.24.1/ly/predefined-fretboards-init.ly +78 -0
- data/share/lilypond/2.24.1/ly/predefined-guitar-fretboards.ly +506 -0
- data/share/lilypond/2.24.1/ly/predefined-guitar-ninth-fretboards.ly +75 -0
- data/share/lilypond/2.24.1/ly/predefined-mandolin-fretboards.ly +876 -0
- data/share/lilypond/2.24.1/ly/predefined-ukulele-fretboards.ly +1285 -0
- data/share/lilypond/2.24.1/ly/property-init.ly +858 -0
- data/share/lilypond/2.24.1/ly/satb.ly +214 -0
- data/share/lilypond/2.24.1/ly/scale-definitions-init.ly +117 -0
- data/share/lilypond/2.24.1/ly/scheme-sandbox.ly +39 -0
- data/share/lilypond/2.24.1/ly/script-init.ly +94 -0
- data/share/lilypond/2.24.1/ly/spanners-init.ly +146 -0
- data/share/lilypond/2.24.1/ly/ssaattbb.ly +335 -0
- data/share/lilypond/2.24.1/ly/staff-tkit.ly +182 -0
- data/share/lilypond/2.24.1/ly/string-tunings-init.ly +94 -0
- data/share/lilypond/2.24.1/ly/suomi.ly +23 -0
- data/share/lilypond/2.24.1/ly/svenska.ly +23 -0
- data/share/lilypond/2.24.1/ly/swing.ly +362 -0
- data/share/lilypond/2.24.1/ly/text-replacements.ly +150 -0
- data/share/lilypond/2.24.1/ly/titling-init.ly +150 -0
- data/share/lilypond/2.24.1/ly/toc-init.ly +182 -0
- data/share/lilypond/2.24.1/ly/turkish-makam.ly +609 -0
- data/share/lilypond/2.24.1/ly/vlaams.ly +23 -0
- data/share/lilypond/2.24.1/ly/vocal-tkit.ly +103 -0
- data/share/lilypond/2.24.1/ly/voice-tkit.ly +34 -0
- data/share/lilypond/2.24.1/ps/encodingdefs.ps +2611 -0
- data/share/lilypond/2.24.1/ps/lilyponddefs.ps +49 -0
- data/share/lilypond/2.24.1/ps/music-drawing-routines.ps +329 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_base.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_docbook.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_html.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_latex.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_snippets.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/book_texinfo.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/convertrules.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/langdefs.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/lilylib.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/midi.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/musicexp.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/musicxml.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/musicxml2ly_conversion.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/__pycache__/utilities.cpython-310.pyc +0 -0
- data/share/lilypond/2.24.1/python/book_base.py +331 -0
- data/share/lilypond/2.24.1/python/book_docbook.py +154 -0
- data/share/lilypond/2.24.1/python/book_html.py +178 -0
- data/share/lilypond/2.24.1/python/book_latex.py +373 -0
- data/share/lilypond/2.24.1/python/book_snippets.py +1052 -0
- data/share/lilypond/2.24.1/python/book_texinfo.py +437 -0
- data/share/lilypond/2.24.1/python/convertrules.py +4764 -0
- data/share/lilypond/2.24.1/python/langdefs.py +131 -0
- data/share/lilypond/2.24.1/python/lilylib.py +141 -0
- data/share/lilypond/2.24.1/python/midi.py +212 -0
- data/share/lilypond/2.24.1/python/musicexp.py +2781 -0
- data/share/lilypond/2.24.1/python/musicxml.py +1905 -0
- data/share/lilypond/2.24.1/python/musicxml2ly_conversion.py +80 -0
- data/share/lilypond/2.24.1/python/utilities.py +280 -0
- data/share/lilypond/2.24.1/scm/lily/accreg.scm +579 -0
- data/share/lilypond/2.24.1/scm/lily/auto-beam.scm +163 -0
- data/share/lilypond/2.24.1/scm/lily/autochange.scm +100 -0
- data/share/lilypond/2.24.1/scm/lily/backend-library.scm +593 -0
- data/share/lilypond/2.24.1/scm/lily/bar-line.scm +1281 -0
- data/share/lilypond/2.24.1/scm/lily/breath.scm +74 -0
- data/share/lilypond/2.24.1/scm/lily/c++.scm +174 -0
- data/share/lilypond/2.24.1/scm/lily/chord-entry.scm +278 -0
- data/share/lilypond/2.24.1/scm/lily/chord-ignatzek-names.scm +304 -0
- data/share/lilypond/2.24.1/scm/lily/chord-name.scm +217 -0
- data/share/lilypond/2.24.1/scm/lily/clip-region.scm +87 -0
- data/share/lilypond/2.24.1/scm/lily/color.scm +757 -0
- data/share/lilypond/2.24.1/scm/lily/curried-definitions.scm +68 -0
- data/share/lilypond/2.24.1/scm/lily/define-context-properties.scm +939 -0
- data/share/lilypond/2.24.1/scm/lily/define-event-classes.scm +142 -0
- data/share/lilypond/2.24.1/scm/lily/define-grob-interfaces.scm +640 -0
- data/share/lilypond/2.24.1/scm/lily/define-grob-properties.scm +1647 -0
- data/share/lilypond/2.24.1/scm/lily/define-grobs.scm +4027 -0
- data/share/lilypond/2.24.1/scm/lily/define-markup-commands.scm +5737 -0
- data/share/lilypond/2.24.1/scm/lily/define-music-callbacks.scm +257 -0
- data/share/lilypond/2.24.1/scm/lily/define-music-display-methods.scm +1350 -0
- data/share/lilypond/2.24.1/scm/lily/define-music-properties.scm +242 -0
- data/share/lilypond/2.24.1/scm/lily/define-music-types.scm +983 -0
- data/share/lilypond/2.24.1/scm/lily/define-note-names.scm +1421 -0
- data/share/lilypond/2.24.1/scm/lily/define-stencil-commands.scm +71 -0
- data/share/lilypond/2.24.1/scm/lily/define-woodwind-diagrams.scm +1215 -0
- data/share/lilypond/2.24.1/scm/lily/display-lily.scm +315 -0
- data/share/lilypond/2.24.1/scm/lily/display-woodwind-diagrams.scm +1985 -0
- data/share/lilypond/2.24.1/scm/lily/document-backend.scm +307 -0
- data/share/lilypond/2.24.1/scm/lily/document-context-mods.scm +98 -0
- data/share/lilypond/2.24.1/scm/lily/document-functions.scm +169 -0
- data/share/lilypond/2.24.1/scm/lily/document-identifiers.scm +76 -0
- data/share/lilypond/2.24.1/scm/lily/document-markup.scm +158 -0
- data/share/lilypond/2.24.1/scm/lily/document-music.scm +146 -0
- data/share/lilypond/2.24.1/scm/lily/document-outside-staff-priorities.scm +40 -0
- data/share/lilypond/2.24.1/scm/lily/document-paper-sizes.scm +71 -0
- data/share/lilypond/2.24.1/scm/lily/document-translation.scm +318 -0
- data/share/lilypond/2.24.1/scm/lily/document-type-predicates.scm +85 -0
- data/share/lilypond/2.24.1/scm/lily/documentation-generate.scm +259 -0
- data/share/lilypond/2.24.1/scm/lily/documentation-lib.scm +207 -0
- data/share/lilypond/2.24.1/scm/lily/file-cache.scm +28 -0
- data/share/lilypond/2.24.1/scm/lily/flag-styles.scm +249 -0
- data/share/lilypond/2.24.1/scm/lily/font-encodings.scm +1242 -0
- data/share/lilypond/2.24.1/scm/lily/font.scm +303 -0
- data/share/lilypond/2.24.1/scm/lily/framework-cairo.scm +26 -0
- data/share/lilypond/2.24.1/scm/lily/framework-ps.scm +896 -0
- data/share/lilypond/2.24.1/scm/lily/framework-svg.scm +172 -0
- data/share/lilypond/2.24.1/scm/lily/fret-diagrams.scm +1261 -0
- data/share/lilypond/2.24.1/scm/lily/graphviz.scm +78 -0
- data/share/lilypond/2.24.1/scm/lily/guile-debugger.scm +90 -0
- data/share/lilypond/2.24.1/scm/lily/harp-pedals.scm +172 -0
- data/share/lilypond/2.24.1/scm/lily/hyphenate-internal-words.scm +51 -0
- data/share/lilypond/2.24.1/scm/lily/layout-beam.scm +73 -0
- data/share/lilypond/2.24.1/scm/lily/layout-slur.scm +45 -0
- data/share/lilypond/2.24.1/scm/lily/lily-library.scm +1446 -0
- data/share/lilypond/2.24.1/scm/lily/lily-sort.scm +116 -0
- data/share/lilypond/2.24.1/scm/lily/lily.scm +929 -0
- data/share/lilypond/2.24.1/scm/lily/ly-syntax-constructors.scm +374 -0
- data/share/lilypond/2.24.1/scm/lily/markup-macros.scm +493 -0
- data/share/lilypond/2.24.1/scm/lily/markup.scm +126 -0
- data/share/lilypond/2.24.1/scm/lily/midi.scm +258 -0
- data/share/lilypond/2.24.1/scm/lily/modal-transforms.scm +337 -0
- data/share/lilypond/2.24.1/scm/lily/music-functions.scm +2878 -0
- data/share/lilypond/2.24.1/scm/lily/output-lib.scm +3377 -0
- data/share/lilypond/2.24.1/scm/lily/output-ps.scm +335 -0
- data/share/lilypond/2.24.1/scm/lily/output-svg.scm +684 -0
- data/share/lilypond/2.24.1/scm/lily/page.scm +321 -0
- data/share/lilypond/2.24.1/scm/lily/paper-system.scm +271 -0
- data/share/lilypond/2.24.1/scm/lily/paper.scm +376 -0
- data/share/lilypond/2.24.1/scm/lily/parser-clef.scm +205 -0
- data/share/lilypond/2.24.1/scm/lily/parser-ly-from-scheme.scm +170 -0
- data/share/lilypond/2.24.1/scm/lily/part-combiner.scm +998 -0
- data/share/lilypond/2.24.1/scm/lily/predefined-fretboards.scm +54 -0
- data/share/lilypond/2.24.1/scm/lily/ps-to-png.scm +182 -0
- data/share/lilypond/2.24.1/scm/lily/scheme-engravers.scm +1813 -0
- data/share/lilypond/2.24.1/scm/lily/scheme-performers.scm +126 -0
- data/share/lilypond/2.24.1/scm/lily/script.scm +416 -0
- data/share/lilypond/2.24.1/scm/lily/skyline.scm +25 -0
- data/share/lilypond/2.24.1/scm/lily/song-util.scm +191 -0
- data/share/lilypond/2.24.1/scm/lily/song.scm +853 -0
- data/share/lilypond/2.24.1/scm/lily/stencil.scm +998 -0
- data/share/lilypond/2.24.1/scm/lily/tablature.scm +392 -0
- data/share/lilypond/2.24.1/scm/lily/time-signature-settings.scm +473 -0
- data/share/lilypond/2.24.1/scm/lily/time-signature.scm +35 -0
- data/share/lilypond/2.24.1/scm/lily/titling.scm +99 -0
- data/share/lilypond/2.24.1/scm/lily/to-xml.scm +254 -0
- data/share/lilypond/2.24.1/scm/lily/translation-functions.scm +1169 -0
- data/share/lilypond/2.24.1/vim/compiler/lilypond.vim +36 -0
- data/share/lilypond/2.24.1/vim/ftdetect/lilypond.vim +4 -0
- data/share/lilypond/2.24.1/vim/ftplugin/lilypond.vim +91 -0
- data/share/lilypond/2.24.1/vim/indent/lilypond.vim +79 -0
- data/share/lilypond/2.24.1/vim/syntax/lilypond-words +1408 -0
- data/share/lilypond/2.24.1/vim/syntax/lilypond-words.vim +3 -0
- data/share/lilypond/2.24.1/vim/syntax/lilypond.vim +104 -0
- data/share/locale/ca/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/cs/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/da/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/de/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/el/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/eo/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/es/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/fi/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/fr/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/it/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/ja/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/nl/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/ru/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/sv/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/tr/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/uk/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/vi/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/zh_CN/LC_MESSAGES/lilypond.mo +0 -0
- data/share/locale/zh_TW/LC_MESSAGES/lilypond.mo +0 -0
- metadata +1135 -4
@@ -0,0 +1,2614 @@
|
|
1
|
+
;;; Guile bytecode assembler
|
2
|
+
|
3
|
+
;;; Copyright (C) 2001, 2009, 2010, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
|
4
|
+
;;;
|
5
|
+
;;; This library is free software; you can redistribute it and/or
|
6
|
+
;;; modify it under the terms of the GNU Lesser General Public
|
7
|
+
;;; License as published by the Free Software Foundation; either
|
8
|
+
;;; version 3 of the License, or (at your option) any later version.
|
9
|
+
;;;
|
10
|
+
;;; This library is distributed in the hope that it will be useful,
|
11
|
+
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
;;; Lesser General Public License for more details.
|
14
|
+
;;;
|
15
|
+
;;; You should have received a copy of the GNU Lesser General Public
|
16
|
+
;;; License along with this library; if not, write to the Free Software
|
17
|
+
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
;;; Commentary:
|
20
|
+
;;;
|
21
|
+
;;; This module implements an assembler that creates an ELF image from
|
22
|
+
;;; bytecode assembly and macro-assembly. The input can be given in
|
23
|
+
;;; s-expression form, like ((OP ARG ...) ...). Internally there is a
|
24
|
+
;;; procedural interface, the emit-OP procedures, but that is not
|
25
|
+
;;; currently exported.
|
26
|
+
;;;
|
27
|
+
;;; "Primitive instructions" correspond to VM operations. Assemblers
|
28
|
+
;;; for primitive instructions are generated programmatically from
|
29
|
+
;;; (instruction-list), which itself is derived from the VM sources.
|
30
|
+
;;; There are also "macro-instructions" like "label" or "load-constant"
|
31
|
+
;;; that expand to 0 or more primitive instructions.
|
32
|
+
;;;
|
33
|
+
;;; The assembler also handles some higher-level tasks, like creating
|
34
|
+
;;; the symbol table, other metadata sections, creating a constant table
|
35
|
+
;;; for the whole compilation unit, and writing the dynamic section of
|
36
|
+
;;; the ELF file along with the appropriate initialization routines.
|
37
|
+
;;;
|
38
|
+
;;; Most compilers will want to use the trio of make-assembler,
|
39
|
+
;;; emit-text, and link-assembly. That will result in the creation of
|
40
|
+
;;; an ELF image as a bytevector, which can then be loaded using
|
41
|
+
;;; load-thunk-from-memory, or written to disk as a .go file.
|
42
|
+
;;;
|
43
|
+
;;; Code:
|
44
|
+
|
45
|
+
(define-module (system vm assembler)
|
46
|
+
#:use-module (system base target)
|
47
|
+
#:use-module (system vm dwarf)
|
48
|
+
#:use-module (system vm elf)
|
49
|
+
#:use-module (system vm linker)
|
50
|
+
#:use-module (system syntax internal)
|
51
|
+
#:use-module (language bytecode)
|
52
|
+
#:use-module (rnrs bytevectors)
|
53
|
+
#:use-module (ice-9 binary-ports)
|
54
|
+
#:use-module (ice-9 vlist)
|
55
|
+
#:use-module (ice-9 match)
|
56
|
+
#:use-module (srfi srfi-1)
|
57
|
+
#:use-module (srfi srfi-4)
|
58
|
+
#:use-module (srfi srfi-9)
|
59
|
+
#:use-module (srfi srfi-11)
|
60
|
+
#:export (make-assembler
|
61
|
+
|
62
|
+
(emit-receive* . emit-receive)
|
63
|
+
(emit-mov* . emit-mov)
|
64
|
+
(emit-fmov* . emit-fmov)
|
65
|
+
|
66
|
+
emit-call
|
67
|
+
emit-call-label
|
68
|
+
emit-tail-call
|
69
|
+
emit-tail-call-label
|
70
|
+
emit-receive-values
|
71
|
+
emit-return
|
72
|
+
emit-return-values
|
73
|
+
emit-call/cc
|
74
|
+
emit-abort
|
75
|
+
emit-builtin-ref
|
76
|
+
emit-br-if-nargs-ne
|
77
|
+
emit-br-if-nargs-lt
|
78
|
+
emit-br-if-nargs-gt
|
79
|
+
emit-assert-nargs-ee
|
80
|
+
emit-assert-nargs-ge
|
81
|
+
emit-assert-nargs-le
|
82
|
+
emit-alloc-frame
|
83
|
+
emit-reset-frame
|
84
|
+
emit-assert-nargs-ee/locals
|
85
|
+
emit-br-if-npos-gt
|
86
|
+
emit-bind-kwargs
|
87
|
+
emit-bind-rest
|
88
|
+
emit-br
|
89
|
+
emit-br-if-true
|
90
|
+
emit-br-if-null
|
91
|
+
emit-br-if-nil
|
92
|
+
emit-br-if-pair
|
93
|
+
emit-br-if-struct
|
94
|
+
emit-br-if-char
|
95
|
+
emit-br-if-tc7
|
96
|
+
emit-br-if-eq
|
97
|
+
emit-br-if-eqv
|
98
|
+
emit-br-if-=
|
99
|
+
emit-br-if-<
|
100
|
+
emit-br-if-<=
|
101
|
+
emit-br-if-logtest
|
102
|
+
emit-br-if-u64-=
|
103
|
+
emit-br-if-u64-<
|
104
|
+
emit-br-if-u64-<=
|
105
|
+
emit-br-if-u64-<-scm
|
106
|
+
emit-br-if-u64-<=-scm
|
107
|
+
emit-br-if-u64-=-scm
|
108
|
+
emit-br-if-u64->=-scm
|
109
|
+
emit-br-if-u64->-scm
|
110
|
+
emit-br-if-f64-=
|
111
|
+
emit-br-if-f64-<
|
112
|
+
emit-br-if-f64-<=
|
113
|
+
emit-br-if-f64->
|
114
|
+
emit-br-if-f64->=
|
115
|
+
emit-box
|
116
|
+
emit-box-ref
|
117
|
+
emit-box-set!
|
118
|
+
emit-make-closure
|
119
|
+
emit-free-ref
|
120
|
+
emit-free-set!
|
121
|
+
emit-current-module
|
122
|
+
emit-resolve
|
123
|
+
emit-define!
|
124
|
+
emit-toplevel-box
|
125
|
+
emit-module-box
|
126
|
+
emit-prompt
|
127
|
+
emit-wind
|
128
|
+
emit-unwind
|
129
|
+
emit-push-fluid
|
130
|
+
emit-pop-fluid
|
131
|
+
emit-push-dynamic-state
|
132
|
+
emit-pop-dynamic-state
|
133
|
+
emit-current-thread
|
134
|
+
emit-fluid-ref
|
135
|
+
emit-fluid-set!
|
136
|
+
emit-string-length
|
137
|
+
emit-string-ref
|
138
|
+
emit-string-set!
|
139
|
+
emit-string->number
|
140
|
+
emit-string->symbol
|
141
|
+
emit-symbol->keyword
|
142
|
+
emit-cons
|
143
|
+
emit-car
|
144
|
+
emit-cdr
|
145
|
+
emit-set-car!
|
146
|
+
emit-set-cdr!
|
147
|
+
emit-add
|
148
|
+
emit-add/immediate
|
149
|
+
emit-sub
|
150
|
+
emit-sub/immediate
|
151
|
+
emit-mul
|
152
|
+
emit-div
|
153
|
+
emit-quo
|
154
|
+
emit-rem
|
155
|
+
emit-mod
|
156
|
+
emit-ash
|
157
|
+
emit-fadd
|
158
|
+
emit-fsub
|
159
|
+
emit-fmul
|
160
|
+
emit-fdiv
|
161
|
+
emit-uadd
|
162
|
+
emit-usub
|
163
|
+
emit-umul
|
164
|
+
emit-uadd/immediate
|
165
|
+
emit-usub/immediate
|
166
|
+
emit-umul/immediate
|
167
|
+
emit-logand
|
168
|
+
emit-logior
|
169
|
+
emit-logxor
|
170
|
+
emit-logsub
|
171
|
+
emit-ulogand
|
172
|
+
emit-ulogior
|
173
|
+
emit-ulogxor
|
174
|
+
emit-ulogsub
|
175
|
+
emit-ursh
|
176
|
+
emit-ulsh
|
177
|
+
emit-ursh/immediate
|
178
|
+
emit-ulsh/immediate
|
179
|
+
emit-char->integer
|
180
|
+
emit-integer->char
|
181
|
+
emit-make-vector
|
182
|
+
emit-make-vector/immediate
|
183
|
+
emit-vector-length
|
184
|
+
emit-vector-ref
|
185
|
+
emit-vector-ref/immediate
|
186
|
+
emit-vector-set!
|
187
|
+
emit-vector-set!/immediate
|
188
|
+
emit-struct-vtable
|
189
|
+
emit-allocate-struct/immediate
|
190
|
+
emit-struct-ref/immediate
|
191
|
+
emit-struct-set!/immediate
|
192
|
+
emit-allocate-struct
|
193
|
+
emit-struct-ref
|
194
|
+
emit-struct-set!
|
195
|
+
emit-class-of
|
196
|
+
emit-make-array
|
197
|
+
emit-scm->f64
|
198
|
+
emit-load-f64
|
199
|
+
emit-f64->scm
|
200
|
+
emit-scm->u64
|
201
|
+
emit-scm->u64/truncate
|
202
|
+
emit-load-u64
|
203
|
+
emit-u64->scm
|
204
|
+
emit-scm->s64
|
205
|
+
emit-load-s64
|
206
|
+
emit-s64->scm
|
207
|
+
emit-bv-length
|
208
|
+
emit-bv-u8-ref
|
209
|
+
emit-bv-s8-ref
|
210
|
+
emit-bv-u16-ref
|
211
|
+
emit-bv-s16-ref
|
212
|
+
emit-bv-u32-ref
|
213
|
+
emit-bv-s32-ref
|
214
|
+
emit-bv-u64-ref
|
215
|
+
emit-bv-s64-ref
|
216
|
+
emit-bv-f32-ref
|
217
|
+
emit-bv-f64-ref
|
218
|
+
emit-bv-u8-set!
|
219
|
+
emit-bv-s8-set!
|
220
|
+
emit-bv-u16-set!
|
221
|
+
emit-bv-s16-set!
|
222
|
+
emit-bv-u32-set!
|
223
|
+
emit-bv-s32-set!
|
224
|
+
emit-bv-u64-set!
|
225
|
+
emit-bv-s64-set!
|
226
|
+
emit-bv-f32-set!
|
227
|
+
emit-bv-f64-set!
|
228
|
+
emit-make-atomic-box
|
229
|
+
emit-atomic-box-ref
|
230
|
+
emit-atomic-box-set!
|
231
|
+
emit-atomic-box-swap!
|
232
|
+
emit-atomic-box-compare-and-swap!
|
233
|
+
emit-handle-interrupts
|
234
|
+
|
235
|
+
emit-text
|
236
|
+
link-assembly))
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
;; Like define-inlinable, but only for first-order uses of the defined
|
242
|
+
;; routine. Should residualize less code.
|
243
|
+
(eval-when (expand)
|
244
|
+
(define-syntax define-inline
|
245
|
+
(lambda (x)
|
246
|
+
(syntax-case x ()
|
247
|
+
((_ (name arg ...) body ...)
|
248
|
+
(with-syntax (((temp ...) (generate-temporaries #'(arg ...))))
|
249
|
+
#`(eval-when (expand)
|
250
|
+
(define-syntax-rule (name temp ...)
|
251
|
+
(let ((arg temp) ...)
|
252
|
+
body ...)))))))))
|
253
|
+
|
254
|
+
;;; Bytecode consists of 32-bit units, often subdivided in some way.
|
255
|
+
;;; These helpers create one 32-bit unit from multiple components.
|
256
|
+
|
257
|
+
(define-inline (check-urange x mask)
|
258
|
+
(let ((x* (logand x mask)))
|
259
|
+
(unless (= x x*)
|
260
|
+
(error "out of range" x))
|
261
|
+
x*))
|
262
|
+
|
263
|
+
(define-inline (check-srange x mask)
|
264
|
+
(let ((x* (logand x mask)))
|
265
|
+
(unless (if (negative? x)
|
266
|
+
(= (+ x mask 1) x*)
|
267
|
+
(= x x*))
|
268
|
+
(error "out of range" x))
|
269
|
+
x*))
|
270
|
+
|
271
|
+
(define-inline (pack-u8-u24 x y)
|
272
|
+
(let ((x (check-urange x #xff))
|
273
|
+
(y (check-urange y #xffffff)))
|
274
|
+
(logior x (ash y 8))))
|
275
|
+
|
276
|
+
(define-inline (pack-u8-s24 x y)
|
277
|
+
(let ((x (check-urange x #xff))
|
278
|
+
(y (check-srange y #xffffff)))
|
279
|
+
(logior x (ash y 8))))
|
280
|
+
|
281
|
+
(define-inline (pack-u1-u7-u24 x y z)
|
282
|
+
(let ((x (check-urange x #x1))
|
283
|
+
(y (check-urange y #x7f))
|
284
|
+
(z (check-urange z #xffffff)))
|
285
|
+
(logior x (ash y 1) (ash z 8))))
|
286
|
+
|
287
|
+
(define-inline (pack-u8-u12-u12 x y z)
|
288
|
+
(let ((x (check-urange x #xff))
|
289
|
+
(y (check-urange y #xfff))
|
290
|
+
(z (check-urange z #xfff)))
|
291
|
+
(logior x (ash y 8) (ash z 20))))
|
292
|
+
|
293
|
+
(define-inline (pack-u8-u8-u16 x y z)
|
294
|
+
(let ((x (check-urange x #xff))
|
295
|
+
(y (check-urange y #xff))
|
296
|
+
(z (check-urange z #xffff)))
|
297
|
+
(logior x (ash y 8) (ash z 16))))
|
298
|
+
|
299
|
+
(define-inline (pack-u8-u8-u8-u8 x y z w)
|
300
|
+
(let ((x (check-urange x #xff))
|
301
|
+
(y (check-urange y #xff))
|
302
|
+
(z (check-urange z #xff))
|
303
|
+
(w (check-urange w #xff)))
|
304
|
+
(logior x (ash y 8) (ash z 16) (ash w 24))))
|
305
|
+
|
306
|
+
(eval-when (expand)
|
307
|
+
(define-syntax pack-flags
|
308
|
+
(syntax-rules ()
|
309
|
+
;; Add clauses as needed.
|
310
|
+
((pack-flags f1 f2) (logior (if f1 (ash 1 0) 0)
|
311
|
+
(if f2 (ash 1 1) 0))))))
|
312
|
+
|
313
|
+
|
314
|
+
(define-syntax-rule (define-byte-order-swapper name size ref set)
|
315
|
+
(define* (name buf #:optional (start 0) (end (bytevector-length buf)))
|
316
|
+
"Patch up the text buffer @var{buf}, swapping the endianness of each
|
317
|
+
N-byte unit."
|
318
|
+
(unless (zero? (modulo (- end start) size))
|
319
|
+
(error "unexpected length"))
|
320
|
+
(let lp ((pos start))
|
321
|
+
(when (< pos end)
|
322
|
+
(set buf pos (ref buf pos (endianness big)) (endianness little))
|
323
|
+
(lp (+ pos size))))))
|
324
|
+
|
325
|
+
(define-byte-order-swapper byte-swap/2!
|
326
|
+
2 bytevector-u16-ref bytevector-u16-set!)
|
327
|
+
(define-byte-order-swapper byte-swap/4!
|
328
|
+
4 bytevector-u32-ref bytevector-u32-set!)
|
329
|
+
(define-byte-order-swapper byte-swap/8!
|
330
|
+
8 bytevector-u64-ref bytevector-u64-set!)
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
;;; A <meta> entry collects metadata for one procedure. Procedures are
|
335
|
+
;;; written as contiguous ranges of bytecode.
|
336
|
+
;;;
|
337
|
+
(eval-when (expand)
|
338
|
+
(define-syntax-rule (assert-match arg pattern kind)
|
339
|
+
(let ((x arg))
|
340
|
+
(unless (match x (pattern #t) (_ #f))
|
341
|
+
(error (string-append "expected " kind) x)))))
|
342
|
+
|
343
|
+
(define-record-type <meta>
|
344
|
+
(%make-meta label properties low-pc high-pc arities)
|
345
|
+
meta?
|
346
|
+
(label meta-label)
|
347
|
+
(properties meta-properties set-meta-properties!)
|
348
|
+
(low-pc meta-low-pc)
|
349
|
+
(high-pc meta-high-pc set-meta-high-pc!)
|
350
|
+
(arities meta-arities set-meta-arities!))
|
351
|
+
|
352
|
+
(define (make-meta label properties low-pc)
|
353
|
+
(assert-match label (or (? exact-integer?) (? symbol?)) "symbol")
|
354
|
+
(assert-match properties (((? symbol?) . _) ...) "alist with symbolic keys")
|
355
|
+
(%make-meta label properties low-pc #f '()))
|
356
|
+
|
357
|
+
(define (meta-name meta)
|
358
|
+
(assq-ref (meta-properties meta) 'name))
|
359
|
+
|
360
|
+
;; Metadata for one <lambda-case>.
|
361
|
+
(define-record-type <arity>
|
362
|
+
(make-arity req opt rest kw-indices allow-other-keys?
|
363
|
+
low-pc high-pc definitions)
|
364
|
+
arity?
|
365
|
+
(req arity-req)
|
366
|
+
(opt arity-opt)
|
367
|
+
(rest arity-rest)
|
368
|
+
(kw-indices arity-kw-indices)
|
369
|
+
(allow-other-keys? arity-allow-other-keys?)
|
370
|
+
(low-pc arity-low-pc)
|
371
|
+
(high-pc arity-high-pc set-arity-high-pc!)
|
372
|
+
(definitions arity-definitions set-arity-definitions!))
|
373
|
+
|
374
|
+
;;; An assembler collects all of the words emitted during assembly, and
|
375
|
+
;;; also maintains ancillary information such as the constant table, a
|
376
|
+
;;; relocation list, and so on.
|
377
|
+
;;;
|
378
|
+
;;; Bytecode consists of 32-bit units. We emit bytecode using native
|
379
|
+
;;; endianness. If we're targeting a foreign endianness, we byte-swap
|
380
|
+
;;; the bytevector as a whole instead of conditionalizing each access.
|
381
|
+
;;;
|
382
|
+
(define-record-type <asm>
|
383
|
+
(make-asm buf pos start
|
384
|
+
labels relocs
|
385
|
+
word-size endianness
|
386
|
+
constants inits
|
387
|
+
shstrtab next-section-number
|
388
|
+
meta sources
|
389
|
+
slot-maps)
|
390
|
+
asm?
|
391
|
+
|
392
|
+
;; We write bytecode into a bytevector, growing the bytevector as
|
393
|
+
;; needed. asm-cur is that bytevector, and asm-pos is the byte offset
|
394
|
+
;; into the vector at which the next word should be written.
|
395
|
+
;;
|
396
|
+
(buf asm-buf set-asm-buf!)
|
397
|
+
(pos asm-pos set-asm-pos!)
|
398
|
+
|
399
|
+
;; asm-start is an absolute position, indicating the byte offset of
|
400
|
+
;; the beginning of an instruction. It is updated after writing all
|
401
|
+
;; the words for one primitive instruction. It models the position of
|
402
|
+
;; the instruction pointer during execution, given that the VM updates
|
403
|
+
;; the IP only at the end of executing the instruction, and is thus
|
404
|
+
;; useful for computing offsets between two points in a program.
|
405
|
+
;;
|
406
|
+
(start asm-start set-asm-start!)
|
407
|
+
|
408
|
+
;; An alist of symbol -> position pairs, indicating the labels defined
|
409
|
+
;; in this compilation unit.
|
410
|
+
;;
|
411
|
+
(labels asm-labels set-asm-labels!)
|
412
|
+
|
413
|
+
;; A list of relocations needed by the program text. We use an
|
414
|
+
;; internal representation for relocations, and handle textualn
|
415
|
+
;; relative relocations in the assembler. Other kinds of relocations
|
416
|
+
;; are later reified as linker relocations and resolved by the linker.
|
417
|
+
;;
|
418
|
+
(relocs asm-relocs set-asm-relocs!)
|
419
|
+
|
420
|
+
;; Target information.
|
421
|
+
;;
|
422
|
+
(word-size asm-word-size)
|
423
|
+
(endianness asm-endianness)
|
424
|
+
|
425
|
+
;; The constant table, as a vhash of object -> label. All constants
|
426
|
+
;; get de-duplicated and written into separate sections -- either the
|
427
|
+
;; .rodata section, for read-only data, or .data, for constants that
|
428
|
+
;; need initialization at load-time (like symbols). Constants can
|
429
|
+
;; depend on other constants (e.g. a symbol depending on a stringbuf),
|
430
|
+
;; so order in this table is important.
|
431
|
+
;;
|
432
|
+
(constants asm-constants set-asm-constants!)
|
433
|
+
|
434
|
+
;; A list of instructions needed to initialize the constants. Will
|
435
|
+
;; run in a thunk with 2 local variables.
|
436
|
+
;;
|
437
|
+
(inits asm-inits set-asm-inits!)
|
438
|
+
|
439
|
+
;; The shstrtab, for section names.
|
440
|
+
;;
|
441
|
+
(shstrtab asm-shstrtab set-asm-shstrtab!)
|
442
|
+
|
443
|
+
;; The section number for the next section to be written.
|
444
|
+
;;
|
445
|
+
(next-section-number asm-next-section-number set-asm-next-section-number!)
|
446
|
+
|
447
|
+
;; A list of <meta>, corresponding to procedure metadata.
|
448
|
+
;;
|
449
|
+
(meta asm-meta set-asm-meta!)
|
450
|
+
|
451
|
+
;; A list of (pos . source) pairs, indicating source information. POS
|
452
|
+
;; is relative to the beginning of the text section, and SOURCE is in
|
453
|
+
;; the same format that source-properties returns.
|
454
|
+
;;
|
455
|
+
(sources asm-sources set-asm-sources!)
|
456
|
+
|
457
|
+
;; A list of (pos . slot-map) pairs, indicating slot maps. POS is
|
458
|
+
;; relative to the beginning of the text section. SLOT-MAP is a
|
459
|
+
;; bitfield describing the stack at call sites, as an integer.
|
460
|
+
;;
|
461
|
+
(slot-maps asm-slot-maps set-asm-slot-maps!))
|
462
|
+
|
463
|
+
(define* (make-assembler #:key (word-size (target-word-size))
|
464
|
+
(endianness (target-endianness)))
|
465
|
+
"Create an assembler for a given target @var{word-size} and
|
466
|
+
@var{endianness}, falling back to appropriate values for the configured
|
467
|
+
target."
|
468
|
+
(make-asm (make-u32vector 1000) 0 0
|
469
|
+
(make-hash-table) '()
|
470
|
+
word-size endianness
|
471
|
+
vlist-null '()
|
472
|
+
(make-string-table) 1
|
473
|
+
'() '() '()))
|
474
|
+
|
475
|
+
(define (intern-section-name! asm string)
|
476
|
+
"Add a string to the section name table (shstrtab)."
|
477
|
+
(string-table-intern! (asm-shstrtab asm) string))
|
478
|
+
|
479
|
+
(define (grow-buffer! asm)
|
480
|
+
"Grow the code buffer of the asm."
|
481
|
+
(let* ((buf (asm-buf asm))
|
482
|
+
(len (bytevector-length buf))
|
483
|
+
(new (make-u32vector (ash len -1) 0)))
|
484
|
+
(bytevector-copy! buf 0 new 0 len)
|
485
|
+
(set-asm-buf! asm new)
|
486
|
+
#f))
|
487
|
+
|
488
|
+
(define-inline (emit asm u32)
|
489
|
+
"Emit one 32-bit word into the instruction stream. Assumes that there
|
490
|
+
is space for the word."
|
491
|
+
(bytevector-u32-native-set! (asm-buf asm) (asm-pos asm) u32)
|
492
|
+
(set-asm-pos! asm (+ (asm-pos asm) 4)))
|
493
|
+
|
494
|
+
(define-inline (make-reloc type label base word)
|
495
|
+
"Make an internal relocation of type @var{type} referencing symbol
|
496
|
+
@var{label}, @var{word} words after position @var{start}. @var{type}
|
497
|
+
may be x8-s24, indicating a 24-bit relative label reference that can be
|
498
|
+
fixed up by the assembler, or s32, indicating a 32-bit relative
|
499
|
+
reference that needs to be fixed up by the linker."
|
500
|
+
(list type label base word))
|
501
|
+
|
502
|
+
(define-inline (reset-asm-start! asm)
|
503
|
+
"Reset the asm-start after writing the words for one instruction."
|
504
|
+
(set-asm-start! asm (asm-pos asm)))
|
505
|
+
|
506
|
+
(define (record-label-reference asm label)
|
507
|
+
"Record an x8-s24 local label reference. This value will get patched
|
508
|
+
up later by the assembler."
|
509
|
+
(let* ((start (asm-start asm))
|
510
|
+
(pos (asm-pos asm))
|
511
|
+
(reloc (make-reloc 'x8-s24 label start (- pos start))))
|
512
|
+
(set-asm-relocs! asm (cons reloc (asm-relocs asm)))))
|
513
|
+
|
514
|
+
(define* (record-far-label-reference asm label #:optional (offset 0))
|
515
|
+
"Record an s32 far label reference. This value will get patched up
|
516
|
+
later by the linker."
|
517
|
+
(let* ((start (- (asm-start asm) offset))
|
518
|
+
(pos (asm-pos asm))
|
519
|
+
(reloc (make-reloc 's32 label start (- pos start))))
|
520
|
+
(set-asm-relocs! asm (cons reloc (asm-relocs asm)))))
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
;;;
|
526
|
+
;;; Primitive assemblers are defined by expanding `assembler' for each
|
527
|
+
;;; opcode in `(instruction-list)'.
|
528
|
+
;;;
|
529
|
+
|
530
|
+
(eval-when (expand)
|
531
|
+
(define (id-append ctx a b)
|
532
|
+
(datum->syntax ctx (symbol-append (syntax->datum a) (syntax->datum b))))
|
533
|
+
|
534
|
+
(define-syntax encoder
|
535
|
+
(lambda (x)
|
536
|
+
(define-syntax op-case
|
537
|
+
(lambda (x)
|
538
|
+
(syntax-case x ()
|
539
|
+
((_ asm name ((type arg ...) code ...) clause ...)
|
540
|
+
#`(if (eq? name 'type)
|
541
|
+
(with-syntax (((arg ...) (generate-temporaries #'(arg ...))))
|
542
|
+
#'((arg ...)
|
543
|
+
code ...))
|
544
|
+
(op-case asm name clause ...)))
|
545
|
+
((_ asm name)
|
546
|
+
#'(error "unmatched name" name)))))
|
547
|
+
|
548
|
+
(define (pack-first-word asm opcode type)
|
549
|
+
(with-syntax ((opcode opcode))
|
550
|
+
(op-case
|
551
|
+
asm type
|
552
|
+
((X32)
|
553
|
+
(emit asm opcode))
|
554
|
+
((X8_S24 arg)
|
555
|
+
(emit asm (pack-u8-u24 opcode arg)))
|
556
|
+
((X8_F24 arg)
|
557
|
+
(emit asm (pack-u8-u24 opcode arg)))
|
558
|
+
((X8_C24 arg)
|
559
|
+
(emit asm (pack-u8-u24 opcode arg)))
|
560
|
+
((X8_L24 label)
|
561
|
+
(record-label-reference asm label)
|
562
|
+
(emit asm opcode))
|
563
|
+
((X8_S8_I16 a imm)
|
564
|
+
(emit asm (pack-u8-u8-u16 opcode a (immediate-bits asm imm))))
|
565
|
+
((X8_S12_S12 a b)
|
566
|
+
(emit asm (pack-u8-u12-u12 opcode a b)))
|
567
|
+
((X8_S12_C12 a b)
|
568
|
+
(emit asm (pack-u8-u12-u12 opcode a b)))
|
569
|
+
((X8_C12_C12 a b)
|
570
|
+
(emit asm (pack-u8-u12-u12 opcode a b)))
|
571
|
+
((X8_F12_F12 a b)
|
572
|
+
(emit asm (pack-u8-u12-u12 opcode a b)))
|
573
|
+
((X8_S8_S8_S8 a b c)
|
574
|
+
(emit asm (pack-u8-u8-u8-u8 opcode a b c)))
|
575
|
+
((X8_S8_S8_C8 a b c)
|
576
|
+
(emit asm (pack-u8-u8-u8-u8 opcode a b c)))
|
577
|
+
((X8_S8_C8_S8 a b c)
|
578
|
+
(emit asm (pack-u8-u8-u8-u8 opcode a b c))))))
|
579
|
+
|
580
|
+
(define (pack-tail-word asm type)
|
581
|
+
(op-case
|
582
|
+
asm type
|
583
|
+
((C32 a)
|
584
|
+
(emit asm a))
|
585
|
+
((I32 imm)
|
586
|
+
(let ((val (immediate-bits asm imm)))
|
587
|
+
(emit asm val)))
|
588
|
+
((A32 imm)
|
589
|
+
(unless (= (asm-word-size asm) 8)
|
590
|
+
(error "make-long-immediate unavailable for this target"))
|
591
|
+
(let ((bits (immediate-bits asm imm)))
|
592
|
+
(emit asm (ash bits -32))
|
593
|
+
(emit asm (logand bits (1- (ash 1 32))))))
|
594
|
+
((AF32 f64)
|
595
|
+
(let ((u64 (u64vector-ref (f64vector f64) 0)))
|
596
|
+
(emit asm (ash u64 -32))
|
597
|
+
(emit asm (logand u64 (1- (ash 1 32))))))
|
598
|
+
((AU32 u64)
|
599
|
+
(emit asm (ash u64 -32))
|
600
|
+
(emit asm (logand u64 (1- (ash 1 32)))))
|
601
|
+
((AS32 s64)
|
602
|
+
(let ((u64 (u64vector-ref (s64vector s64) 0)))
|
603
|
+
(emit asm (ash u64 -32))
|
604
|
+
(emit asm (logand u64 (1- (ash 1 32))))))
|
605
|
+
((B32))
|
606
|
+
((BU32))
|
607
|
+
((BS32))
|
608
|
+
((BF32))
|
609
|
+
((N32 label)
|
610
|
+
(record-far-label-reference asm label)
|
611
|
+
(emit asm 0))
|
612
|
+
((R32 label)
|
613
|
+
(record-far-label-reference asm label)
|
614
|
+
(emit asm 0))
|
615
|
+
((L32 label)
|
616
|
+
(record-far-label-reference asm label)
|
617
|
+
(emit asm 0))
|
618
|
+
((LO32 label offset)
|
619
|
+
(record-far-label-reference asm label
|
620
|
+
(* offset (asm-word-size asm)))
|
621
|
+
(emit asm 0))
|
622
|
+
((C8_C24 a b)
|
623
|
+
(emit asm (pack-u8-u24 a b)))
|
624
|
+
((B1_X7_L24 a label)
|
625
|
+
(record-label-reference asm label)
|
626
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) 0 0)))
|
627
|
+
((B1_C7_L24 a b label)
|
628
|
+
(record-label-reference asm label)
|
629
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) b 0)))
|
630
|
+
((B1_X31 a)
|
631
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) 0 0)))
|
632
|
+
((B1_X7_S24 a b)
|
633
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) 0 b)))
|
634
|
+
((B1_X7_F24 a b)
|
635
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) 0 b)))
|
636
|
+
((B1_X7_C24 a b)
|
637
|
+
(emit asm (pack-u1-u7-u24 (if a 1 0) 0 b)))
|
638
|
+
((X8_S24 a)
|
639
|
+
(emit asm (pack-u8-u24 0 a)))
|
640
|
+
((X8_F24 a)
|
641
|
+
(emit asm (pack-u8-u24 0 a)))
|
642
|
+
((X8_C24 a)
|
643
|
+
(emit asm (pack-u8-u24 0 a)))
|
644
|
+
((X8_L24 label)
|
645
|
+
(record-label-reference asm label)
|
646
|
+
(emit asm 0))))
|
647
|
+
|
648
|
+
(syntax-case x ()
|
649
|
+
((_ word0 word* ...)
|
650
|
+
(with-syntax ((((formal0 ...)
|
651
|
+
code0 ...)
|
652
|
+
(pack-first-word #'asm #'opcode
|
653
|
+
(syntax->datum #'word0)))
|
654
|
+
((((formal* ...)
|
655
|
+
code* ...) ...)
|
656
|
+
(map (lambda (word) (pack-tail-word #'asm word))
|
657
|
+
(syntax->datum #'(word* ...)))))
|
658
|
+
;; The opcode is the last argument, so that assemblers don't
|
659
|
+
;; have to shuffle their arguments before tail-calling an
|
660
|
+
;; encoder.
|
661
|
+
#'(lambda (asm formal0 ... formal* ... ... opcode)
|
662
|
+
(let lp ()
|
663
|
+
(let ((words (length '(word0 word* ...))))
|
664
|
+
(unless (<= (+ (asm-pos asm) (* 4 words))
|
665
|
+
(bytevector-length (asm-buf asm)))
|
666
|
+
(grow-buffer! asm)
|
667
|
+
(lp))))
|
668
|
+
code0 ...
|
669
|
+
code* ... ...
|
670
|
+
(reset-asm-start! asm)))))))
|
671
|
+
|
672
|
+
(define (encoder-name operands)
|
673
|
+
(let lp ((operands operands) (out #'encode))
|
674
|
+
(syntax-case operands ()
|
675
|
+
(() out)
|
676
|
+
((operand . operands)
|
677
|
+
(lp #'operands
|
678
|
+
(id-append #'operand (id-append out out #'-) #'operand))))))
|
679
|
+
|
680
|
+
(define-syntax define-encoder
|
681
|
+
(lambda (x)
|
682
|
+
(syntax-case x ()
|
683
|
+
((_ operand ...)
|
684
|
+
(with-syntax ((encode (encoder-name #'(operand ...))))
|
685
|
+
#'(define encode (encoder operand ...)))))))
|
686
|
+
|
687
|
+
(define-syntax visit-instruction-kinds
|
688
|
+
(lambda (x)
|
689
|
+
(syntax-case x ()
|
690
|
+
((visit-instruction-kinds macro arg ...)
|
691
|
+
(with-syntax (((operands ...)
|
692
|
+
(delete-duplicates
|
693
|
+
(map (match-lambda
|
694
|
+
((name opcode kind . operands)
|
695
|
+
(datum->syntax #'macro operands)))
|
696
|
+
(instruction-list)))))
|
697
|
+
#'(begin
|
698
|
+
(macro arg ... . operands)
|
699
|
+
...)))))))
|
700
|
+
|
701
|
+
(visit-instruction-kinds define-encoder)
|
702
|
+
|
703
|
+
;; In Guile's VM, locals are usually addressed via the stack pointer
|
704
|
+
;; (SP). There can be up to 2^24 slots for local variables in a
|
705
|
+
;; frame. Some instructions encode their operands using a restricted
|
706
|
+
;; subset of the full 24-bit local address space, in order to make the
|
707
|
+
;; bytecode more dense in the usual case that a function needs few
|
708
|
+
;; local slots. To allow these instructions to be used when there are
|
709
|
+
;; many local slots, we can temporarily push the values on the stack,
|
710
|
+
;; operate on them there, and then store back any result as we pop the
|
711
|
+
;; SP to its original position.
|
712
|
+
;;
|
713
|
+
;; We implement this shuffling via wrapper encoders that have the same
|
714
|
+
;; arity as the encoder they wrap, e.g. encode-X8_S12_S12/shuffle that
|
715
|
+
;; wraps encode-X8_S12_S12. We make the emit-cons public interface
|
716
|
+
;; use the shuffling encoder. That way we solve the problem fully and
|
717
|
+
;; in just one place.
|
718
|
+
|
719
|
+
(define (encode-X8_S12_S12!/shuffle asm a b opcode)
|
720
|
+
(cond
|
721
|
+
((< (logior a b) (ash 1 12))
|
722
|
+
(encode-X8_S12_S12 asm a b opcode))
|
723
|
+
(else
|
724
|
+
(emit-push asm a)
|
725
|
+
(emit-push asm (1+ b))
|
726
|
+
(encode-X8_S12_S12 asm 1 0 opcode)
|
727
|
+
(emit-drop asm 2))))
|
728
|
+
(define (encode-X8_S12_S12<-/shuffle asm dst a opcode)
|
729
|
+
(cond
|
730
|
+
((< (logior dst a) (ash 1 12))
|
731
|
+
(encode-X8_S12_S12 asm dst a opcode))
|
732
|
+
(else
|
733
|
+
(emit-push asm a)
|
734
|
+
(encode-X8_S12_S12 asm 0 0 opcode)
|
735
|
+
(emit-pop asm dst))))
|
736
|
+
(define (encode-X8_S12_S12-X8_C24!/shuffle asm a b c opcode)
|
737
|
+
(cond
|
738
|
+
((< (logior a b) (ash 1 12))
|
739
|
+
(encode-X8_S12_S12-X8_C24 asm a b c opcode))
|
740
|
+
(else
|
741
|
+
(emit-push asm a)
|
742
|
+
(emit-push asm (1+ b))
|
743
|
+
(encode-X8_S12_S12-X8_C24 asm 1 0 c opcode)
|
744
|
+
(emit-drop asm 2))))
|
745
|
+
(define (encode-X8_S12_S12-X8_C24<-/shuffle asm dst a const opcode)
|
746
|
+
(cond
|
747
|
+
((< (logior dst a) (ash 1 12))
|
748
|
+
(encode-X8_S12_S12-X8_C24 asm dst a const opcode))
|
749
|
+
(else
|
750
|
+
(emit-push asm a)
|
751
|
+
(encode-X8_S12_S12-X8_C24 asm 0 0 const opcode)
|
752
|
+
(emit-pop asm dst))))
|
753
|
+
(define (encode-X8_S12_C12<-/shuffle asm dst const opcode)
|
754
|
+
(cond
|
755
|
+
((< dst (ash 1 12))
|
756
|
+
(encode-X8_S12_C12 asm dst const opcode))
|
757
|
+
(else
|
758
|
+
;; Push garbage value to make space for dst.
|
759
|
+
(emit-push asm dst)
|
760
|
+
(encode-X8_S12_C12 asm 0 const opcode)
|
761
|
+
(emit-pop asm dst))))
|
762
|
+
(define (encode-X8_S8_I16<-/shuffle asm dst imm opcode)
|
763
|
+
(cond
|
764
|
+
((< dst (ash 1 8))
|
765
|
+
(encode-X8_S8_I16 asm dst imm opcode))
|
766
|
+
(else
|
767
|
+
;; Push garbage value to make space for dst.
|
768
|
+
(emit-push asm dst)
|
769
|
+
(encode-X8_S8_I16 asm 0 imm opcode)
|
770
|
+
(emit-pop asm dst))))
|
771
|
+
(define (encode-X8_S8_S8_S8!/shuffle asm a b c opcode)
|
772
|
+
(cond
|
773
|
+
((< (logior a b c) (ash 1 8))
|
774
|
+
(encode-X8_S8_S8_S8 asm a b c opcode))
|
775
|
+
(else
|
776
|
+
(emit-push asm a)
|
777
|
+
(emit-push asm (+ b 1))
|
778
|
+
(emit-push asm (+ c 2))
|
779
|
+
(encode-X8_S8_S8_S8 asm 2 1 0 opcode)
|
780
|
+
(emit-drop asm 3))))
|
781
|
+
(define (encode-X8_S8_S8_S8<-/shuffle asm dst a b opcode)
|
782
|
+
(cond
|
783
|
+
((< (logior dst a b) (ash 1 8))
|
784
|
+
(encode-X8_S8_S8_S8 asm dst a b opcode))
|
785
|
+
(else
|
786
|
+
(emit-push asm a)
|
787
|
+
(emit-push asm (1+ b))
|
788
|
+
(encode-X8_S8_S8_S8 asm 1 1 0 opcode)
|
789
|
+
(emit-drop asm 1)
|
790
|
+
(emit-pop asm dst))))
|
791
|
+
(define (encode-X8_S8_S8_C8<-/shuffle asm dst a const opcode)
|
792
|
+
(cond
|
793
|
+
((< (logior dst a) (ash 1 8))
|
794
|
+
(encode-X8_S8_S8_C8 asm dst a const opcode))
|
795
|
+
(else
|
796
|
+
(emit-push asm a)
|
797
|
+
(encode-X8_S8_S8_C8 asm 0 0 const opcode)
|
798
|
+
(emit-pop asm dst))))
|
799
|
+
(define (encode-X8_S8_C8_S8!/shuffle asm a const b opcode)
|
800
|
+
(cond
|
801
|
+
((< (logior a b) (ash 1 8))
|
802
|
+
(encode-X8_S8_C8_S8 asm a const b opcode))
|
803
|
+
(else
|
804
|
+
(emit-push asm a)
|
805
|
+
(emit-push asm (1+ b))
|
806
|
+
(encode-X8_S8_C8_S8 asm 1 const 0 opcode)
|
807
|
+
(emit-drop asm 2))))
|
808
|
+
(define (encode-X8_S8_C8_S8<-/shuffle asm dst const a opcode)
|
809
|
+
(cond
|
810
|
+
((< (logior dst a) (ash 1 8))
|
811
|
+
(encode-X8_S8_C8_S8 asm dst const a opcode))
|
812
|
+
(else
|
813
|
+
(emit-push asm a)
|
814
|
+
(encode-X8_S8_C8_S8 asm 0 const 0 opcode)
|
815
|
+
(emit-pop asm dst))))
|
816
|
+
|
817
|
+
(eval-when (expand)
|
818
|
+
(define (id-append ctx a b)
|
819
|
+
(datum->syntax ctx (symbol-append (syntax->datum a) (syntax->datum b))))
|
820
|
+
|
821
|
+
(define (shuffling-encoder-name kind operands)
|
822
|
+
(match (cons (syntax->datum kind) (syntax->datum operands))
|
823
|
+
(('! 'X8_S12_S12) #'encode-X8_S12_S12!/shuffle)
|
824
|
+
(('<- 'X8_S12_S12) #'encode-X8_S12_S12<-/shuffle)
|
825
|
+
(('! 'X8_S12_S12 'X8_C24) #'encode-X8_S12_S12-X8_C24!/shuffle)
|
826
|
+
(('<- 'X8_S12_S12 'X8_C24) #'encode-X8_S12_S12-X8_C24<-/shuffle)
|
827
|
+
(('<- 'X8_S12_C12) #'encode-X8_S12_C12<-/shuffle)
|
828
|
+
(('<- 'X8_S8_I16) #'encode-X8_S8_I16<-/shuffle)
|
829
|
+
(('! 'X8_S8_S8_S8) #'encode-X8_S8_S8_S8!/shuffle)
|
830
|
+
(('<- 'X8_S8_S8_S8) #'encode-X8_S8_S8_S8<-/shuffle)
|
831
|
+
(('<- 'X8_S8_S8_C8) #'encode-X8_S8_S8_C8<-/shuffle)
|
832
|
+
(('! 'X8_S8_C8_S8) #'encode-X8_S8_C8_S8!/shuffle)
|
833
|
+
(('<- 'X8_S8_C8_S8) #'encode-X8_S8_C8_S8<-/shuffle)
|
834
|
+
(else (encoder-name operands))))
|
835
|
+
|
836
|
+
(define-syntax assembler
|
837
|
+
(lambda (x)
|
838
|
+
(define (word-args word)
|
839
|
+
(match word
|
840
|
+
('C32 #'(a))
|
841
|
+
('I32 #'(imm))
|
842
|
+
('A32 #'(imm))
|
843
|
+
('AF32 #'(f64))
|
844
|
+
('AU32 #'(u64))
|
845
|
+
('AS32 #'(s64))
|
846
|
+
('B32 #'())
|
847
|
+
('BU32 #'())
|
848
|
+
('BS32 #'())
|
849
|
+
('BF32 #'())
|
850
|
+
('N32 #'(label))
|
851
|
+
('R32 #'(label))
|
852
|
+
('L32 #'(label))
|
853
|
+
('LO32 #'(label offset))
|
854
|
+
('C8_C24 #'(a b))
|
855
|
+
('B1_X7_L24 #'(a label))
|
856
|
+
('B1_C7_L24 #'(a b label))
|
857
|
+
('B1_X31 #'(a))
|
858
|
+
('B1_X7_S24 #'(a b))
|
859
|
+
('B1_X7_F24 #'(a b))
|
860
|
+
('B1_X7_C24 #'(a b))
|
861
|
+
('X8_S24 #'(arg))
|
862
|
+
('X8_F24 #'(arg))
|
863
|
+
('X8_C24 #'(arg))
|
864
|
+
('X8_L24 #'(label))
|
865
|
+
('X8_S8_I16 #'(a imm))
|
866
|
+
('X8_S12_S12 #'(a b))
|
867
|
+
('X8_S12_C12 #'(a b))
|
868
|
+
('X8_C12_C12 #'(a b))
|
869
|
+
('X8_F12_F12 #'(a b))
|
870
|
+
('X8_S8_S8_S8 #'(a b c))
|
871
|
+
('X8_S8_S8_C8 #'(a b c))
|
872
|
+
('X8_S8_C8_S8 #'(a b c))
|
873
|
+
('X32 #'())))
|
874
|
+
|
875
|
+
(syntax-case x ()
|
876
|
+
((_ name opcode kind word ...)
|
877
|
+
(with-syntax (((formal ...)
|
878
|
+
(generate-temporaries
|
879
|
+
(append-map word-args (syntax->datum #'(word ...)))))
|
880
|
+
(encode (shuffling-encoder-name #'kind #'(word ...))))
|
881
|
+
#'(lambda (asm formal ...)
|
882
|
+
(encode asm formal ... opcode))))))))
|
883
|
+
|
884
|
+
(define assemblers (make-hash-table))
|
885
|
+
|
886
|
+
(eval-when (expand)
|
887
|
+
(define-syntax define-assembler
|
888
|
+
(lambda (x)
|
889
|
+
(syntax-case x ()
|
890
|
+
((_ name opcode kind arg ...)
|
891
|
+
(with-syntax ((emit (id-append #'name #'emit- #'name)))
|
892
|
+
#'(define emit
|
893
|
+
(let ((emit (assembler name opcode kind arg ...)))
|
894
|
+
(hashq-set! assemblers 'name emit)
|
895
|
+
emit)))))))
|
896
|
+
|
897
|
+
(define-syntax visit-opcodes
|
898
|
+
(lambda (x)
|
899
|
+
(syntax-case x ()
|
900
|
+
((visit-opcodes macro arg ...)
|
901
|
+
(with-syntax (((inst ...)
|
902
|
+
(map (lambda (x) (datum->syntax #'macro x))
|
903
|
+
(instruction-list))))
|
904
|
+
#'(begin
|
905
|
+
(macro arg ... . inst)
|
906
|
+
...)))))))
|
907
|
+
|
908
|
+
(visit-opcodes define-assembler)
|
909
|
+
|
910
|
+
;; Shuffling is a general mechanism to get around address space
|
911
|
+
;; limitations for SP-relative variable references. FP-relative
|
912
|
+
;; variables need special support. Also, some instructions like `mov'
|
913
|
+
;; have multiple variations with different addressing limits.
|
914
|
+
|
915
|
+
(define (emit-mov* asm dst src)
|
916
|
+
(if (and (< dst (ash 1 12)) (< src (ash 1 12)))
|
917
|
+
(emit-mov asm dst src)
|
918
|
+
(emit-long-mov asm dst src)))
|
919
|
+
|
920
|
+
(define (emit-fmov* asm dst src)
|
921
|
+
(emit-long-fmov asm dst src))
|
922
|
+
|
923
|
+
(define (emit-receive* asm dst proc nlocals)
|
924
|
+
(if (and (< dst (ash 1 12)) (< proc (ash 1 12)))
|
925
|
+
(emit-receive asm dst proc nlocals)
|
926
|
+
(begin
|
927
|
+
(emit-receive-values asm proc #t 1)
|
928
|
+
(emit-fmov* asm dst (1+ proc))
|
929
|
+
(emit-reset-frame asm nlocals))))
|
930
|
+
|
931
|
+
(define (emit-text asm instructions)
|
932
|
+
"Assemble @var{instructions} using the assembler @var{asm}.
|
933
|
+
@var{instructions} is a sequence of instructions, expressed as a list of
|
934
|
+
lists. This procedure can be called many times before calling
|
935
|
+
@code{link-assembly}."
|
936
|
+
(for-each (lambda (inst)
|
937
|
+
(apply (or (hashq-ref assemblers (car inst))
|
938
|
+
(error 'bad-instruction inst))
|
939
|
+
asm
|
940
|
+
(cdr inst)))
|
941
|
+
instructions))
|
942
|
+
|
943
|
+
|
944
|
+
|
945
|
+
;;;
|
946
|
+
;;; The constant table records a topologically sorted set of literal
|
947
|
+
;;; constants used by a program. For example, a pair uses its car and
|
948
|
+
;;; cdr, a string uses its stringbuf, etc.
|
949
|
+
;;;
|
950
|
+
;;; Some things we want to add to the constant table are not actually
|
951
|
+
;;; Scheme objects: for example, stringbufs, cache cells for toplevel
|
952
|
+
;;; references, or cache cells for non-closure procedures. For these we
|
953
|
+
;;; define special record types and add instances of those record types
|
954
|
+
;;; to the table.
|
955
|
+
;;;
|
956
|
+
|
957
|
+
(define (immediate-bits asm x)
|
958
|
+
"Return the bit pattern to write into the buffer if @var{x} is
|
959
|
+
immediate, and @code{#f} otherwise."
|
960
|
+
(define tc2-int 2)
|
961
|
+
(if (exact-integer? x)
|
962
|
+
;; Object is an immediate if it is a fixnum on the target.
|
963
|
+
(call-with-values (lambda ()
|
964
|
+
(case (asm-word-size asm)
|
965
|
+
((4) (values (- #x20000000)
|
966
|
+
#x1fffffff))
|
967
|
+
((8) (values (- #x2000000000000000)
|
968
|
+
#x1fffffffFFFFFFFF))
|
969
|
+
(else (error "unexpected word size"))))
|
970
|
+
(lambda (fixnum-min fixnum-max)
|
971
|
+
(and (<= fixnum-min x fixnum-max)
|
972
|
+
(let ((fixnum-bits (if (negative? x)
|
973
|
+
(+ fixnum-max 1 (logand x fixnum-max))
|
974
|
+
x)))
|
975
|
+
(logior (ash fixnum-bits 2) tc2-int)))))
|
976
|
+
;; Otherwise, the object will be immediate on the target if and
|
977
|
+
;; only if it is immediate on the host. Except for integers,
|
978
|
+
;; which we handle specially above, any immediate value is an
|
979
|
+
;; immediate on both 32-bit and 64-bit targets.
|
980
|
+
(let ((bits (object-address x)))
|
981
|
+
(and (not (zero? (logand bits 6)))
|
982
|
+
bits))))
|
983
|
+
|
984
|
+
(define-record-type <stringbuf>
|
985
|
+
(make-stringbuf string)
|
986
|
+
stringbuf?
|
987
|
+
(string stringbuf-string))
|
988
|
+
|
989
|
+
(define-record-type <static-procedure>
|
990
|
+
(make-static-procedure code)
|
991
|
+
static-procedure?
|
992
|
+
(code static-procedure-code))
|
993
|
+
|
994
|
+
(define-record-type <uniform-vector-backing-store>
|
995
|
+
(make-uniform-vector-backing-store bytes element-size)
|
996
|
+
uniform-vector-backing-store?
|
997
|
+
(bytes uniform-vector-backing-store-bytes)
|
998
|
+
(element-size uniform-vector-backing-store-element-size))
|
999
|
+
|
1000
|
+
(define-record-type <cache-cell>
|
1001
|
+
(make-cache-cell scope key)
|
1002
|
+
cache-cell?
|
1003
|
+
(scope cache-cell-scope)
|
1004
|
+
(key cache-cell-key))
|
1005
|
+
|
1006
|
+
(define (simple-vector? obj)
|
1007
|
+
(and (vector? obj)
|
1008
|
+
(equal? (array-shape obj) (list (list 0 (1- (vector-length obj)))))))
|
1009
|
+
|
1010
|
+
(define (simple-uniform-vector? obj)
|
1011
|
+
(and (array? obj)
|
1012
|
+
(symbol? (array-type obj))
|
1013
|
+
(match (array-shape obj)
|
1014
|
+
(((0 n)) #t)
|
1015
|
+
(else #f))))
|
1016
|
+
|
1017
|
+
(define (statically-allocatable? x)
|
1018
|
+
"Return @code{#t} if a non-immediate constant can be allocated
|
1019
|
+
statically, and @code{#f} if it would need some kind of runtime
|
1020
|
+
allocation."
|
1021
|
+
(or (pair? x) (string? x) (stringbuf? x) (static-procedure? x)
|
1022
|
+
(array? x) (syntax? x)))
|
1023
|
+
|
1024
|
+
(define (intern-constant asm obj)
|
1025
|
+
"Add an object to the constant table, and return a label that can be
|
1026
|
+
used to reference it. If the object is already present in the constant
|
1027
|
+
table, its existing label is used directly."
|
1028
|
+
(define (recur obj)
|
1029
|
+
(intern-constant asm obj))
|
1030
|
+
(define (field dst n obj)
|
1031
|
+
(let ((src (recur obj)))
|
1032
|
+
(if src
|
1033
|
+
(if (statically-allocatable? obj)
|
1034
|
+
`((static-patch! ,dst ,n ,src))
|
1035
|
+
`((static-ref 1 ,src)
|
1036
|
+
(static-set! 1 ,dst ,n)))
|
1037
|
+
'())))
|
1038
|
+
(define (intern obj label)
|
1039
|
+
(cond
|
1040
|
+
((pair? obj)
|
1041
|
+
(append (field label 0 (car obj))
|
1042
|
+
(field label 1 (cdr obj))))
|
1043
|
+
((simple-vector? obj)
|
1044
|
+
(let lp ((i 0) (inits '()))
|
1045
|
+
(if (< i (vector-length obj))
|
1046
|
+
(lp (1+ i)
|
1047
|
+
(append-reverse (field label (1+ i) (vector-ref obj i))
|
1048
|
+
inits))
|
1049
|
+
(reverse inits))))
|
1050
|
+
((syntax? obj)
|
1051
|
+
(append (field label 1 (syntax-expression obj))
|
1052
|
+
(field label 2 (syntax-wrap obj))
|
1053
|
+
(field label 3 (syntax-module obj))))
|
1054
|
+
((stringbuf? obj) '())
|
1055
|
+
((static-procedure? obj)
|
1056
|
+
`((static-patch! ,label 1 ,(static-procedure-code obj))))
|
1057
|
+
((cache-cell? obj) '())
|
1058
|
+
((symbol? obj)
|
1059
|
+
(unless (symbol-interned? obj)
|
1060
|
+
(error "uninterned symbol cannot be saved to object file" obj))
|
1061
|
+
`((make-non-immediate 1 ,(recur (symbol->string obj)))
|
1062
|
+
(string->symbol 1 1)
|
1063
|
+
(static-set! 1 ,label 0)))
|
1064
|
+
((string? obj)
|
1065
|
+
`((static-patch! ,label 1 ,(recur (make-stringbuf obj)))))
|
1066
|
+
((keyword? obj)
|
1067
|
+
`((static-ref 1 ,(recur (keyword->symbol obj)))
|
1068
|
+
(symbol->keyword 1 1)
|
1069
|
+
(static-set! 1 ,label 0)))
|
1070
|
+
((number? obj)
|
1071
|
+
`((make-non-immediate 1 ,(recur (number->string obj)))
|
1072
|
+
(string->number 1 1)
|
1073
|
+
(static-set! 1 ,label 0)))
|
1074
|
+
((uniform-vector-backing-store? obj) '())
|
1075
|
+
((simple-uniform-vector? obj)
|
1076
|
+
(let ((width (case (array-type obj)
|
1077
|
+
((vu8 u8 s8) 1)
|
1078
|
+
((u16 s16) 2)
|
1079
|
+
;; Bitvectors are addressed in 32-bit units.
|
1080
|
+
;; Although a complex number is 8 or 16 bytes wide,
|
1081
|
+
;; it should be byteswapped in 4 or 8 byte units.
|
1082
|
+
((u32 s32 f32 c32 b) 4)
|
1083
|
+
((u64 s64 f64 c64) 8)
|
1084
|
+
(else
|
1085
|
+
(error "unhandled array type" obj)))))
|
1086
|
+
`((static-patch! ,label 2
|
1087
|
+
,(recur (make-uniform-vector-backing-store
|
1088
|
+
(uniform-array->bytevector obj)
|
1089
|
+
width))))))
|
1090
|
+
((array? obj)
|
1091
|
+
`((static-patch! ,label 1 ,(recur (shared-array-root obj)))))
|
1092
|
+
(else
|
1093
|
+
(error "don't know how to intern" obj))))
|
1094
|
+
(cond
|
1095
|
+
((immediate-bits asm obj) #f)
|
1096
|
+
((vhash-assoc obj (asm-constants asm)) => cdr)
|
1097
|
+
(else
|
1098
|
+
;; Note that calling intern may mutate asm-constants and asm-inits.
|
1099
|
+
(let* ((label (gensym "constant"))
|
1100
|
+
(inits (intern obj label)))
|
1101
|
+
(set-asm-constants! asm (vhash-cons obj label (asm-constants asm)))
|
1102
|
+
(set-asm-inits! asm (append-reverse inits (asm-inits asm)))
|
1103
|
+
label))))
|
1104
|
+
|
1105
|
+
(define (intern-non-immediate asm obj)
|
1106
|
+
"Intern a non-immediate into the constant table, and return its
|
1107
|
+
label."
|
1108
|
+
(when (immediate-bits asm obj)
|
1109
|
+
(error "expected a non-immediate" obj))
|
1110
|
+
(intern-constant asm obj))
|
1111
|
+
|
1112
|
+
(define (intern-cache-cell asm scope key)
|
1113
|
+
"Intern a cache cell into the constant table, and return its label.
|
1114
|
+
If there is already a cache cell with the given scope and key, it is
|
1115
|
+
returned instead."
|
1116
|
+
(intern-constant asm (make-cache-cell scope key)))
|
1117
|
+
|
1118
|
+
;; Return the label of the cell that holds the module for a scope.
|
1119
|
+
(define (intern-module-cache-cell asm scope)
|
1120
|
+
"Intern a cache cell for a module, and return its label."
|
1121
|
+
(intern-cache-cell asm scope #t))
|
1122
|
+
|
1123
|
+
|
1124
|
+
|
1125
|
+
|
1126
|
+
;;;
|
1127
|
+
;;; Macro assemblers bridge the gap between primitive instructions and
|
1128
|
+
;;; some higher-level operations.
|
1129
|
+
;;;
|
1130
|
+
|
1131
|
+
(eval-when (expand)
|
1132
|
+
(define-syntax define-macro-assembler
|
1133
|
+
(lambda (x)
|
1134
|
+
(syntax-case x ()
|
1135
|
+
((_ (name arg ...) body body* ...)
|
1136
|
+
(with-syntax ((emit (id-append #'name #'emit- #'name)))
|
1137
|
+
#'(begin
|
1138
|
+
(define emit
|
1139
|
+
(let ((emit (lambda (arg ...) body body* ...)))
|
1140
|
+
(hashq-set! assemblers 'name emit)
|
1141
|
+
emit))
|
1142
|
+
(export emit))))))))
|
1143
|
+
|
1144
|
+
(define-macro-assembler (load-constant asm dst obj)
|
1145
|
+
(cond
|
1146
|
+
((immediate-bits asm obj)
|
1147
|
+
=> (lambda (bits)
|
1148
|
+
(cond
|
1149
|
+
((and (< dst 256) (zero? (ash bits -16)))
|
1150
|
+
(emit-make-short-immediate asm dst obj))
|
1151
|
+
((zero? (ash bits -32))
|
1152
|
+
(emit-make-long-immediate asm dst obj))
|
1153
|
+
(else
|
1154
|
+
(emit-make-long-long-immediate asm dst obj)))))
|
1155
|
+
((statically-allocatable? obj)
|
1156
|
+
(emit-make-non-immediate asm dst (intern-non-immediate asm obj)))
|
1157
|
+
(else
|
1158
|
+
(emit-static-ref asm dst (intern-non-immediate asm obj)))))
|
1159
|
+
|
1160
|
+
(define-macro-assembler (load-static-procedure asm dst label)
|
1161
|
+
(let ((loc (intern-constant asm (make-static-procedure label))))
|
1162
|
+
(emit-make-non-immediate asm dst loc)))
|
1163
|
+
|
1164
|
+
(define-syntax-rule (define-tc7-macro-assembler name tc7)
|
1165
|
+
(define-macro-assembler (name asm slot invert? label)
|
1166
|
+
(emit-br-if-tc7 asm slot invert? tc7 label)))
|
1167
|
+
|
1168
|
+
;; Keep in sync with tags.h. Part of Guile's ABI. Currently unused
|
1169
|
+
;; macro assemblers are commented out. See also
|
1170
|
+
;; *branching-primcall-arities* in (language cps primitives), the set of
|
1171
|
+
;; macro-instructions in assembly.scm, and
|
1172
|
+
;; disassembler.scm:code-annotation.
|
1173
|
+
;;
|
1174
|
+
;; FIXME: Define all tc7 values in Scheme in one place, derived from
|
1175
|
+
;; tags.h.
|
1176
|
+
(define-tc7-macro-assembler br-if-symbol #x05)
|
1177
|
+
(define-tc7-macro-assembler br-if-variable #x07)
|
1178
|
+
(define-tc7-macro-assembler br-if-vector #x0d)
|
1179
|
+
;(define-tc7-macro-assembler br-if-weak-vector 13)
|
1180
|
+
(define-tc7-macro-assembler br-if-string #x15)
|
1181
|
+
;(define-tc7-macro-assembler br-if-heap-number 23)
|
1182
|
+
;(define-tc7-macro-assembler br-if-stringbuf 39)
|
1183
|
+
(define-tc7-macro-assembler br-if-bytevector #x4d)
|
1184
|
+
;(define-tc7-macro-assembler br-if-pointer 31)
|
1185
|
+
;(define-tc7-macro-assembler br-if-hashtable 29)
|
1186
|
+
;(define-tc7-macro-assembler br-if-fluid 37)
|
1187
|
+
;(define-tc7-macro-assembler br-if-dynamic-state 45)
|
1188
|
+
;(define-tc7-macro-assembler br-if-frame 47)
|
1189
|
+
(define-tc7-macro-assembler br-if-keyword #x35)
|
1190
|
+
;(define-tc7-macro-assembler br-if-syntax #x3d)
|
1191
|
+
;(define-tc7-macro-assembler br-if-vm 55)
|
1192
|
+
;(define-tc7-macro-assembler br-if-vm-cont 71)
|
1193
|
+
;(define-tc7-macro-assembler br-if-rtl-program 69)
|
1194
|
+
;(define-tc7-macro-assembler br-if-weak-set 85)
|
1195
|
+
;(define-tc7-macro-assembler br-if-weak-table 87)
|
1196
|
+
;(define-tc7-macro-assembler br-if-array 93)
|
1197
|
+
(define-tc7-macro-assembler br-if-bitvector #x5f)
|
1198
|
+
;(define-tc7-macro-assembler br-if-port 125)
|
1199
|
+
;(define-tc7-macro-assembler br-if-smob 127)
|
1200
|
+
|
1201
|
+
(define-macro-assembler (begin-program asm label properties)
|
1202
|
+
(emit-label asm label)
|
1203
|
+
(let ((meta (make-meta label properties (asm-start asm))))
|
1204
|
+
(set-asm-meta! asm (cons meta (asm-meta asm)))))
|
1205
|
+
|
1206
|
+
(define-macro-assembler (end-program asm)
|
1207
|
+
(let ((meta (car (asm-meta asm))))
|
1208
|
+
(set-meta-high-pc! meta (asm-start asm))
|
1209
|
+
(set-meta-arities! meta (reverse (meta-arities meta)))))
|
1210
|
+
|
1211
|
+
(define-macro-assembler (begin-standard-arity asm req nlocals alternate)
|
1212
|
+
(emit-begin-opt-arity asm req '() #f nlocals alternate))
|
1213
|
+
|
1214
|
+
(define-macro-assembler (begin-opt-arity asm req opt rest nlocals alternate)
|
1215
|
+
(emit-begin-kw-arity asm req opt rest '() #f nlocals alternate))
|
1216
|
+
|
1217
|
+
(define-macro-assembler (begin-kw-arity asm req opt rest kw-indices
|
1218
|
+
allow-other-keys? nlocals alternate)
|
1219
|
+
(assert-match req ((? symbol?) ...) "list of symbols")
|
1220
|
+
(assert-match opt ((? symbol?) ...) "list of symbols")
|
1221
|
+
(assert-match rest (or #f (? symbol?)) "#f or symbol")
|
1222
|
+
(assert-match kw-indices (((? keyword?) . (? integer?)) ...)
|
1223
|
+
"alist of keyword -> integer")
|
1224
|
+
(assert-match allow-other-keys? (? boolean?) "boolean")
|
1225
|
+
(assert-match nlocals (? integer?) "integer")
|
1226
|
+
(assert-match alternate (or #f (? exact-integer?) (? symbol?)) "#f or symbol")
|
1227
|
+
(let* ((meta (car (asm-meta asm)))
|
1228
|
+
(arity (make-arity req opt rest kw-indices allow-other-keys?
|
1229
|
+
(asm-start asm) #f '()))
|
1230
|
+
;; The procedure itself is in slot 0, in the standard calling
|
1231
|
+
;; convention. For procedure prologues, nreq includes the
|
1232
|
+
;; procedure, so here we add 1.
|
1233
|
+
(nreq (1+ (length req)))
|
1234
|
+
(nopt (length opt))
|
1235
|
+
(rest? (->bool rest)))
|
1236
|
+
(set-meta-arities! meta (cons arity (meta-arities meta)))
|
1237
|
+
(cond
|
1238
|
+
((or allow-other-keys? (pair? kw-indices))
|
1239
|
+
(emit-kw-prelude asm nreq nopt rest? kw-indices allow-other-keys?
|
1240
|
+
nlocals alternate))
|
1241
|
+
((or rest? (pair? opt))
|
1242
|
+
(emit-opt-prelude asm nreq nopt rest? nlocals alternate))
|
1243
|
+
(else
|
1244
|
+
(emit-standard-prelude asm nreq nlocals alternate)))))
|
1245
|
+
|
1246
|
+
(define-macro-assembler (end-arity asm)
|
1247
|
+
(let ((arity (car (meta-arities (car (asm-meta asm))))))
|
1248
|
+
(set-arity-definitions! arity (reverse (arity-definitions arity)))
|
1249
|
+
(set-arity-high-pc! arity (asm-start asm))))
|
1250
|
+
|
1251
|
+
(define-macro-assembler (standard-prelude asm nreq nlocals alternate)
|
1252
|
+
(cond
|
1253
|
+
(alternate
|
1254
|
+
(emit-br-if-nargs-ne asm nreq alternate)
|
1255
|
+
(emit-alloc-frame asm nlocals))
|
1256
|
+
((and (< nreq (ash 1 12)) (< (- nlocals nreq) (ash 1 12)))
|
1257
|
+
(emit-assert-nargs-ee/locals asm nreq (- nlocals nreq)))
|
1258
|
+
(else
|
1259
|
+
(emit-assert-nargs-ee asm nreq)
|
1260
|
+
(emit-alloc-frame asm nlocals))))
|
1261
|
+
|
1262
|
+
(define-macro-assembler (opt-prelude asm nreq nopt rest? nlocals alternate)
|
1263
|
+
(if alternate
|
1264
|
+
(emit-br-if-nargs-lt asm nreq alternate)
|
1265
|
+
(emit-assert-nargs-ge asm nreq))
|
1266
|
+
(cond
|
1267
|
+
(rest?
|
1268
|
+
(emit-bind-rest asm (+ nreq nopt)))
|
1269
|
+
(alternate
|
1270
|
+
(emit-br-if-nargs-gt asm (+ nreq nopt) alternate))
|
1271
|
+
(else
|
1272
|
+
(emit-assert-nargs-le asm (+ nreq nopt))))
|
1273
|
+
(emit-alloc-frame asm nlocals))
|
1274
|
+
|
1275
|
+
(define-macro-assembler (kw-prelude asm nreq nopt rest? kw-indices
|
1276
|
+
allow-other-keys? nlocals alternate)
|
1277
|
+
(if alternate
|
1278
|
+
(begin
|
1279
|
+
(emit-br-if-nargs-lt asm nreq alternate)
|
1280
|
+
(unless rest?
|
1281
|
+
(emit-br-if-npos-gt asm nreq (+ nreq nopt) alternate)))
|
1282
|
+
(emit-assert-nargs-ge asm nreq))
|
1283
|
+
(let ((ntotal (fold (lambda (kw ntotal)
|
1284
|
+
(match kw
|
1285
|
+
(((? keyword?) . idx)
|
1286
|
+
(max (1+ idx) ntotal))))
|
1287
|
+
(+ nreq nopt) kw-indices)))
|
1288
|
+
;; FIXME: port 581f410f
|
1289
|
+
(emit-bind-kwargs asm nreq
|
1290
|
+
(pack-flags allow-other-keys? rest?)
|
1291
|
+
(+ nreq nopt)
|
1292
|
+
ntotal
|
1293
|
+
(intern-constant asm kw-indices))
|
1294
|
+
(emit-alloc-frame asm nlocals)))
|
1295
|
+
|
1296
|
+
(define-macro-assembler (label asm sym)
|
1297
|
+
(hashq-set! (asm-labels asm) sym (asm-start asm)))
|
1298
|
+
|
1299
|
+
(define-macro-assembler (source asm source)
|
1300
|
+
(set-asm-sources! asm (acons (asm-start asm) source (asm-sources asm))))
|
1301
|
+
|
1302
|
+
(define-macro-assembler (definition asm name slot representation)
|
1303
|
+
(let* ((arity (car (meta-arities (car (asm-meta asm)))))
|
1304
|
+
(def (vector name slot representation
|
1305
|
+
(- (asm-start asm) (arity-low-pc arity)))))
|
1306
|
+
(set-arity-definitions! arity (cons def (arity-definitions arity)))))
|
1307
|
+
|
1308
|
+
(define-macro-assembler (cache-current-module! asm module scope)
|
1309
|
+
(let ((mod-label (intern-module-cache-cell asm scope)))
|
1310
|
+
(emit-static-set! asm module mod-label 0)))
|
1311
|
+
|
1312
|
+
(define-macro-assembler (cached-toplevel-box asm dst scope sym bound?)
|
1313
|
+
(let ((sym-label (intern-non-immediate asm sym))
|
1314
|
+
(mod-label (intern-module-cache-cell asm scope))
|
1315
|
+
(cell-label (intern-cache-cell asm scope sym)))
|
1316
|
+
(emit-toplevel-box asm dst cell-label mod-label sym-label bound?)))
|
1317
|
+
|
1318
|
+
(define-macro-assembler (cached-module-box asm dst module-name sym public? bound?)
|
1319
|
+
(let* ((sym-label (intern-non-immediate asm sym))
|
1320
|
+
(key (cons public? module-name))
|
1321
|
+
(mod-name-label (intern-constant asm key))
|
1322
|
+
(cell-label (intern-cache-cell asm key sym)))
|
1323
|
+
(emit-module-box asm dst cell-label mod-name-label sym-label bound?)))
|
1324
|
+
|
1325
|
+
(define-macro-assembler (slot-map asm proc-slot slot-map)
|
1326
|
+
(unless (zero? slot-map)
|
1327
|
+
(set-asm-slot-maps! asm (cons
|
1328
|
+
(cons* (asm-start asm) proc-slot slot-map)
|
1329
|
+
(asm-slot-maps asm)))))
|
1330
|
+
|
1331
|
+
|
1332
|
+
|
1333
|
+
;;;
|
1334
|
+
;;; Helper for linking objects.
|
1335
|
+
;;;
|
1336
|
+
|
1337
|
+
(define (make-object asm name bv relocs labels . kwargs)
|
1338
|
+
"Make a linker object. This helper handles interning the name in the
|
1339
|
+
shstrtab, assigning the size, allocating a fresh index, and defining a
|
1340
|
+
corresponding linker symbol for the start of the section."
|
1341
|
+
(let ((name-idx (intern-section-name! asm (symbol->string name)))
|
1342
|
+
(index (asm-next-section-number asm)))
|
1343
|
+
(set-asm-next-section-number! asm (1+ index))
|
1344
|
+
(make-linker-object (apply make-elf-section
|
1345
|
+
#:index index
|
1346
|
+
#:name name-idx
|
1347
|
+
#:size (bytevector-length bv)
|
1348
|
+
kwargs)
|
1349
|
+
bv relocs
|
1350
|
+
(cons (make-linker-symbol name 0) labels))))
|
1351
|
+
|
1352
|
+
|
1353
|
+
|
1354
|
+
|
1355
|
+
;;;
|
1356
|
+
;;; Linking the constant table. This code is somewhat intertwingled
|
1357
|
+
;;; with the intern-constant code above, as that procedure also
|
1358
|
+
;;; residualizes instructions to initialize constants at load time.
|
1359
|
+
;;;
|
1360
|
+
|
1361
|
+
(define (write-immediate asm buf pos bits)
|
1362
|
+
(let ((endianness (asm-endianness asm)))
|
1363
|
+
(case (asm-word-size asm)
|
1364
|
+
((4) (bytevector-u32-set! buf pos bits endianness))
|
1365
|
+
((8) (bytevector-u64-set! buf pos bits endianness))
|
1366
|
+
(else (error "bad word size" asm)))))
|
1367
|
+
|
1368
|
+
(define (write-placeholder asm buf pos)
|
1369
|
+
(write-immediate asm buf pos (immediate-bits asm #f)))
|
1370
|
+
|
1371
|
+
(define (emit-init-constants asm)
|
1372
|
+
"If there is writable data that needs initialization at runtime, emit
|
1373
|
+
a procedure to do that and return its label. Otherwise return
|
1374
|
+
@code{#f}."
|
1375
|
+
(let ((inits (asm-inits asm)))
|
1376
|
+
(and (not (null? inits))
|
1377
|
+
(let ((label (gensym "init-constants")))
|
1378
|
+
(emit-text asm
|
1379
|
+
`((begin-program ,label ())
|
1380
|
+
(assert-nargs-ee/locals 1 1)
|
1381
|
+
,@(reverse inits)
|
1382
|
+
(load-constant 0 ,*unspecified*)
|
1383
|
+
(return-values 2)
|
1384
|
+
(end-program)))
|
1385
|
+
label))))
|
1386
|
+
|
1387
|
+
(define (link-data asm data name)
|
1388
|
+
"Link the static data for a program into the @var{name} section (which
|
1389
|
+
should be .data or .rodata), and return the resulting linker object.
|
1390
|
+
@var{data} should be a vhash mapping objects to labels."
|
1391
|
+
(define (align address alignment)
|
1392
|
+
(+ address
|
1393
|
+
(modulo (- alignment (modulo address alignment)) alignment)))
|
1394
|
+
|
1395
|
+
(define tc7-vector #x0d)
|
1396
|
+
(define vector-immutable-flag #x80)
|
1397
|
+
|
1398
|
+
(define tc7-string #x15)
|
1399
|
+
(define string-read-only-flag #x200)
|
1400
|
+
|
1401
|
+
(define tc7-stringbuf #x27)
|
1402
|
+
(define stringbuf-wide-flag #x400)
|
1403
|
+
|
1404
|
+
(define tc7-syntax #x3d)
|
1405
|
+
|
1406
|
+
(define tc7-program #x45)
|
1407
|
+
|
1408
|
+
(define tc7-bytevector #x4d)
|
1409
|
+
;; This flag is intended to be left-shifted by 7 bits.
|
1410
|
+
(define bytevector-immutable-flag #x200)
|
1411
|
+
|
1412
|
+
(define tc7-array #x5d)
|
1413
|
+
|
1414
|
+
(define tc7-bitvector #x5f)
|
1415
|
+
(define bitvector-immutable-flag #x80)
|
1416
|
+
|
1417
|
+
(let ((word-size (asm-word-size asm))
|
1418
|
+
(endianness (asm-endianness asm)))
|
1419
|
+
(define (byte-length x)
|
1420
|
+
(cond
|
1421
|
+
((stringbuf? x)
|
1422
|
+
(let ((x (stringbuf-string x)))
|
1423
|
+
(+ (* 2 word-size)
|
1424
|
+
(case (string-bytes-per-char x)
|
1425
|
+
((1) (1+ (string-length x)))
|
1426
|
+
((4) (* (1+ (string-length x)) 4))
|
1427
|
+
(else (error "bad string bytes per char" x))))))
|
1428
|
+
((static-procedure? x)
|
1429
|
+
(* 2 word-size))
|
1430
|
+
((string? x)
|
1431
|
+
(* 4 word-size))
|
1432
|
+
((pair? x)
|
1433
|
+
(* 2 word-size))
|
1434
|
+
((simple-vector? x)
|
1435
|
+
(* (1+ (vector-length x)) word-size))
|
1436
|
+
((syntax? x)
|
1437
|
+
(* 4 word-size))
|
1438
|
+
((simple-uniform-vector? x)
|
1439
|
+
(* 4 word-size))
|
1440
|
+
((uniform-vector-backing-store? x)
|
1441
|
+
(bytevector-length (uniform-vector-backing-store-bytes x)))
|
1442
|
+
((array? x)
|
1443
|
+
(* word-size (+ 3 (* 3 (array-rank x)))))
|
1444
|
+
(else
|
1445
|
+
word-size)))
|
1446
|
+
|
1447
|
+
(define (write-constant-reference buf pos x)
|
1448
|
+
(let ((bits (immediate-bits asm x)))
|
1449
|
+
(if bits
|
1450
|
+
(write-immediate asm buf pos bits)
|
1451
|
+
;; The asm-inits will fix up any reference to a
|
1452
|
+
;; non-immediate.
|
1453
|
+
(write-placeholder asm buf pos))))
|
1454
|
+
|
1455
|
+
(define (write buf pos obj)
|
1456
|
+
(cond
|
1457
|
+
((stringbuf? obj)
|
1458
|
+
(let* ((x (stringbuf-string obj))
|
1459
|
+
(len (string-length x))
|
1460
|
+
(tag (logior tc7-stringbuf
|
1461
|
+
(if (= (string-bytes-per-char x) 1)
|
1462
|
+
0
|
1463
|
+
stringbuf-wide-flag))))
|
1464
|
+
(case word-size
|
1465
|
+
((4)
|
1466
|
+
(bytevector-u32-set! buf pos tag endianness)
|
1467
|
+
(bytevector-u32-set! buf (+ pos 4) len endianness))
|
1468
|
+
((8)
|
1469
|
+
(bytevector-u64-set! buf pos tag endianness)
|
1470
|
+
(bytevector-u64-set! buf (+ pos 8) len endianness))
|
1471
|
+
(else
|
1472
|
+
(error "bad word size" asm)))
|
1473
|
+
(let ((pos (+ pos (* word-size 2))))
|
1474
|
+
(case (string-bytes-per-char x)
|
1475
|
+
((1)
|
1476
|
+
(let lp ((i 0))
|
1477
|
+
(if (< i len)
|
1478
|
+
(let ((u8 (char->integer (string-ref x i))))
|
1479
|
+
(bytevector-u8-set! buf (+ pos i) u8)
|
1480
|
+
(lp (1+ i)))
|
1481
|
+
(bytevector-u8-set! buf (+ pos i) 0))))
|
1482
|
+
((4)
|
1483
|
+
(let lp ((i 0))
|
1484
|
+
(if (< i len)
|
1485
|
+
(let ((u32 (char->integer (string-ref x i))))
|
1486
|
+
(bytevector-u32-set! buf (+ pos (* i 4)) u32 endianness)
|
1487
|
+
(lp (1+ i)))
|
1488
|
+
(bytevector-u32-set! buf (+ pos (* i 4)) 0 endianness))))
|
1489
|
+
(else (error "bad string bytes per char" x))))))
|
1490
|
+
|
1491
|
+
((static-procedure? obj)
|
1492
|
+
(case word-size
|
1493
|
+
((4)
|
1494
|
+
(bytevector-u32-set! buf pos tc7-program endianness)
|
1495
|
+
(bytevector-u32-set! buf (+ pos 4) 0 endianness))
|
1496
|
+
((8)
|
1497
|
+
(bytevector-u64-set! buf pos tc7-program endianness)
|
1498
|
+
(bytevector-u64-set! buf (+ pos 8) 0 endianness))
|
1499
|
+
(else (error "bad word size"))))
|
1500
|
+
|
1501
|
+
((cache-cell? obj)
|
1502
|
+
(write-placeholder asm buf pos))
|
1503
|
+
|
1504
|
+
((string? obj)
|
1505
|
+
(let ((tag (logior tc7-string string-read-only-flag)))
|
1506
|
+
(case word-size
|
1507
|
+
((4)
|
1508
|
+
(bytevector-u32-set! buf pos tag endianness)
|
1509
|
+
(write-placeholder asm buf (+ pos 4)) ; stringbuf
|
1510
|
+
(bytevector-u32-set! buf (+ pos 8) 0 endianness)
|
1511
|
+
(bytevector-u32-set! buf (+ pos 12) (string-length obj) endianness))
|
1512
|
+
((8)
|
1513
|
+
(bytevector-u64-set! buf pos tag endianness)
|
1514
|
+
(write-placeholder asm buf (+ pos 8)) ; stringbuf
|
1515
|
+
(bytevector-u64-set! buf (+ pos 16) 0 endianness)
|
1516
|
+
(bytevector-u64-set! buf (+ pos 24) (string-length obj) endianness))
|
1517
|
+
(else (error "bad word size")))))
|
1518
|
+
|
1519
|
+
((pair? obj)
|
1520
|
+
(write-constant-reference buf pos (car obj))
|
1521
|
+
(write-constant-reference buf (+ pos word-size) (cdr obj)))
|
1522
|
+
|
1523
|
+
((simple-vector? obj)
|
1524
|
+
(let* ((len (vector-length obj))
|
1525
|
+
(tag (logior tc7-vector vector-immutable-flag (ash len 8))))
|
1526
|
+
(case word-size
|
1527
|
+
((4) (bytevector-u32-set! buf pos tag endianness))
|
1528
|
+
((8) (bytevector-u64-set! buf pos tag endianness))
|
1529
|
+
(else (error "bad word size")))
|
1530
|
+
(let lp ((i 0))
|
1531
|
+
(when (< i (vector-length obj))
|
1532
|
+
(let ((pos (+ pos word-size (* i word-size)))
|
1533
|
+
(elt (vector-ref obj i)))
|
1534
|
+
(write-constant-reference buf pos elt)
|
1535
|
+
(lp (1+ i)))))))
|
1536
|
+
|
1537
|
+
((symbol? obj)
|
1538
|
+
(write-placeholder asm buf pos))
|
1539
|
+
|
1540
|
+
((keyword? obj)
|
1541
|
+
(write-placeholder asm buf pos))
|
1542
|
+
|
1543
|
+
((syntax? obj)
|
1544
|
+
(case word-size
|
1545
|
+
((4) (bytevector-u32-set! buf pos tc7-syntax endianness))
|
1546
|
+
((8) (bytevector-u64-set! buf pos tc7-syntax endianness))
|
1547
|
+
(else (error "bad word size")))
|
1548
|
+
(write-constant-reference buf (+ pos (* 1 word-size))
|
1549
|
+
(syntax-expression obj))
|
1550
|
+
(write-constant-reference buf (+ pos (* 2 word-size))
|
1551
|
+
(syntax-wrap obj))
|
1552
|
+
(write-constant-reference buf (+ pos (* 3 word-size))
|
1553
|
+
(syntax-module obj)))
|
1554
|
+
|
1555
|
+
((number? obj)
|
1556
|
+
(write-placeholder asm buf pos))
|
1557
|
+
|
1558
|
+
((simple-uniform-vector? obj)
|
1559
|
+
(let ((tag (if (bitvector? obj)
|
1560
|
+
(logior tc7-bitvector
|
1561
|
+
bitvector-immutable-flag)
|
1562
|
+
(logior tc7-bytevector
|
1563
|
+
;; Bytevector immutable flag also shifted
|
1564
|
+
;; left.
|
1565
|
+
(ash (logior bytevector-immutable-flag
|
1566
|
+
(array-type-code obj))
|
1567
|
+
7)))))
|
1568
|
+
(case word-size
|
1569
|
+
((4)
|
1570
|
+
(bytevector-u32-set! buf pos tag endianness)
|
1571
|
+
(bytevector-u32-set! buf (+ pos 4)
|
1572
|
+
(if (bitvector? obj)
|
1573
|
+
(bitvector-length obj)
|
1574
|
+
(bytevector-length obj))
|
1575
|
+
endianness) ; length
|
1576
|
+
(bytevector-u32-set! buf (+ pos 8) 0 endianness) ; pointer
|
1577
|
+
(write-placeholder asm buf (+ pos 12))) ; owner
|
1578
|
+
((8)
|
1579
|
+
(bytevector-u64-set! buf pos tag endianness)
|
1580
|
+
(bytevector-u64-set! buf (+ pos 8)
|
1581
|
+
(if (bitvector? obj)
|
1582
|
+
(bitvector-length obj)
|
1583
|
+
(bytevector-length obj))
|
1584
|
+
endianness) ; length
|
1585
|
+
(bytevector-u64-set! buf (+ pos 16) 0 endianness) ; pointer
|
1586
|
+
(write-placeholder asm buf (+ pos 24))) ; owner
|
1587
|
+
(else (error "bad word size")))))
|
1588
|
+
|
1589
|
+
((uniform-vector-backing-store? obj)
|
1590
|
+
(let ((bv (uniform-vector-backing-store-bytes obj)))
|
1591
|
+
(bytevector-copy! bv 0 buf pos (bytevector-length bv))
|
1592
|
+
(unless (eq? endianness (native-endianness))
|
1593
|
+
(case (uniform-vector-backing-store-element-size obj)
|
1594
|
+
((1) #f) ;; Nothing to do.
|
1595
|
+
((2) (byte-swap/2! buf pos (+ pos (bytevector-length bv))))
|
1596
|
+
((4) (byte-swap/4! buf pos (+ pos (bytevector-length bv))))
|
1597
|
+
((8) (byte-swap/8! buf pos (+ pos (bytevector-length bv))))
|
1598
|
+
(else (error "FIXME: Implement byte order swap"))))))
|
1599
|
+
|
1600
|
+
((array? obj)
|
1601
|
+
(let-values
|
1602
|
+
;; array tag + rank + contp flag: see libguile/arrays.h .
|
1603
|
+
(((tag) (logior tc7-array (ash (array-rank obj) 17) (ash 1 16)))
|
1604
|
+
((bv-set! bvs-set!)
|
1605
|
+
(case word-size
|
1606
|
+
((4) (values bytevector-u32-set! bytevector-s32-set!))
|
1607
|
+
((8) (values bytevector-u64-set! bytevector-s64-set!))
|
1608
|
+
(else (error "bad word size")))))
|
1609
|
+
(bv-set! buf pos tag endianness)
|
1610
|
+
(write-placeholder asm buf (+ pos word-size)) ; root vector (fixed later)
|
1611
|
+
(bv-set! buf (+ pos (* word-size 2)) 0 endianness) ; base
|
1612
|
+
(let lp ((pos (+ pos (* word-size 3)))
|
1613
|
+
(bounds (array-shape obj))
|
1614
|
+
(incs (shared-array-increments obj)))
|
1615
|
+
(when (pair? bounds)
|
1616
|
+
(bvs-set! buf pos (first (first bounds)) endianness)
|
1617
|
+
(bvs-set! buf (+ pos word-size) (second (first bounds)) endianness)
|
1618
|
+
(bvs-set! buf (+ pos (* word-size 2)) (first incs) endianness)
|
1619
|
+
(lp (+ pos (* 3 word-size)) (cdr bounds) (cdr incs))))))
|
1620
|
+
|
1621
|
+
(else
|
1622
|
+
(error "unrecognized object" obj))))
|
1623
|
+
|
1624
|
+
(cond
|
1625
|
+
((vlist-null? data) #f)
|
1626
|
+
(else
|
1627
|
+
(let* ((byte-len (vhash-fold (lambda (k v len)
|
1628
|
+
(+ (byte-length k) (align len 8)))
|
1629
|
+
0 data))
|
1630
|
+
(buf (make-bytevector byte-len 0)))
|
1631
|
+
(let lp ((i 0) (pos 0) (symbols '()))
|
1632
|
+
(if (< i (vlist-length data))
|
1633
|
+
(let* ((pair (vlist-ref data i))
|
1634
|
+
(obj (car pair))
|
1635
|
+
(obj-label (cdr pair)))
|
1636
|
+
(write buf pos obj)
|
1637
|
+
(lp (1+ i)
|
1638
|
+
(align (+ (byte-length obj) pos) 8)
|
1639
|
+
(cons (make-linker-symbol obj-label pos) symbols)))
|
1640
|
+
(make-object asm name buf '() symbols
|
1641
|
+
#:flags (match name
|
1642
|
+
('.data (logior SHF_ALLOC SHF_WRITE))
|
1643
|
+
('.rodata SHF_ALLOC))))))))))
|
1644
|
+
|
1645
|
+
(define (link-constants asm)
|
1646
|
+
"Link sections to hold constants needed by the program text emitted
|
1647
|
+
using @var{asm}.
|
1648
|
+
|
1649
|
+
Returns three values: an object for the .rodata section, an object for
|
1650
|
+
the .data section, and a label for an initialization procedure. Any of
|
1651
|
+
these may be @code{#f}."
|
1652
|
+
(define (shareable? x)
|
1653
|
+
(cond
|
1654
|
+
((stringbuf? x) #t)
|
1655
|
+
((pair? x)
|
1656
|
+
(and (immediate-bits asm (car x)) (immediate-bits asm (cdr x))))
|
1657
|
+
((simple-vector? x)
|
1658
|
+
(let lp ((i 0))
|
1659
|
+
(or (= i (vector-length x))
|
1660
|
+
(and (immediate-bits asm (vector-ref x i))
|
1661
|
+
(lp (1+ i))))))
|
1662
|
+
((uniform-vector-backing-store? x) #t)
|
1663
|
+
(else #f)))
|
1664
|
+
(let* ((constants (asm-constants asm))
|
1665
|
+
(len (vlist-length constants)))
|
1666
|
+
(let lp ((i 0)
|
1667
|
+
(ro vlist-null)
|
1668
|
+
(rw vlist-null))
|
1669
|
+
(if (= i len)
|
1670
|
+
(values (link-data asm ro '.rodata)
|
1671
|
+
(link-data asm rw '.data)
|
1672
|
+
(emit-init-constants asm))
|
1673
|
+
(let ((pair (vlist-ref constants i)))
|
1674
|
+
(if (shareable? (car pair))
|
1675
|
+
(lp (1+ i) (vhash-consq (car pair) (cdr pair) ro) rw)
|
1676
|
+
(lp (1+ i) ro (vhash-consq (car pair) (cdr pair) rw))))))))
|
1677
|
+
|
1678
|
+
|
1679
|
+
|
1680
|
+
;;;
|
1681
|
+
;;; Linking program text.
|
1682
|
+
;;;
|
1683
|
+
|
1684
|
+
(define (process-relocs buf relocs labels)
|
1685
|
+
"Patch up internal x8-s24 relocations, and any s32 relocations that
|
1686
|
+
reference symbols in the text section. Return a list of linker
|
1687
|
+
relocations for references to symbols defined outside the text section."
|
1688
|
+
(fold
|
1689
|
+
(lambda (reloc tail)
|
1690
|
+
(match reloc
|
1691
|
+
((type label base offset)
|
1692
|
+
(let ((abs (hashq-ref labels label))
|
1693
|
+
(dst (+ base offset)))
|
1694
|
+
(case type
|
1695
|
+
((s32)
|
1696
|
+
(if abs
|
1697
|
+
(let ((rel (- abs base)))
|
1698
|
+
(unless (zero? (logand rel #x3))
|
1699
|
+
(error "reloc not in 32-bit units!"))
|
1700
|
+
(bytevector-s32-native-set! buf dst (ash rel -2))
|
1701
|
+
tail)
|
1702
|
+
(cons (make-linker-reloc 'rel32/4 dst offset label)
|
1703
|
+
tail)))
|
1704
|
+
((x8-s24)
|
1705
|
+
(unless abs
|
1706
|
+
(error "unbound near relocation" reloc))
|
1707
|
+
(let ((rel (- abs base))
|
1708
|
+
(u32 (bytevector-u32-native-ref buf dst)))
|
1709
|
+
(unless (zero? (logand rel #x3))
|
1710
|
+
(error "reloc not in 32-bit units!"))
|
1711
|
+
(bytevector-u32-native-set! buf dst
|
1712
|
+
(pack-u8-s24 (logand u32 #xff)
|
1713
|
+
(ash rel -2)))
|
1714
|
+
tail))
|
1715
|
+
(else (error "bad relocation kind" reloc)))))))
|
1716
|
+
'()
|
1717
|
+
relocs))
|
1718
|
+
|
1719
|
+
(define (process-labels labels)
|
1720
|
+
"Define linker symbols for the label-offset map in @var{labels}.
|
1721
|
+
The offsets are expected to be expressed in words."
|
1722
|
+
(hash-map->list (lambda (label loc)
|
1723
|
+
(make-linker-symbol label loc))
|
1724
|
+
labels))
|
1725
|
+
|
1726
|
+
(define (link-text-object asm)
|
1727
|
+
"Link the .rtl-text section, swapping the endianness of the bytes if
|
1728
|
+
needed."
|
1729
|
+
(let ((buf (make-bytevector (asm-pos asm))))
|
1730
|
+
(bytevector-copy! (asm-buf asm) 0 buf 0 (bytevector-length buf))
|
1731
|
+
(unless (eq? (asm-endianness asm) (native-endianness))
|
1732
|
+
(byte-swap/4! buf))
|
1733
|
+
(make-object asm '.rtl-text
|
1734
|
+
buf
|
1735
|
+
(process-relocs buf (asm-relocs asm)
|
1736
|
+
(asm-labels asm))
|
1737
|
+
(process-labels (asm-labels asm)))))
|
1738
|
+
|
1739
|
+
|
1740
|
+
|
1741
|
+
|
1742
|
+
;;;
|
1743
|
+
;;; Create the frame maps. These maps are used by GC to identify dead
|
1744
|
+
;;; slots in pending call frames, to avoid marking them. We only do
|
1745
|
+
;;; this when frame makes a non-tail call, as that is the common case.
|
1746
|
+
;;; Only the topmost frame will see a GC at any other point, but we mark
|
1747
|
+
;;; top frames conservatively as serializing live slot maps at every
|
1748
|
+
;;; instruction would take up too much space in the object file.
|
1749
|
+
;;;
|
1750
|
+
|
1751
|
+
;; The .guile.frame-maps section starts with two packed u32 values: one
|
1752
|
+
;; indicating the offset of the first byte of the .rtl-text section, and
|
1753
|
+
;; another indicating the relative offset in bytes of the slots data.
|
1754
|
+
(define frame-maps-prefix-len 8)
|
1755
|
+
|
1756
|
+
;; Each header is 8 bytes: 4 for the offset from .rtl_text, and 4 for
|
1757
|
+
;; the offset of the slot map from the beginning of the
|
1758
|
+
;; .guile.frame-maps section. The length of a frame map depends on the
|
1759
|
+
;; frame size at the call site, and is not encoded into this section as
|
1760
|
+
;; it is available at run-time.
|
1761
|
+
(define frame-map-header-len 8)
|
1762
|
+
|
1763
|
+
(define (link-frame-maps asm)
|
1764
|
+
(define (map-byte-length proc-slot)
|
1765
|
+
(ceiling-quotient (* 2 (- proc-slot 2)) 8))
|
1766
|
+
(define (make-frame-maps maps count map-len)
|
1767
|
+
(let* ((endianness (asm-endianness asm))
|
1768
|
+
(header-pos frame-maps-prefix-len)
|
1769
|
+
(map-pos (+ header-pos (* count frame-map-header-len)))
|
1770
|
+
(bv (make-bytevector (+ map-pos map-len) 0)))
|
1771
|
+
(bytevector-u32-set! bv 4 map-pos endianness)
|
1772
|
+
(let lp ((maps maps) (header-pos header-pos) (map-pos map-pos))
|
1773
|
+
(match maps
|
1774
|
+
(()
|
1775
|
+
(make-object asm '.guile.frame-maps bv
|
1776
|
+
(list (make-linker-reloc 'abs32/1 0 0 '.rtl-text))
|
1777
|
+
'() #:type SHT_PROGBITS #:flags SHF_ALLOC))
|
1778
|
+
(((pos proc-slot . map) . maps)
|
1779
|
+
(bytevector-u32-set! bv header-pos pos endianness)
|
1780
|
+
(bytevector-u32-set! bv (+ header-pos 4) map-pos endianness)
|
1781
|
+
(let write-bytes ((map-pos map-pos)
|
1782
|
+
(map map)
|
1783
|
+
(byte-length (map-byte-length proc-slot)))
|
1784
|
+
(if (zero? byte-length)
|
1785
|
+
(lp maps (+ header-pos frame-map-header-len) map-pos)
|
1786
|
+
(begin
|
1787
|
+
(bytevector-u8-set! bv map-pos (logand map #xff))
|
1788
|
+
(write-bytes (1+ map-pos) (ash map -8)
|
1789
|
+
(1- byte-length))))))))))
|
1790
|
+
(match (asm-slot-maps asm)
|
1791
|
+
(() #f)
|
1792
|
+
(in
|
1793
|
+
(let lp ((in in) (out '()) (count 0) (map-len 0))
|
1794
|
+
(match in
|
1795
|
+
(() (make-frame-maps out count map-len))
|
1796
|
+
(((and head (pos proc-slot . map)) . in)
|
1797
|
+
(lp in (cons head out)
|
1798
|
+
(1+ count)
|
1799
|
+
(+ (map-byte-length proc-slot) map-len))))))))
|
1800
|
+
|
1801
|
+
|
1802
|
+
|
1803
|
+
;;;
|
1804
|
+
;;; Linking other sections of the ELF file, like the dynamic segment,
|
1805
|
+
;;; the symbol table, etc.
|
1806
|
+
;;;
|
1807
|
+
|
1808
|
+
;; FIXME: Define these somewhere central, shared with C.
|
1809
|
+
(define *bytecode-major-version* #x0202)
|
1810
|
+
(define *bytecode-minor-version* (char->integer #\A))
|
1811
|
+
|
1812
|
+
(define (link-dynamic-section asm text rw rw-init frame-maps)
|
1813
|
+
"Link the dynamic section for an ELF image with bytecode @var{text},
|
1814
|
+
given the writable data section @var{rw} needing fixup from the
|
1815
|
+
procedure with label @var{rw-init}. @var{rw-init} may be false. If
|
1816
|
+
@var{rw} is true, it will be added to the GC roots at runtime."
|
1817
|
+
(define-syntax-rule (emit-dynamic-section word-size %set-uword! reloc-type)
|
1818
|
+
(let* ((endianness (asm-endianness asm))
|
1819
|
+
(words 6)
|
1820
|
+
(words (if rw (+ words 4) words))
|
1821
|
+
(words (if rw-init (+ words 2) words))
|
1822
|
+
(words (if frame-maps (+ words 2) words))
|
1823
|
+
(bv (make-bytevector (* word-size words) 0))
|
1824
|
+
(set-uword!
|
1825
|
+
(lambda (i uword)
|
1826
|
+
(%set-uword! bv (* i word-size) uword endianness)))
|
1827
|
+
(relocs '())
|
1828
|
+
(set-label!
|
1829
|
+
(lambda (i label)
|
1830
|
+
(set! relocs (cons (make-linker-reloc 'reloc-type
|
1831
|
+
(* i word-size) 0 label)
|
1832
|
+
relocs))
|
1833
|
+
(%set-uword! bv (* i word-size) 0 endianness))))
|
1834
|
+
(set-uword! 0 DT_GUILE_VM_VERSION)
|
1835
|
+
(set-uword! 1 (logior (ash *bytecode-major-version* 16)
|
1836
|
+
*bytecode-minor-version*))
|
1837
|
+
(set-uword! 2 DT_GUILE_ENTRY)
|
1838
|
+
(set-label! 3 '.rtl-text)
|
1839
|
+
(when rw
|
1840
|
+
;; Add roots to GC.
|
1841
|
+
(set-uword! 4 DT_GUILE_GC_ROOT)
|
1842
|
+
(set-label! 5 '.data)
|
1843
|
+
(set-uword! 6 DT_GUILE_GC_ROOT_SZ)
|
1844
|
+
(set-uword! 7 (bytevector-length (linker-object-bv rw)))
|
1845
|
+
(when rw-init
|
1846
|
+
(set-uword! 8 DT_INIT) ; constants
|
1847
|
+
(set-label! 9 rw-init)))
|
1848
|
+
(when frame-maps
|
1849
|
+
(set-uword! (- words 4) DT_GUILE_FRAME_MAPS)
|
1850
|
+
(set-label! (- words 3) '.guile.frame-maps))
|
1851
|
+
(set-uword! (- words 2) DT_NULL)
|
1852
|
+
(set-uword! (- words 1) 0)
|
1853
|
+
(make-object asm '.dynamic bv relocs '()
|
1854
|
+
#:type SHT_DYNAMIC #:flags SHF_ALLOC)))
|
1855
|
+
(case (asm-word-size asm)
|
1856
|
+
((4) (emit-dynamic-section 4 bytevector-u32-set! abs32/1))
|
1857
|
+
((8) (emit-dynamic-section 8 bytevector-u64-set! abs64/1))
|
1858
|
+
(else (error "bad word size" asm))))
|
1859
|
+
|
1860
|
+
(define (link-shstrtab asm)
|
1861
|
+
"Link the string table for the section headers."
|
1862
|
+
(intern-section-name! asm ".shstrtab")
|
1863
|
+
(make-object asm '.shstrtab
|
1864
|
+
(link-string-table! (asm-shstrtab asm))
|
1865
|
+
'() '()
|
1866
|
+
#:type SHT_STRTAB #:flags 0))
|
1867
|
+
|
1868
|
+
(define (link-symtab text-section asm)
|
1869
|
+
(let* ((endianness (asm-endianness asm))
|
1870
|
+
(word-size (asm-word-size asm))
|
1871
|
+
(size (elf-symbol-len word-size))
|
1872
|
+
(meta (reverse (asm-meta asm)))
|
1873
|
+
(n (length meta))
|
1874
|
+
(strtab (make-string-table))
|
1875
|
+
(bv (make-bytevector (* n size) 0)))
|
1876
|
+
(define (intern-string! name)
|
1877
|
+
(string-table-intern! strtab (if name (symbol->string name) "")))
|
1878
|
+
(for-each
|
1879
|
+
(lambda (meta n)
|
1880
|
+
(let ((name (intern-string! (meta-name meta))))
|
1881
|
+
(write-elf-symbol bv (* n size) endianness word-size
|
1882
|
+
(make-elf-symbol
|
1883
|
+
#:name name
|
1884
|
+
;; Symbol value and size are measured in
|
1885
|
+
;; bytes, not u32s.
|
1886
|
+
#:value (meta-low-pc meta)
|
1887
|
+
#:size (- (meta-high-pc meta)
|
1888
|
+
(meta-low-pc meta))
|
1889
|
+
#:type STT_FUNC
|
1890
|
+
#:visibility STV_HIDDEN
|
1891
|
+
#:shndx (elf-section-index text-section)))))
|
1892
|
+
meta (iota n))
|
1893
|
+
(let ((strtab (make-object asm '.strtab
|
1894
|
+
(link-string-table! strtab)
|
1895
|
+
'() '()
|
1896
|
+
#:type SHT_STRTAB #:flags 0)))
|
1897
|
+
(values (make-object asm '.symtab
|
1898
|
+
bv
|
1899
|
+
'() '()
|
1900
|
+
#:type SHT_SYMTAB #:flags 0 #:entsize size
|
1901
|
+
#:link (elf-section-index
|
1902
|
+
(linker-object-section strtab)))
|
1903
|
+
strtab))))
|
1904
|
+
|
1905
|
+
;;; The .guile.arities section describes the arities that a function can
|
1906
|
+
;;; have. It is in two parts: a sorted array of headers describing
|
1907
|
+
;;; basic arities, and an array of links out to a string table (and in
|
1908
|
+
;;; the case of keyword arguments, to the data section) for argument
|
1909
|
+
;;; names. The whole thing is prefixed by a uint32 indicating the
|
1910
|
+
;;; offset of the end of the headers array.
|
1911
|
+
;;;
|
1912
|
+
;;; The arity headers array is a packed array of structures of the form:
|
1913
|
+
;;;
|
1914
|
+
;;; struct arity_header {
|
1915
|
+
;;; uint32_t low_pc;
|
1916
|
+
;;; uint32_t high_pc;
|
1917
|
+
;;; uint32_t offset;
|
1918
|
+
;;; uint32_t flags;
|
1919
|
+
;;; uint32_t nreq;
|
1920
|
+
;;; uint32_t nopt;
|
1921
|
+
;;; uint32_t nlocals;
|
1922
|
+
;;; }
|
1923
|
+
;;;
|
1924
|
+
;;; All of the offsets and addresses are 32 bits. We can expand in the
|
1925
|
+
;;; future to use 64-bit offsets if appropriate, but there are other
|
1926
|
+
;;; aspects of bytecode that constrain us to a total image that fits in
|
1927
|
+
;;; 32 bits, so for the moment we'll simplify the problem space.
|
1928
|
+
;;;
|
1929
|
+
;;; The following flags values are defined:
|
1930
|
+
;;;
|
1931
|
+
;;; #x1: has-rest?
|
1932
|
+
;;; #x2: allow-other-keys?
|
1933
|
+
;;; #x4: has-keyword-args?
|
1934
|
+
;;; #x8: is-case-lambda?
|
1935
|
+
;;; #x10: is-in-case-lambda?
|
1936
|
+
;;;
|
1937
|
+
;;; Functions with a single arity specify their number of required and
|
1938
|
+
;;; optional arguments in nreq and nopt, and do not have the
|
1939
|
+
;;; is-case-lambda? flag set. Their "offset" member links to an array
|
1940
|
+
;;; of pointers into the associated .guile.arities.strtab string table,
|
1941
|
+
;;; identifying the argument names. This offset is relative to the
|
1942
|
+
;;; start of the .guile.arities section.
|
1943
|
+
;;;
|
1944
|
+
;;; If the arity has keyword arguments -- if has-keyword-args? is set in
|
1945
|
+
;;; the flags -- the first uint32 pointed to by offset encodes a link to
|
1946
|
+
;;; the "keyword indices" literal, in the data section. Then follow the
|
1947
|
+
;;; names for all locals, in order, as uleb128 values. The required
|
1948
|
+
;;; arguments will be the first locals, followed by the optionals,
|
1949
|
+
;;; followed by the rest argument if if has-rest? is set. The names
|
1950
|
+
;;; point into the associated string table section.
|
1951
|
+
;;;
|
1952
|
+
;;; Functions with no arities have no arities information present in the
|
1953
|
+
;;; .guile.arities section.
|
1954
|
+
;;;
|
1955
|
+
;;; Functions with multiple arities are preceded by a header with
|
1956
|
+
;;; is-case-lambda? set. All other fields are 0, except low-pc and
|
1957
|
+
;;; high-pc which should be the bounds of the whole function. Headers
|
1958
|
+
;;; for the individual arities follow, with the is-in-case-lambda? flag
|
1959
|
+
;;; set. In this way the whole headers array is sorted in increasing
|
1960
|
+
;;; low-pc order, and case-lambda clauses are contained within the
|
1961
|
+
;;; [low-pc, high-pc] of the case-lambda header.
|
1962
|
+
|
1963
|
+
;; Length of the prefix to the arities section, in bytes.
|
1964
|
+
(define arities-prefix-len 4)
|
1965
|
+
|
1966
|
+
;; Length of an arity header, in bytes.
|
1967
|
+
(define arity-header-len (* 7 4))
|
1968
|
+
|
1969
|
+
;; Some helpers.
|
1970
|
+
(define (put-uleb128 port val)
|
1971
|
+
(let lp ((val val))
|
1972
|
+
(let ((next (ash val -7)))
|
1973
|
+
(if (zero? next)
|
1974
|
+
(put-u8 port val)
|
1975
|
+
(begin
|
1976
|
+
(put-u8 port (logior #x80 (logand val #x7f)))
|
1977
|
+
(lp next))))))
|
1978
|
+
|
1979
|
+
(define (put-sleb128 port val)
|
1980
|
+
(let lp ((val val))
|
1981
|
+
(if (<= 0 (+ val 64) 127)
|
1982
|
+
(put-u8 port (logand val #x7f))
|
1983
|
+
(begin
|
1984
|
+
(put-u8 port (logior #x80 (logand val #x7f)))
|
1985
|
+
(lp (ash val -7))))))
|
1986
|
+
|
1987
|
+
(define (port-position port)
|
1988
|
+
(seek port 0 SEEK_CUR))
|
1989
|
+
|
1990
|
+
(define-inline (pack-arity-flags has-rest? allow-other-keys?
|
1991
|
+
has-keyword-args? is-case-lambda?
|
1992
|
+
is-in-case-lambda?)
|
1993
|
+
(logior (if has-rest? (ash 1 0) 0)
|
1994
|
+
(if allow-other-keys? (ash 1 1) 0)
|
1995
|
+
(if has-keyword-args? (ash 1 2) 0)
|
1996
|
+
(if is-case-lambda? (ash 1 3) 0)
|
1997
|
+
(if is-in-case-lambda? (ash 1 4) 0)))
|
1998
|
+
|
1999
|
+
(define (write-arities asm metas headers names-port strtab)
|
2000
|
+
(define (write-header pos low-pc high-pc offset flags nreq nopt nlocals)
|
2001
|
+
(unless (<= (+ nreq nopt) nlocals)
|
2002
|
+
(error "forgot to emit definition instructions?"))
|
2003
|
+
(bytevector-u32-set! headers pos low-pc (asm-endianness asm))
|
2004
|
+
(bytevector-u32-set! headers (+ pos 4) high-pc (asm-endianness asm))
|
2005
|
+
(bytevector-u32-set! headers (+ pos 8) offset (asm-endianness asm))
|
2006
|
+
(bytevector-u32-set! headers (+ pos 12) flags (asm-endianness asm))
|
2007
|
+
(bytevector-u32-set! headers (+ pos 16) nreq (asm-endianness asm))
|
2008
|
+
(bytevector-u32-set! headers (+ pos 20) nopt (asm-endianness asm))
|
2009
|
+
(bytevector-u32-set! headers (+ pos 24) nlocals (asm-endianness asm)))
|
2010
|
+
(define (write-kw-indices kw-indices relocs)
|
2011
|
+
;; FIXME: Assert that kw-indices is already interned.
|
2012
|
+
(if (pair? kw-indices)
|
2013
|
+
(let ((pos (+ (bytevector-length headers)
|
2014
|
+
(port-position names-port)))
|
2015
|
+
(label (intern-constant asm kw-indices)))
|
2016
|
+
(put-bytevector names-port #vu8(0 0 0 0))
|
2017
|
+
(cons (make-linker-reloc 'abs32/1 pos 0 label) relocs))
|
2018
|
+
relocs))
|
2019
|
+
(define (write-arity pos arity in-case-lambda? relocs)
|
2020
|
+
(write-header pos (arity-low-pc arity)
|
2021
|
+
(arity-high-pc arity)
|
2022
|
+
;; FIXME: Seems silly to add on bytevector-length of
|
2023
|
+
;; headers, given the arities-prefix.
|
2024
|
+
(+ (bytevector-length headers) (port-position names-port))
|
2025
|
+
(pack-arity-flags (arity-rest arity)
|
2026
|
+
(arity-allow-other-keys? arity)
|
2027
|
+
(pair? (arity-kw-indices arity))
|
2028
|
+
#f
|
2029
|
+
in-case-lambda?)
|
2030
|
+
(length (arity-req arity))
|
2031
|
+
(length (arity-opt arity))
|
2032
|
+
(length (arity-definitions arity)))
|
2033
|
+
(let ((relocs (write-kw-indices (arity-kw-indices arity) relocs)))
|
2034
|
+
;; Write local names.
|
2035
|
+
(let lp ((definitions (arity-definitions arity)))
|
2036
|
+
(match definitions
|
2037
|
+
(() relocs)
|
2038
|
+
((#(name slot representation def) . definitions)
|
2039
|
+
(let ((sym (if (symbol? name)
|
2040
|
+
(string-table-intern! strtab (symbol->string name))
|
2041
|
+
0)))
|
2042
|
+
(put-uleb128 names-port sym)
|
2043
|
+
(lp definitions)))))
|
2044
|
+
;; Now write their definitions.
|
2045
|
+
(let lp ((definitions (arity-definitions arity)))
|
2046
|
+
(match definitions
|
2047
|
+
(() relocs)
|
2048
|
+
((#(name slot representation def) . definitions)
|
2049
|
+
(put-uleb128 names-port def)
|
2050
|
+
(let ((tag (case representation
|
2051
|
+
((scm) 0)
|
2052
|
+
((f64) 1)
|
2053
|
+
((u64) 2)
|
2054
|
+
((s64) 3)
|
2055
|
+
(else (error "what!" representation)))))
|
2056
|
+
(put-uleb128 names-port (logior (ash slot 2) tag)))
|
2057
|
+
(lp definitions))))))
|
2058
|
+
(let lp ((metas metas) (pos arities-prefix-len) (relocs '()))
|
2059
|
+
(match metas
|
2060
|
+
(()
|
2061
|
+
(unless (= pos (bytevector-length headers))
|
2062
|
+
(error "expected to fully fill the bytevector"
|
2063
|
+
pos (bytevector-length headers)))
|
2064
|
+
relocs)
|
2065
|
+
((meta . metas)
|
2066
|
+
(match (meta-arities meta)
|
2067
|
+
(() (lp metas pos relocs))
|
2068
|
+
((arity)
|
2069
|
+
(lp metas
|
2070
|
+
(+ pos arity-header-len)
|
2071
|
+
(write-arity pos arity #f relocs)))
|
2072
|
+
(arities
|
2073
|
+
;; Write a case-lambda header, then individual arities.
|
2074
|
+
;; The case-lambda header's offset link is 0.
|
2075
|
+
(write-header pos (meta-low-pc meta) (meta-high-pc meta) 0
|
2076
|
+
(pack-arity-flags #f #f #f #t #f) 0 0 0)
|
2077
|
+
(let lp* ((arities arities) (pos (+ pos arity-header-len))
|
2078
|
+
(relocs relocs))
|
2079
|
+
(match arities
|
2080
|
+
(() (lp metas pos relocs))
|
2081
|
+
((arity . arities)
|
2082
|
+
(lp* arities
|
2083
|
+
(+ pos arity-header-len)
|
2084
|
+
(write-arity pos arity #t relocs)))))))))))
|
2085
|
+
|
2086
|
+
(define (link-arities asm)
|
2087
|
+
(define (meta-arities-header-size meta)
|
2088
|
+
(define (lambda-size arity)
|
2089
|
+
arity-header-len)
|
2090
|
+
(define (case-lambda-size arities)
|
2091
|
+
(fold +
|
2092
|
+
arity-header-len ;; case-lambda header
|
2093
|
+
(map lambda-size arities))) ;; the cases
|
2094
|
+
(match (meta-arities meta)
|
2095
|
+
(() 0)
|
2096
|
+
((arity) (lambda-size arity))
|
2097
|
+
(arities (case-lambda-size arities))))
|
2098
|
+
|
2099
|
+
(define (bytevector-append a b)
|
2100
|
+
(let ((out (make-bytevector (+ (bytevector-length a)
|
2101
|
+
(bytevector-length b)))))
|
2102
|
+
(bytevector-copy! a 0 out 0 (bytevector-length a))
|
2103
|
+
(bytevector-copy! b 0 out (bytevector-length a) (bytevector-length b))
|
2104
|
+
out))
|
2105
|
+
|
2106
|
+
(let* ((endianness (asm-endianness asm))
|
2107
|
+
(metas (reverse (asm-meta asm)))
|
2108
|
+
(header-size (fold (lambda (meta size)
|
2109
|
+
(+ size (meta-arities-header-size meta)))
|
2110
|
+
arities-prefix-len
|
2111
|
+
metas))
|
2112
|
+
(strtab (make-string-table))
|
2113
|
+
(headers (make-bytevector header-size 0)))
|
2114
|
+
(bytevector-u32-set! headers 0 (bytevector-length headers) endianness)
|
2115
|
+
(let-values (((names-port get-name-bv) (open-bytevector-output-port)))
|
2116
|
+
(let* ((relocs (write-arities asm metas headers names-port strtab))
|
2117
|
+
(strtab (make-object asm '.guile.arities.strtab
|
2118
|
+
(link-string-table! strtab)
|
2119
|
+
'() '()
|
2120
|
+
#:type SHT_STRTAB #:flags 0)))
|
2121
|
+
(values (make-object asm '.guile.arities
|
2122
|
+
(bytevector-append headers (get-name-bv))
|
2123
|
+
relocs '()
|
2124
|
+
#:type SHT_PROGBITS #:flags 0
|
2125
|
+
#:link (elf-section-index
|
2126
|
+
(linker-object-section strtab)))
|
2127
|
+
strtab)))))
|
2128
|
+
|
2129
|
+
;;;
|
2130
|
+
;;; The .guile.docstrs section is a packed, sorted array of (pc, str)
|
2131
|
+
;;; values. Pc and str are both 32 bits wide. (Either could change to
|
2132
|
+
;;; 64 bits if appropriate in the future.) Pc is the address of the
|
2133
|
+
;;; entry to a program, relative to the start of the text section, in
|
2134
|
+
;;; bytes, and str is an index into the associated .guile.docstrs.strtab
|
2135
|
+
;;; string table section.
|
2136
|
+
;;;
|
2137
|
+
|
2138
|
+
;; The size of a docstrs entry, in bytes.
|
2139
|
+
(define docstr-size 8)
|
2140
|
+
|
2141
|
+
(define (link-docstrs asm)
|
2142
|
+
(define (find-docstrings)
|
2143
|
+
(filter-map (lambda (meta)
|
2144
|
+
(define (is-documentation? pair)
|
2145
|
+
(eq? (car pair) 'documentation))
|
2146
|
+
(let* ((props (meta-properties meta))
|
2147
|
+
(tail (find-tail is-documentation? props)))
|
2148
|
+
(and tail
|
2149
|
+
(not (find-tail is-documentation? (cdr tail)))
|
2150
|
+
(string? (cdar tail))
|
2151
|
+
(cons (meta-low-pc meta) (cdar tail)))))
|
2152
|
+
(reverse (asm-meta asm))))
|
2153
|
+
(let* ((endianness (asm-endianness asm))
|
2154
|
+
(docstrings (find-docstrings))
|
2155
|
+
(strtab (make-string-table))
|
2156
|
+
(bv (make-bytevector (* (length docstrings) docstr-size) 0)))
|
2157
|
+
(fold (lambda (pair pos)
|
2158
|
+
(match pair
|
2159
|
+
((pc . string)
|
2160
|
+
(bytevector-u32-set! bv pos pc endianness)
|
2161
|
+
(bytevector-u32-set! bv (+ pos 4)
|
2162
|
+
(string-table-intern! strtab string)
|
2163
|
+
endianness)
|
2164
|
+
(+ pos docstr-size))))
|
2165
|
+
0
|
2166
|
+
docstrings)
|
2167
|
+
(let ((strtab (make-object asm '.guile.docstrs.strtab
|
2168
|
+
(link-string-table! strtab)
|
2169
|
+
'() '()
|
2170
|
+
#:type SHT_STRTAB #:flags 0)))
|
2171
|
+
(values (make-object asm '.guile.docstrs
|
2172
|
+
bv
|
2173
|
+
'() '()
|
2174
|
+
#:type SHT_PROGBITS #:flags 0
|
2175
|
+
#:link (elf-section-index
|
2176
|
+
(linker-object-section strtab)))
|
2177
|
+
strtab))))
|
2178
|
+
|
2179
|
+
;;;
|
2180
|
+
;;; The .guile.procprops section is a packed, sorted array of (pc, addr)
|
2181
|
+
;;; values. Pc and addr are both 32 bits wide. (Either could change to
|
2182
|
+
;;; 64 bits if appropriate in the future.) Pc is the address of the
|
2183
|
+
;;; entry to a program, relative to the start of the text section, and
|
2184
|
+
;;; addr is the address of the associated properties alist, relative to
|
2185
|
+
;;; the start of the ELF image.
|
2186
|
+
;;;
|
2187
|
+
;;; Since procedure properties are stored in the data sections, we need
|
2188
|
+
;;; to link the procedures property section first. (Note that this
|
2189
|
+
;;; constraint does not apply to the arities section, which may
|
2190
|
+
;;; reference the data sections via the kw-indices literal, because
|
2191
|
+
;;; assembling the text section already makes sure that the kw-indices
|
2192
|
+
;;; are interned.)
|
2193
|
+
;;;
|
2194
|
+
|
2195
|
+
;; The size of a procprops entry, in bytes.
|
2196
|
+
(define procprops-size 8)
|
2197
|
+
|
2198
|
+
(define (link-procprops asm)
|
2199
|
+
(define (assoc-remove-one alist key value-pred)
|
2200
|
+
(match alist
|
2201
|
+
(() '())
|
2202
|
+
((((? (lambda (x) (eq? x key))) . value) . alist)
|
2203
|
+
(if (value-pred value)
|
2204
|
+
alist
|
2205
|
+
(acons key value alist)))
|
2206
|
+
(((k . v) . alist)
|
2207
|
+
(acons k v (assoc-remove-one alist key value-pred)))))
|
2208
|
+
(define (props-without-name-or-docstring meta)
|
2209
|
+
(assoc-remove-one
|
2210
|
+
(assoc-remove-one (meta-properties meta) 'name (lambda (x) #t))
|
2211
|
+
'documentation
|
2212
|
+
string?))
|
2213
|
+
(define (find-procprops)
|
2214
|
+
(filter-map (lambda (meta)
|
2215
|
+
(let ((props (props-without-name-or-docstring meta)))
|
2216
|
+
(and (pair? props)
|
2217
|
+
(cons (meta-low-pc meta) props))))
|
2218
|
+
(reverse (asm-meta asm))))
|
2219
|
+
(let* ((endianness (asm-endianness asm))
|
2220
|
+
(procprops (find-procprops))
|
2221
|
+
(bv (make-bytevector (* (length procprops) procprops-size) 0)))
|
2222
|
+
(let lp ((procprops procprops) (pos 0) (relocs '()))
|
2223
|
+
(match procprops
|
2224
|
+
(()
|
2225
|
+
(make-object asm '.guile.procprops
|
2226
|
+
bv
|
2227
|
+
relocs '()
|
2228
|
+
#:type SHT_PROGBITS #:flags 0))
|
2229
|
+
(((pc . props) . procprops)
|
2230
|
+
(bytevector-u32-set! bv pos pc endianness)
|
2231
|
+
(lp procprops
|
2232
|
+
(+ pos procprops-size)
|
2233
|
+
(cons (make-linker-reloc 'abs32/1 (+ pos 4) 0
|
2234
|
+
(intern-constant asm props))
|
2235
|
+
relocs)))))))
|
2236
|
+
|
2237
|
+
;;;
|
2238
|
+
;;; The DWARF .debug_info, .debug_abbrev, .debug_str, and .debug_loc
|
2239
|
+
;;; sections provide line number and local variable liveness
|
2240
|
+
;;; information. Their format is defined by the DWARF
|
2241
|
+
;;; specifications.
|
2242
|
+
;;;
|
2243
|
+
|
2244
|
+
(define (asm-language asm)
|
2245
|
+
;; FIXME: Plumb language through to the assembler.
|
2246
|
+
'scheme)
|
2247
|
+
|
2248
|
+
;; -> 5 values: .debug_info, .debug_abbrev, .debug_str, .debug_loc, .debug_lines
|
2249
|
+
(define (link-debug asm)
|
2250
|
+
(define (put-s8 port val)
|
2251
|
+
(let ((bv (make-bytevector 1)))
|
2252
|
+
(bytevector-s8-set! bv 0 val)
|
2253
|
+
(put-bytevector port bv)))
|
2254
|
+
|
2255
|
+
(define (put-u16 port val)
|
2256
|
+
(let ((bv (make-bytevector 2)))
|
2257
|
+
(bytevector-u16-set! bv 0 val (asm-endianness asm))
|
2258
|
+
(put-bytevector port bv)))
|
2259
|
+
|
2260
|
+
(define (put-u32 port val)
|
2261
|
+
(let ((bv (make-bytevector 4)))
|
2262
|
+
(bytevector-u32-set! bv 0 val (asm-endianness asm))
|
2263
|
+
(put-bytevector port bv)))
|
2264
|
+
|
2265
|
+
(define (put-u64 port val)
|
2266
|
+
(let ((bv (make-bytevector 8)))
|
2267
|
+
(bytevector-u64-set! bv 0 val (asm-endianness asm))
|
2268
|
+
(put-bytevector port bv)))
|
2269
|
+
|
2270
|
+
(define (meta->subprogram-die meta)
|
2271
|
+
`(subprogram
|
2272
|
+
(@ ,@(cond
|
2273
|
+
((meta-name meta)
|
2274
|
+
=> (lambda (name) `((name ,(symbol->string name)))))
|
2275
|
+
(else
|
2276
|
+
'()))
|
2277
|
+
(low-pc ,(meta-label meta))
|
2278
|
+
(high-pc ,(- (meta-high-pc meta) (meta-low-pc meta))))))
|
2279
|
+
|
2280
|
+
(define (make-compile-unit-die asm)
|
2281
|
+
`(compile-unit
|
2282
|
+
(@ (producer ,(string-append "Guile " (version)))
|
2283
|
+
(language ,(asm-language asm))
|
2284
|
+
(low-pc .rtl-text)
|
2285
|
+
(high-pc ,(asm-pos asm))
|
2286
|
+
(stmt-list 0))
|
2287
|
+
,@(map meta->subprogram-die (reverse (asm-meta asm)))))
|
2288
|
+
|
2289
|
+
(let-values (((die-port get-die-bv) (open-bytevector-output-port))
|
2290
|
+
((die-relocs) '())
|
2291
|
+
((abbrev-port get-abbrev-bv) (open-bytevector-output-port))
|
2292
|
+
;; (tag has-kids? attrs forms) -> code
|
2293
|
+
((abbrevs) vlist-null)
|
2294
|
+
((strtab) (make-string-table))
|
2295
|
+
((line-port get-line-bv) (open-bytevector-output-port))
|
2296
|
+
((line-relocs) '())
|
2297
|
+
;; file -> code
|
2298
|
+
((files) vlist-null))
|
2299
|
+
|
2300
|
+
(define (write-abbrev code tag has-children? attrs forms)
|
2301
|
+
(put-uleb128 abbrev-port code)
|
2302
|
+
(put-uleb128 abbrev-port (tag-name->code tag))
|
2303
|
+
(put-u8 abbrev-port (children-name->code (if has-children? 'yes 'no)))
|
2304
|
+
(for-each (lambda (attr form)
|
2305
|
+
(put-uleb128 abbrev-port (attribute-name->code attr))
|
2306
|
+
(put-uleb128 abbrev-port (form-name->code form)))
|
2307
|
+
attrs forms)
|
2308
|
+
(put-uleb128 abbrev-port 0)
|
2309
|
+
(put-uleb128 abbrev-port 0))
|
2310
|
+
|
2311
|
+
(define (intern-abbrev tag has-children? attrs forms)
|
2312
|
+
(let ((key (list tag has-children? attrs forms)))
|
2313
|
+
(match (vhash-assoc key abbrevs)
|
2314
|
+
((_ . code) code)
|
2315
|
+
(#f (let ((code (1+ (vlist-length abbrevs))))
|
2316
|
+
(set! abbrevs (vhash-cons key code abbrevs))
|
2317
|
+
(write-abbrev code tag has-children? attrs forms)
|
2318
|
+
code)))))
|
2319
|
+
|
2320
|
+
(define (intern-file file)
|
2321
|
+
(match (vhash-assoc file files)
|
2322
|
+
((_ . code) code)
|
2323
|
+
(#f (let ((code (1+ (vlist-length files))))
|
2324
|
+
(set! files (vhash-cons file code files))
|
2325
|
+
code))))
|
2326
|
+
|
2327
|
+
(define (write-sources)
|
2328
|
+
;; Choose line base and line range values that will allow for an
|
2329
|
+
;; address advance range of 16 words. The special opcode range is
|
2330
|
+
;; from 10 to 255, so 246 values.
|
2331
|
+
(define base -4)
|
2332
|
+
(define range 15)
|
2333
|
+
(define min-inc 4) ; Minimum PC increment.
|
2334
|
+
|
2335
|
+
(let lp ((sources (asm-sources asm)) (out '()))
|
2336
|
+
(match sources
|
2337
|
+
(((pc . s) . sources)
|
2338
|
+
(let ((file (assq-ref s 'filename))
|
2339
|
+
(line (assq-ref s 'line))
|
2340
|
+
(col (assq-ref s 'column)))
|
2341
|
+
(lp sources
|
2342
|
+
;; Guile line and column numbers are 0-indexed, but
|
2343
|
+
;; they are 1-indexed for DWARF.
|
2344
|
+
(if (and line col)
|
2345
|
+
(cons (list pc
|
2346
|
+
(if (string? file) (intern-file file) 0)
|
2347
|
+
(1+ line)
|
2348
|
+
(1+ col))
|
2349
|
+
out)
|
2350
|
+
out))))
|
2351
|
+
(()
|
2352
|
+
;; Compilation unit header for .debug_line. We write in
|
2353
|
+
;; DWARF 2 format because more tools understand it than DWARF
|
2354
|
+
;; 4, which incompatibly adds another field to this header.
|
2355
|
+
|
2356
|
+
(put-u32 line-port 0) ; Length; will patch later.
|
2357
|
+
(put-u16 line-port 2) ; DWARF 2 format.
|
2358
|
+
(put-u32 line-port 0) ; Prologue length; will patch later.
|
2359
|
+
(put-u8 line-port min-inc) ; Minimum instruction length: 4 bytes.
|
2360
|
+
(put-u8 line-port 1) ; Default is-stmt: true.
|
2361
|
+
|
2362
|
+
(put-s8 line-port base) ; Line base. See the DWARF standard.
|
2363
|
+
(put-u8 line-port range) ; Line range. See the DWARF standard.
|
2364
|
+
(put-u8 line-port 10) ; Opcode base: the first "special" opcode.
|
2365
|
+
|
2366
|
+
;; A table of the number of uleb128 arguments taken by each
|
2367
|
+
;; of the standard opcodes.
|
2368
|
+
(put-u8 line-port 0) ; 1: copy
|
2369
|
+
(put-u8 line-port 1) ; 2: advance-pc
|
2370
|
+
(put-u8 line-port 1) ; 3: advance-line
|
2371
|
+
(put-u8 line-port 1) ; 4: set-file
|
2372
|
+
(put-u8 line-port 1) ; 5: set-column
|
2373
|
+
(put-u8 line-port 0) ; 6: negate-stmt
|
2374
|
+
(put-u8 line-port 0) ; 7: set-basic-block
|
2375
|
+
(put-u8 line-port 0) ; 8: const-add-pc
|
2376
|
+
(put-u8 line-port 1) ; 9: fixed-advance-pc
|
2377
|
+
|
2378
|
+
;; Include directories, as a zero-terminated sequence of
|
2379
|
+
;; nul-terminated strings. Nothing, for the moment.
|
2380
|
+
(put-u8 line-port 0)
|
2381
|
+
|
2382
|
+
;; File table. For each file that contributes to this
|
2383
|
+
;; compilation unit, a nul-terminated file name string, and a
|
2384
|
+
;; uleb128 for each of directory the file was found in, the
|
2385
|
+
;; modification time, and the file's size in bytes. We pass
|
2386
|
+
;; zero for the latter three fields.
|
2387
|
+
(vlist-fold-right
|
2388
|
+
(lambda (pair seed)
|
2389
|
+
(match pair
|
2390
|
+
((file . code)
|
2391
|
+
(put-bytevector line-port (string->utf8 file))
|
2392
|
+
(put-u8 line-port 0)
|
2393
|
+
(put-uleb128 line-port 0) ; directory
|
2394
|
+
(put-uleb128 line-port 0) ; mtime
|
2395
|
+
(put-uleb128 line-port 0))) ; size
|
2396
|
+
seed)
|
2397
|
+
#f
|
2398
|
+
files)
|
2399
|
+
(put-u8 line-port 0) ; 0 byte terminating file list.
|
2400
|
+
|
2401
|
+
;; Patch prologue length.
|
2402
|
+
(let ((offset (port-position line-port)))
|
2403
|
+
(seek line-port 6 SEEK_SET)
|
2404
|
+
(put-u32 line-port (- offset 10))
|
2405
|
+
(seek line-port offset SEEK_SET))
|
2406
|
+
|
2407
|
+
;; Now write the statement program.
|
2408
|
+
(let ()
|
2409
|
+
(define (extended-op opcode payload-len)
|
2410
|
+
(put-u8 line-port 0) ; extended op
|
2411
|
+
(put-uleb128 line-port (1+ payload-len)) ; payload-len + opcode
|
2412
|
+
(put-uleb128 line-port opcode))
|
2413
|
+
(define (set-address sym)
|
2414
|
+
(define (add-reloc! kind)
|
2415
|
+
(set! line-relocs
|
2416
|
+
(cons (make-linker-reloc kind
|
2417
|
+
(port-position line-port)
|
2418
|
+
0
|
2419
|
+
sym)
|
2420
|
+
line-relocs)))
|
2421
|
+
(match (asm-word-size asm)
|
2422
|
+
(4
|
2423
|
+
(extended-op 2 4)
|
2424
|
+
(add-reloc! 'abs32/1)
|
2425
|
+
(put-u32 line-port 0))
|
2426
|
+
(8
|
2427
|
+
(extended-op 2 8)
|
2428
|
+
(add-reloc! 'abs64/1)
|
2429
|
+
(put-u64 line-port 0))))
|
2430
|
+
(define (end-sequence pc)
|
2431
|
+
(let ((pc-inc (/ (- (asm-pos asm) pc) min-inc)))
|
2432
|
+
(put-u8 line-port 2) ; advance-pc
|
2433
|
+
(put-uleb128 line-port pc-inc))
|
2434
|
+
(extended-op 1 0))
|
2435
|
+
(define (advance-pc pc-inc line-inc)
|
2436
|
+
(let ((spec (+ (- line-inc base)
|
2437
|
+
(* (/ pc-inc min-inc) range)
|
2438
|
+
10)))
|
2439
|
+
(cond
|
2440
|
+
((or (< line-inc base) (>= line-inc (+ base range)))
|
2441
|
+
(advance-line line-inc)
|
2442
|
+
(advance-pc pc-inc 0))
|
2443
|
+
((<= spec 255)
|
2444
|
+
(put-u8 line-port spec))
|
2445
|
+
((< spec 500)
|
2446
|
+
(put-u8 line-port 8) ; const-advance-pc
|
2447
|
+
(advance-pc (- pc-inc (* (floor/ (- 255 10) range) min-inc))
|
2448
|
+
line-inc))
|
2449
|
+
(else
|
2450
|
+
(put-u8 line-port 2) ; advance-pc
|
2451
|
+
(put-uleb128 line-port (/ pc-inc min-inc))
|
2452
|
+
(advance-pc 0 line-inc)))))
|
2453
|
+
(define (advance-line inc)
|
2454
|
+
(put-u8 line-port 3)
|
2455
|
+
(put-sleb128 line-port inc))
|
2456
|
+
(define (set-file file)
|
2457
|
+
(put-u8 line-port 4)
|
2458
|
+
(put-uleb128 line-port file))
|
2459
|
+
(define (set-column col)
|
2460
|
+
(put-u8 line-port 5)
|
2461
|
+
(put-uleb128 line-port col))
|
2462
|
+
|
2463
|
+
(set-address '.rtl-text)
|
2464
|
+
|
2465
|
+
(let lp ((in out) (pc 0) (file 1) (line 1) (col 0))
|
2466
|
+
(match in
|
2467
|
+
(()
|
2468
|
+
(when (null? out)
|
2469
|
+
;; There was no source info in the first place. Set
|
2470
|
+
;; file register to 0 before adding final row.
|
2471
|
+
(set-file 0))
|
2472
|
+
(end-sequence pc))
|
2473
|
+
(((pc* file* line* col*) . in*)
|
2474
|
+
(cond
|
2475
|
+
((and (eqv? file file*) (eqv? line line*) (eqv? col col*))
|
2476
|
+
(lp in* pc file line col))
|
2477
|
+
(else
|
2478
|
+
(unless (eqv? col col*)
|
2479
|
+
(set-column col*))
|
2480
|
+
(unless (eqv? file file*)
|
2481
|
+
(set-file file*))
|
2482
|
+
(advance-pc (- pc* pc) (- line* line))
|
2483
|
+
(lp in* pc* file* line* col*)))))))))))
|
2484
|
+
|
2485
|
+
(define (compute-code attr val)
|
2486
|
+
(match attr
|
2487
|
+
('name (string-table-intern! strtab val))
|
2488
|
+
('low-pc val)
|
2489
|
+
('high-pc val)
|
2490
|
+
('producer (string-table-intern! strtab val))
|
2491
|
+
('language (language-name->code val))
|
2492
|
+
('stmt-list val)))
|
2493
|
+
|
2494
|
+
(define (choose-form attr val code)
|
2495
|
+
(cond
|
2496
|
+
((string? val) 'strp)
|
2497
|
+
((eq? attr 'stmt-list) 'sec-offset)
|
2498
|
+
((eq? attr 'low-pc) 'addr)
|
2499
|
+
((exact-integer? code)
|
2500
|
+
(cond
|
2501
|
+
((< code 0) 'sleb128)
|
2502
|
+
((<= code #xff) 'data1)
|
2503
|
+
((<= code #xffff) 'data2)
|
2504
|
+
((<= code #xffffffff) 'data4)
|
2505
|
+
((<= code #xffffffffffffffff) 'data8)
|
2506
|
+
(else 'uleb128)))
|
2507
|
+
(else (error "unhandled case" attr val code))))
|
2508
|
+
|
2509
|
+
(define (add-die-relocation! kind sym)
|
2510
|
+
(set! die-relocs
|
2511
|
+
(cons (make-linker-reloc kind (port-position die-port) 0 sym)
|
2512
|
+
die-relocs)))
|
2513
|
+
|
2514
|
+
(define (write-value code form)
|
2515
|
+
(match form
|
2516
|
+
('data1 (put-u8 die-port code))
|
2517
|
+
('data2 (put-u16 die-port code))
|
2518
|
+
('data4 (put-u32 die-port code))
|
2519
|
+
('data8 (put-u64 die-port code))
|
2520
|
+
('uleb128 (put-uleb128 die-port code))
|
2521
|
+
('sleb128 (put-sleb128 die-port code))
|
2522
|
+
('addr
|
2523
|
+
(match (asm-word-size asm)
|
2524
|
+
(4
|
2525
|
+
(add-die-relocation! 'abs32/1 code)
|
2526
|
+
(put-u32 die-port 0))
|
2527
|
+
(8
|
2528
|
+
(add-die-relocation! 'abs64/1 code)
|
2529
|
+
(put-u64 die-port 0))))
|
2530
|
+
('sec-offset (put-u32 die-port code))
|
2531
|
+
('strp (put-u32 die-port code))))
|
2532
|
+
|
2533
|
+
(define (write-die die)
|
2534
|
+
(match die
|
2535
|
+
((tag ('@ (attrs vals) ...) children ...)
|
2536
|
+
(let* ((codes (map compute-code attrs vals))
|
2537
|
+
(forms (map choose-form attrs vals codes))
|
2538
|
+
(has-children? (not (null? children)))
|
2539
|
+
(abbrev-code (intern-abbrev tag has-children? attrs forms)))
|
2540
|
+
(put-uleb128 die-port abbrev-code)
|
2541
|
+
(for-each write-value codes forms)
|
2542
|
+
(when has-children?
|
2543
|
+
(for-each write-die children)
|
2544
|
+
(put-uleb128 die-port 0))))))
|
2545
|
+
|
2546
|
+
;; Compilation unit header.
|
2547
|
+
(put-u32 die-port 0) ; Length; will patch later.
|
2548
|
+
(put-u16 die-port 4) ; DWARF 4.
|
2549
|
+
(put-u32 die-port 0) ; Abbrevs offset.
|
2550
|
+
(put-u8 die-port (asm-word-size asm)) ; Address size.
|
2551
|
+
|
2552
|
+
(write-die (make-compile-unit-die asm))
|
2553
|
+
|
2554
|
+
;; Terminate the abbrevs list.
|
2555
|
+
(put-uleb128 abbrev-port 0)
|
2556
|
+
|
2557
|
+
(write-sources)
|
2558
|
+
|
2559
|
+
(values (let ((bv (get-die-bv)))
|
2560
|
+
;; Patch DWARF32 length.
|
2561
|
+
(bytevector-u32-set! bv 0 (- (bytevector-length bv) 4)
|
2562
|
+
(asm-endianness asm))
|
2563
|
+
(make-object asm '.debug_info bv die-relocs '()
|
2564
|
+
#:type SHT_PROGBITS #:flags 0))
|
2565
|
+
(make-object asm '.debug_abbrev (get-abbrev-bv) '() '()
|
2566
|
+
#:type SHT_PROGBITS #:flags 0)
|
2567
|
+
(make-object asm '.debug_str (link-string-table! strtab) '() '()
|
2568
|
+
#:type SHT_PROGBITS #:flags 0)
|
2569
|
+
(make-object asm '.debug_loc #vu8() '() '()
|
2570
|
+
#:type SHT_PROGBITS #:flags 0)
|
2571
|
+
(let ((bv (get-line-bv)))
|
2572
|
+
;; Patch DWARF32 length.
|
2573
|
+
(bytevector-u32-set! bv 0 (- (bytevector-length bv) 4)
|
2574
|
+
(asm-endianness asm))
|
2575
|
+
(make-object asm '.debug_line bv line-relocs '()
|
2576
|
+
#:type SHT_PROGBITS #:flags 0)))))
|
2577
|
+
|
2578
|
+
(define (link-objects asm)
|
2579
|
+
(let*-values (;; Link procprops before constants, because it probably
|
2580
|
+
;; interns more constants.
|
2581
|
+
((procprops) (link-procprops asm))
|
2582
|
+
((ro rw rw-init) (link-constants asm))
|
2583
|
+
;; Link text object after constants, so that the
|
2584
|
+
;; constants initializer gets included.
|
2585
|
+
((text) (link-text-object asm))
|
2586
|
+
((frame-maps) (link-frame-maps asm))
|
2587
|
+
((dt) (link-dynamic-section asm text rw rw-init frame-maps))
|
2588
|
+
((symtab strtab) (link-symtab (linker-object-section text) asm))
|
2589
|
+
((arities arities-strtab) (link-arities asm))
|
2590
|
+
((docstrs docstrs-strtab) (link-docstrs asm))
|
2591
|
+
((dinfo dabbrev dstrtab dloc dline) (link-debug asm))
|
2592
|
+
;; This needs to be linked last, because linking other
|
2593
|
+
;; sections adds entries to the string table.
|
2594
|
+
((shstrtab) (link-shstrtab asm)))
|
2595
|
+
(filter identity
|
2596
|
+
(list text ro frame-maps rw dt symtab strtab
|
2597
|
+
arities arities-strtab
|
2598
|
+
docstrs docstrs-strtab procprops
|
2599
|
+
dinfo dabbrev dstrtab dloc dline
|
2600
|
+
shstrtab))))
|
2601
|
+
|
2602
|
+
|
2603
|
+
|
2604
|
+
|
2605
|
+
;;;
|
2606
|
+
;;; High-level public interfaces.
|
2607
|
+
;;;
|
2608
|
+
|
2609
|
+
(define* (link-assembly asm #:key (page-aligned? #t))
|
2610
|
+
"Produce an ELF image from the code and data emitted into @var{asm}.
|
2611
|
+
The result is a bytevector, by default linked so that read-only and
|
2612
|
+
writable data are on separate pages. Pass @code{#:page-aligned? #f} to
|
2613
|
+
disable this behavior."
|
2614
|
+
(link-elf (link-objects asm) #:page-aligned? page-aligned?))
|