1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

213 commits

Author SHA1 Message Date
Andy Wingo
e2fafeb901 Keywords have a tc7
* libguile/tags.h (scm_tc7_keyword): Allocate a tc7, so that the VM can
  have cheap keyword? tests.

* libguile/keywords.c:
* libguile/keywords.h: Adapt.

* libguile/goops.c (scm_class_of, scm_sys_goops_early_init): Capture
  <keyword>.

* libguile/print.c (iprin1): Inline keyword printer.

* libguile/evalext.c (scm_self_evaluating_p): Add keywords here.

* libguile/deprecated.h:
* libguile/deprecated.c (scm_tc16_keyword): Deprecate.

* module/language/cps/compile-bytecode.scm (compile-fun): Add keyword?
  case, and bitvector? case while we're at it.
* module/language/cps/effects-analysis.scm (define-primitive-effects):
  Add bytevector?, keyword?, and bitvector? cases.

* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
  keyword?.

* module/language/cps/types.scm (bitvector?, keyword?, bytevector?): Add
  branch inferrers.

* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
  (*effect-free-primitives*):
  (*effect+exception-free-primitives*): Add bytevector?, keyword?, and
  bitvector?.

* module/oop/goops.scm (<keyword>): New class.

* module/system/base/types.scm (%tc7-keyword, cell->object): Add cases.

* module/system/vm/assembler.scm (br-if-keyword): New definition.
* module/system/vm/disassembler.scm (code-annotation): Add br-if-tc7
  case for keywords.

* test-suite/tests/types.test ("clonable objects"): Update now that
  keywords are cloneable.
2015-01-22 13:03:11 +01:00
Andy Wingo
27b3b5b92d Add allocate-struct, struct-ref, struct-set! instructions
* libguile/vm-engine.c (allocate-struct, struct-ref, struct-set!): New
  instructions, to complement their "immediate" variants.

* module/language/cps/compile-bytecode.scm (compile-fun):
* module/system/vm/assembler.scm (system): Wire up the new instructions.
2015-01-22 12:53:33 +01:00
Mark H Weaver
015c3c08af Assembler: Cope with non-string port filenames.
Fixes <http://bugs.gnu.org/19354>.
Reported by Linas Vepstas <linasvepstas@gmail.com>.

* module/system/vm/assembler.scm (write-sources): Intern the filename
  only if it's a string.  (For sockets, the filename is a symbol).
2014-12-14 10:24:00 -05:00
Daniel Llorens
0f259045e1 Intern general arrays
* module/system/vm/assembler.scm (intern-constant, link-data): handle
  the array case.
2014-09-30 11:35:08 +02:00
Andy Wingo
d613ccaaa0 Compiler emits br-if-logtest
* module/language/cps/compile-bytecode.scm (compile-fun):
* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/language/cps/type-fold.scm (logtest):
* module/language/cps/types.scm (logtest):
* module/system/vm/assembler.scm (system):
* module/system/vm/disassembler.scm (compute-labels): Add backend
  support for the logtest instruction.
2014-07-03 15:03:40 +02:00
Andy Wingo
d38ca16e2c Add make-vector opcode
* libguile/vm-engine.c (make-vector): New opcode.
* module/language/cps/compile-bytecode.scm (compile-fun):
* module/system/vm/assembler.scm (system): Support the new opcode.
  (*bytecode-minor-version*): Bump.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* test-suite/tests/compiler.test ("limits"): Add vector test.
2014-04-21 22:47:33 +02:00
Andy Wingo
d4b3a36d42 Operations on 8-bit and 12-bit operands shuffle args into range
* module/language/cps/slot-allocation.scm (allocate-slots): Avoid
  allocating locals in the range [253,255].

* module/system/vm/assembler.scm: List exports explicitly.  For
  operations with limited-range operands, export wrapper assemblers that
  handle shuffling their operands into and out of their range.
  (define-assembler): Get rid of enclosing begin.
  (shuffling-assembler, define-shuffling-assembler): New helpers to
  define shuffling wrapper assemblers.
  (emit-mov*, emit-receive*): New functions.
  (shuffle-up-args): New helper.
  (standard-prelude, opt-prelude, kw-prelude): Call shuffle-up-args
  after finishing.

* test-suite/tests/compiler.test ("limits"): Add test cases.
2014-04-21 22:47:28 +02:00
Andy Wingo
28e12ea0c4 More expansion-time-only definitions in assembler.scm
* module/system/vm/assembler.scm (define-inline): Change so that the
  defined macro is only defined at expansion-time.
  (u32-ref, u32-set!, s32-ref, s32-set!, pack-arity-flags): Use
  define-inline.
  (pack-flags, assert-match, *block-size*, id-append, assembler)
  (define-assembler, visit-opcodes, define-macro-assembler): Wrap in
  eval-when expand.
2014-04-21 12:13:54 +02:00
Andy Wingo
dece041203 define-inline in assembler.scm
* module/system/vm/assembler.scm (define-inline): New local helper.
  Update local users of define-inlinable to use it.
2014-04-21 12:01:50 +02:00
Andy Wingo
c09708f985 VM opcodes only have <24-bit slot operands in the first word
* libguile/vm-engine.c (make-array): Change to only have
  restricted-width operands in the first word.  This instruction is
  currently unused, however.

* module/system/vm/assembler.scm (assembler):
* module/system/vm/disassembler.scm (disassembler): Disallow
  restricted-width operands in tail words.
2014-04-20 11:52:14 +02:00
Andy Wingo
4cbe4d72aa Fix rtl tests
* module/system/vm/assembler.scm (write-arities): Add a diagnostic.

* test-suite/tests/rtl.test: Fix tests to emit "definition"
  instructions.
2014-04-15 22:00:30 +02:00
Andy Wingo
67ddb7e264 Assembler residualizes local variable definition locations
* module/system/vm/assembler.scm (write-arities): Serialize definition
  locations after names.
  (definition): Store definition as a byte offset.
2014-04-15 20:25:16 +02:00
Andy Wingo
1a82c2012b Bump minor objcode version for recent changes
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
2014-04-15 20:20:01 +02:00
Andy Wingo
c3651bd55b Write all local variable names into the arities section
* module/system/vm/assembler.scm (put-uleb128, put-sleb128)
  (port-position): Lift out these helpers.
  (arity-header-len, write-arities, link-arities): Add "nlocals" to the
  arity headers.  Write names of all locals into the arities section,
  not just the arguments.  Write them as uleb128's instead of uint32's,
  to save space.

* module/system/vm/debug.scm (arity-header-len, arity-nlocals*)
  (arity-nlocals, arity-locals, arity-arguments-alist): Adapt to new
  encoding for arities.
2014-04-15 18:24:25 +02:00
Andy Wingo
cade4c8fe1 Tweak arities debugging representation
* module/system/vm/assembler.scm (meta-arities-size, write-arity-links):
* module/system/vm/debug.scm (arity-keyword-args)
  (arity-arguments-alist): Rewrite to put they keyword literals link
  first.  Unfortunately requires a recompile :/
2014-04-15 15:27:19 +02:00
Andy Wingo
78351d1065 Beginnings of local variable information
* module/system/vm/assembler.scm (<arity>, begin-kw-arity, end-arity):
  (definition): Add definition macro-instruction.  Arrange to record
  variable definitions.

* module/language/cps/compile-bytecode.scm (compile-fun): Emit
  definition macro-instructions as appropriate.
2014-04-15 14:14:15 +02:00
Andy Wingo
0534735314 Remove unneeded local exact-integer? definition
* module/system/vm/assembler.scm (link-debug): Remove unneeded
  exact-integer? definition.
2014-03-31 18:20:55 +02:00
Andy Wingo
9a1dfb7d2e Continuation labels and variable identifiers may be integers
* module/language/cps.scm (label-counter, var-counter): New parameters,
  for producing fresh label and var names.
  (fresh-label, fresh-var): New procedures.
  (let-fresh): New macro, will replace let-gensyms.
  (build-cps-term): Use let-fresh.

* module/language/tree-il/compile-cps.scm: Use let-fresh to generate
  fresh names.

* module/system/vm/assembler.scm (make-meta, begin-kw-arity): Allow
  exact integers as labels.
  (link-debug): Explicitly mark low-pc as being an "addr" value.
2014-03-31 18:20:55 +02:00
Andy Wingo
8051cf2304 Merge commit 'fb7dd00169'
This commit also renames uniform-vector-element-type-code to
array-type-code.

Conflicts:
	libguile/uniform.c
	libguile/uniform.h
	test-suite/tests/arrays.test
2014-02-08 15:31:37 +01:00
Andy Wingo
b3ae2b5068 Add VM and compiler support for calls to known procedures
* module/language/cps.scm ($callk): New expression type, for calls to
  known labels.  Part of "low CPS".
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm: Adapt call sites.

* libguile/vm-engine.c (call-label, tail-call-label): New instructions.
  Renumber the rest; this is an ABI change.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

* doc/ref/compiler.texi (CPS in Guile): Document $callk.
2014-02-02 23:19:22 +01:00
Andy Wingo
02c624fc09 More precise stack marking via .guile.frame-maps section
* module/language/cps/slot-allocation.scm (lookup-dead-slot-map)
  (allocate-slots): For each non-tail call in a function, compute the
  set of slots that are dead after the function has begun the call.

* module/language/cps/compile-bytecode.scm (compile-fun): Emit the
  `dead-slot-map' macro instruction for non-tail calls.

* module/system/vm/assembler.scm (<asm>): Add `dead-slot-maps' member.
  (dead-slot-map): New macro-instruction.
  (link-frame-maps, link-dynamic-section, link-objects): Write dead
  slots information into .guile.frame-maps sections of ELF files.
* module/system/vm/elf.scm (DT_GUILE_FRAME_MAPS): New definition.

* libguile/loader.h:
* libguile/loader.c (DT_GUILE_FRAME_MAPS, process_dynamic_segment):
  (load_thunk_from_memory, register_elf): Arrange to parse
  DT_GUILE_FRAME_MAPS out of the dynamic section.
  (find_mapped_elf_image_unlocked, find_mapped_elf_image): New helpers.
  (scm_find_mapped_elf_image): Refactor.
  (scm_find_dead_slot_map_unlocked): New interface.

* libguile/vm.c (scm_i_vm_mark_stack): Mark the hottest frame
  conservatively, as before.  Otherwise use the dead slots map, if
  available, to avoid marking data that isn't live.
2014-01-26 20:55:04 +01:00
Andy Wingo
691697de09 Rename "RTL" to "bytecode"
"RTL" didn't make any sense, and now that there's no other bytecode to
disambiguate against, just call it bytecode.

* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/cps/arities.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/primitives.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/spec.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/rtl.scm:
* module/language/rtl/spec.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* module/system/repl/common.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* test-suite/tests/cross-compilation.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test:
* test-suite/vm/run-vm-tests.scm: Fixups.
2013-12-02 21:31:47 +01:00
Andy Wingo
1b780c134b (system vm instruction) rtl-instruction-list -> (language rtl) instruction-list
* libguile/instructions.c (struct scm_instruction, fetch_instruction_table)
  (scm_instruction_list): Remove rtl_ infix.
* libguile/instructions.h: Adapt.

* module/system/vm/instruction.scm: Remove.

* module/language/rtl.scm: Export instruction-list from here.

* module/Makefile.am:
* module/language/cps/primitives.scm:
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/frame.scm:
* module/system/vm/program.scm:
* module/system/vm/trace.scm:
* module/system/vm/traps.scm: Adapt.
2013-11-19 20:45:57 +01:00
Andy Wingo
8bf83893c7 Rename DT_GUILE_VM_VERSION.
* libguile/objcodes.c (DT_GUILE_VM_VERSION, process_dynamic_segment):
* module/system/vm/elf.scm (DT_GUILE_VM_VERSION): Rename from
  DT_GUILE_RTL_VERSION.
* module/system/vm/assembler.scm (link-dynamic-section): Adapt.
2013-11-19 20:02:15 +01:00
Andy Wingo
e0755cd12a Rename scm_tc7_rtl_program to scm_tc7_program
* libguile/tags.h (scm_tc7_program): Rename from scm_tc7_rtl_program.
* libguile/continuations.c:
* libguile/control.c:
* libguile/evalext.c:
* libguile/foreign.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/programs.h:
* libguile/vm-engine.c: Adapt users.

* module/system/vm/assembler.scm: Rename a tc7-rtl-program local to
  tc7-program.
* libguile/tags.h (scm_tc7_program): Rename from scm_tc7_rtl_program. * libguile/continuations.c: * libguile/control.c: * libguile/evalext.c: * libguile/foreign.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/print.c: * libguile/programs.c: * libguile/programs.h: * libguile/vm-engine.c: Adapt users.

* module/system/vm/assembler.scm: Rename a tc7-rtl-program local to
  tc7-program.
2013-11-19 18:24:54 +01:00
Andy Wingo
f8085163d6 Remove MVRA from VM frames
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for frame layout
  change.

* libguile/frames.c: Update some static checks.
  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
  Update to not skip over uninitialized frames, as that's not a thing
  any more.

* libguile/frames.h: Update to remove MVRA.  Woo!

* libguile/vm-engine.c (ALLOC_FRAME, RETURN_ONE_VALUE):
  (rtl_vm_engine): Update for 3 words per frame instead of 4.

* libguile/vm.c (vm_return_to_continuation): Likewise.

* module/language/cps/slot-allocation.scm (allocate-slots): 3 words per
  frame, not 4.

* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.  Also
  remove a couple of tc7's that aren't around any more.
2013-11-15 17:13:27 +01:00
Andy Wingo
4c906ad5a5 Add specialize-primcalls pass; bump objcode version.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* libguile/objcodes.c (process_dynamic_segment): Expect the minor
  version to be present and, while we are still banging on the VM,
  exactly equal to SCM_OBJCODE_MINOR_VERSION.

* libguile/vm-engine.c: Renumber ops.  Remove the general make-vector.
  Rename constant-FOO to FOO/immediate.  Remove struct-ref and
  struct-set!, replace with struct-ref/immediate and
  struct-set!/immediate.

* module/Makefile.am:
* module/language/cps/specialize-primcalls.scm: New pass, inlines FOO to
  FOO/immediate -- e.g. vector-ref to vector-ref/immediate.

* module/language/cps/arities.scm: Remove struct-set! case, now that
  there is no struct-set! opcode.

* module/language/cps/compile-rtl.scm (compile-fun): Remove dispatch to
  constant-FOO versus FOO here -- that decision is made by
  specialize-primcalls.
  (optimize): Add specialize-primcalls pass.

* module/language/cps/dfg.scm (constant-needs-allocation?): Adapt to
  name changes.

* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
  (*primitive-constructors*): Add allocate-struct.

* module/system/vm/assembler.scm (*bytecode-major-version*):
  (*bytecode-minor-version*, link-dynamic-section): Write minor version
  into resulting image.
2013-11-10 19:27:19 +01:00
Andy Wingo
463469cce7 Fix RTL linking of procedure properties.
* module/system/vm/assembler.scm (link-procprops): Fix procedure
  property embedding in bytecode.
2013-11-09 16:23:35 +01:00
Andy Wingo
d8595af555 Finding a procedure's arity uses binary search
* module/system/vm/assembler.scm (pack-arity-flags):
  (write-arity-headers): Add a flag to indicate that an arity is part of
  a case-lambda, so that we can use binary search to find arities.

* module/system/vm/debug.scm (is-in-case-lambda?)
  (arity-is-in-case-lambda?, find-first-arity): Use binary search.
2013-11-09 16:02:13 +01:00
Andy Wingo
4dfae1bf50 Move assemble-program to test cases.
* module/system/vm/assembler.scm (assemble-program): Remove.
* test-suite/tests/rtl.test (assemble-program): Move here.
2013-11-08 17:36:45 +01:00
Andy Wingo
b0ed216b6f Fix case-lambda* dispatching to agree with manual.
* module/system/vm/assembler.scm (kw-prelude): Emit br-if-npos-gt as
  appropriate.
2013-11-08 11:41:28 +01:00
Andy Wingo
0e3a59f750 Fix reading and writing arities into DWARF.
* libguile/gsubr.h:
* libguile/gsubr.c (scm_i_primitive_call_ip):
* libguile/programs.c (scm_primitive_call_ip): Adapt to return an
  absolute address.

* module/system/vm/assembler.scm (write-arity-headers): Adapt to write
  byte addresses (relative to the text base).

* module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Return
  absolute addresses, instead of word offsets relative to the text
  base.
  (find-first-arity): Adapt for absolute addresses.

* module/system/vm/program.scm (program-arguments-alist): Adapt for
  arity-low-pc / arity-high-pc absolute addresses.
2013-11-08 10:11:48 +01:00
Andy Wingo
31602aa04a Fix line advance DWARF opcodes when line advance is exactly 128
* module/system/vm/assembler.scm (link-debug): Fix off-by-one error in
  which forward jumps of 128 were mis-rendered.
2013-11-07 11:10:36 +01:00
Andy Wingo
32ca15d7d7 Write DWARF files list in correct order.
* module/system/vm/assembler.scm (link-debug): Fix order of writing the
  source files list; it was being written backwards.
2013-11-07 10:52:47 +01:00
Andy Wingo
0a1d52ac77 fix docstring assembly and fetching
* module/system/vm/assembler.scm (link-docstrs): Write pc offsets as
  byte addresses.  Works better with native code.
* module/system/vm/debug.scm (find-program-docstring): Fix the linear
  search.  How embarassing!
2013-11-05 21:29:46 +01:00
Andy Wingo
3659ef543e asm-labels is a hash table
* module/system/vm/assembler.scm (make-assembler, label):
  (link-data, process-relocs, process-labels): Change labels to be a
  hash table.
2013-11-05 20:18:23 +01:00
Andy Wingo
d65514a2de RTL compiler supports static bitvectors
* libguile/arrays.c (scm_from_contiguous_typed_array):
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): For
  bitvectors, round up the length to 32-bit units, as they are stored
  internally.  Otherwise I think this probably does the wrong thing for
  the last word on big-endian systems.
* libguile/bitvectors.c (BITVECTOR_LENGTH, BITVECTOR_BITS):
  (scm_c_make_bitvector): Reorder the length and pointer words to match
  the layout of bytevectors.

* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/system/vm/assembler.scm (br-if-bitvector):
* module/system/vm/disassembler.scm (code-annotation): Add bitvector
  test support.

* module/system/vm/assembler.scm (<uniform-vector-backing-store>): Add
  an element-size field.
  (intern-constant): Adapt make-uniform-vector-backing-store call.  Use
  uniform-array->bytevector, as the old compiler did.
  (link-data): Add bitvector cases.
2013-11-03 21:48:48 +01:00
Andy Wingo
cb8054c7ac Better range checks in the assembler
* module/system/vm/assembler.scm (pack-u8-u24, pack-u8-s24):
  (pack-u1-u7-u24, pack-u8-u12-u12, pack-u8-u8-u16, pack-u8-u8-u8-u8):
  Prevent adjacent fields from stompling each other.
2013-10-31 22:57:06 +01:00
Andy Wingo
c7cb2bc200 static-patch! for pair and vector fields
* module/system/vm/assembler.scm (intern-constant): Use static-patch!
  for fields.
2013-10-31 19:21:31 +01:00
Andy Wingo
becce37b58 Better compiler support for bytevector ops
* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add emitters
  for bytevector ops.  Add br-if-bytevector emitter.
* module/language/cps/primitives.scm (*branching-primcall-arities*):
  Mark bytevector? as a branching primitive.
* module/system/vm/assembler.scm (br-if-bytevector): New instruction
* module/system/vm/disassembler.scm (code-annotation): Add support for
  bytevector?.
2013-10-31 12:55:24 +01:00
Andy Wingo
7bfbc7b1c5 Support serialization of uniform vector literals
* libguile/uniform.h:
* libguile/uniform.c (scm_uniform_vector_element_type_code): New
  interface, returns a type code as an integer.

* module/system/vm/assembler.scm (<uniform-vector-backing-store>)
  (simple-vector?, uniform-array?, statically-allocatable?)
  (intern-constant, link-data, link-constants): Support uniform arrays,
  and punt on vectors aren't contiguous from 0.  Support for general
  arrays will come later.

* test-suite/tests/rtl.test ("load-constant"): Add tests.
2013-10-31 12:55:23 +01:00
Andy Wingo
2ab2a10d50 static-patch! replaces link-procedure!
* libguile/vm-engine.c (static-patch!): Replace link-procedure! with
  this more versatile primitive.
* module/system/vm/assembler.scm (intern-constant): Emit static-patch!
  for static procedures and for strings.
* module/system/vm/disassembler.scm (code-annotation): Remove annotation
  for link-procedure!.  There can be no annotation for static-patch!, as
  neither operand is guaranteed to be a SCM value.
2013-10-31 09:47:48 +01:00
Andy Wingo
be8b62ca7f RTL compiler: Compile TC7 branches.
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm (code-annotation):
* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add support
  for compiling symbol?, variable?, vector?, and string? branches.
2013-10-26 15:16:09 +02:00
Andy Wingo
8695854a7d Fix assembler for keyword args
* module/system/vm/assembler.scm (begin-kw-arity, kw-prelude): Fix
  functions with keywords.
2013-10-22 22:31:26 +02:00
Andy Wingo
6b71a76713 A couple of fixes when no source info is available
* module/system/vm/assembler.scm (link-debug): If there was no debugging
  info, reset the file register to 0 from its default value of 1 before
  adding the final row.

* module/system/vm/dwarf.scm (line-prog-scan-to-pc): If we rescanned
  from the beginning and still found no source info for this pc, return
  #f instead of the default value of the file register (1).
2013-10-10 12:22:20 +02:00
Andy Wingo
d56ab5a913 Serialize source positions into .debug_line
* module/system/vm/assembler.scm (link-debug): Generate a correct DWARF2
  line program.  Tests come next.
2013-10-03 16:14:20 +02:00
Andy Wingo
0a7340ac98 Emit a placeholder .debug_line section.
* module/system/vm/assembler.scm (link-debug): Emit a .debug_line
  section also.
  (link-objects): Expect .debug_line.
2013-09-30 21:49:12 +02:00
Andy Wingo
e675e9bd39 Add new "source" macro instruction; compile-rtl emits it.
* module/system/vm/assembler.scm (<asm>): Add "sources" field.
  (make-assembler): Adapt to make-asm change.
  (source): New macro assembler.

* module/language/cps/compile-rtl.scm (emit-rtl-sequence):
  (compile-fun): Emit source instructions as appropriate.
2013-09-30 21:48:07 +02:00
Andy Wingo
6371e368e6 DWARF linker: encode strings using the correct form
* module/system/vm/assembler.scm (link-debug): Encode strings using the
  strp form.
2013-09-28 18:15:50 +02:00
Andy Wingo
a862d8c138 Emit minimal DWARF information
* module/system/vm/assembler.scm (link-debug): New function, creates the
  necessary DWARF debugging sections.
  (link-objects): Emit debugging sections.
2013-09-28 14:50:48 +02:00