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

19988 commits

Author SHA1 Message Date
Andy Wingo
609df9ea55 Merge from upstream lightening 2019-04-22 09:17:26 +02:00
Andy Wingo
0be4f7a2a1 Simplify API for loading call arguments 2019-04-22 09:15:03 +02:00
Mark H Weaver
63818453ad Reimplement SCM_MAKE_CHAR to evaluate its argument only once.
The motivation for this change is that SCM_MAKE_CHAR is sometimes passed
an expression that involves a procedure call that is not always trivial.
In other cases, the results are not guaranteed to be the same both
times, which could lead to the creation of invalid SCM objects.

* libguile/chars.h (SCM_MAKE_CHAR): Reimplement.
2019-04-17 03:02:55 -04:00
Andrea Azzarone
546b0e8729 Fix gc.test "after-gc-hook gets called" failures.
* libguile/scmsigs.c (signal_delivery_thread): Call scm_async_tick to
give any pending asyncs a chance to run before we block indefinitely
waiting for a signal to arrive.
2019-04-16 16:54:55 -04:00
Mark H Weaver
423ad3632f Update user-visible copyright years.
* doc/ref/guile.texi: Update years in copyright notice.
* module/ice-9/command-line.scm (version-etc): Update 'copyright-year'.
* module/system/repl/common.scm (*version*): Update copyright years.
2019-04-16 16:54:55 -04:00
Mark H Weaver
6b1de860ab Avoid passing NULL to 'memcpy' and 'memcmp'.
Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/guile-devel/2019-03/msg00001.html>.

Note that C11 section 7.1.4 (Use of library functions) states that:
"unless explicitly stated otherwise in the detailed descriptions [of
library functions] that follow: If an argument to a function has an
invalid value (such as ... a null pointer ...) ..., the behavior is
undefined."  Note that 'strxfrm' is an example of a standard C function
that explicitly states otherwise, allowing NULL to be passed in the
first argument if the size argument is zero, but no similar allowance is
specified for 'memcpy' or 'memcmp'.

* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Call memcpy
only if 'byte_len' is non-zero.
* libguile/srfi-14.c (charsets_equal): Call memcmp only if the number of
ranges is non-zero.
* libguile/stime.c (setzone): Pass 1-character buffer to
'scm_to_locale_stringbuf', instead of NULL.
* libguile/strings.c (scm_to_locale_stringbuf): Call memcpy only if the
number of bytes to copy is non-zero.
2019-04-16 16:54:55 -04:00
Mark H Weaver
275c96dd1f Remove vestigial comment in tags.h.
* libguile/tags.h: Remove a vestigial comment which seems to have been
separated from its associated code long ago.
2019-04-16 16:54:55 -04:00
Andy Wingo
668196aa27 Fix lightening name 2019-04-05 16:25:22 +02:00
Andy Wingo
a45d651755 Add support for "make test-ia32" in tests/ 2019-04-05 16:24:21 +02:00
Andy Wingo
e6ac66a348 Allow test suite to test multiple targets.
* tests/Makefile: Allow for testing multiple targets.
2019-04-05 16:07:01 +02:00
Andy Wingo
b35662fb4e Merge from upstream Lightening 2019-04-04 17:07:09 +02:00
Andy Wingo
4e1876f294 Support spilling args to stack 2019-04-04 17:06:57 +02:00
Andy Wingo
cfffd5b241 Fix compilation of call-scm<-u64
* libguile/jit.c (compile_call_scm_from_u64): Fix to take operands from
  the right place.
2019-04-04 16:35:44 +02:00
Andy Wingo
5df432b763 Fix arena expansion logic
* libguile/jit.c (compile): Fix logic to clear old labels.
2019-04-04 14:59:38 +02:00
Andy Wingo
891e7600f4 JIT fixes for arena overflow
* libguile/jit.c (compute_mcode): Move analysis outside the code
emitter, as it doesn't need to re-run on overflow.
(compile): Clear labels before emitting, as they may have changed if we
overflowed.
2019-04-04 14:32:05 +02:00
Andy Wingo
9ff21412ff Minor JIT cleanups
* libguile/jit.c (fp_scm_operand): Fix assertion about register state.
(compile_call_scm_sz_u32): Fix ABI declaration for immediate.
Some whitespace cleanups as well.
2019-04-04 12:48:37 +02:00
Andy Wingo
39d1ed3c27 Merge from upstream Lightening 2019-04-04 12:11:08 +02:00
Andy Wingo
89de2cb286 More various JIT fixen
* libguile/jit.c (prepare_jit_state): Remove unused function.
(initialize_thread_jit_state): Since the lightening state is allocated
using GC memory, trace the JIT state.
(compute_mcode): Avoid double-compile.
2019-04-04 12:10:13 +02:00
Andy Wingo
ede10b101b Support immediate arguments 2019-04-04 12:09:41 +02:00
Andy Wingo
62df897929 Merge from upstream Lightening 2019-04-04 11:43:36 +02:00
Andy Wingo
f8fa1156a9 Fix some aspects of instruction mcode addresses
* libguile/jit.c (struct scm_jit_state): Remove entry_mcode member.
(add_inter_instruction_patch): Fix off-by-one.
(compile): Reset reloc_idx when restarting a compile.  All instructions
record their addresses.
2019-04-04 11:42:33 +02:00
Andy Wingo
1d6feefa9d Add assert for jit_address 2019-04-04 11:41:51 +02:00
Andy Wingo
c0369df5e7 Fix JIT bugs
* libguile/jit.c (compile): Fix reloc fixup.
(compute_mcode): Correctly compute entry mcode.
2019-04-04 11:33:16 +02:00
Andy Wingo
c63764f439 Merge from upstream Lightening 2019-04-04 11:18:30 +02:00
Andy Wingo
fb9003c137 Fix jit_gpr_is_callee_save usage
* libguile/jit.c (emit_entry_trampoline): Fix invocations for
  jit_gpr_is_callee_save.
2019-04-04 11:18:08 +02:00
Andy Wingo
e95fb91b96 Fix reloc for jmpi and calli 2019-04-04 11:17:46 +02:00
Andy Wingo
11fa54646f Merge from upstream Lightening 2019-04-04 11:09:24 +02:00
Andy Wingo
bbfb03ac30 Fix implementation of jit_{gpr,fpr}_is_callee_save 2019-04-04 11:08:54 +02:00
Andy Wingo
93f430d282 jit: Fix inter-instruction relocs.
* libguile/jit.c (struct pending_reloc, emit_entry_trampoline)
(add_inter_instruction_patch, compile, compute_mcode): Fix
inter-instruction relocs.
2019-04-04 10:59:37 +02:00
Andy Wingo
2db4ccd68c Fix jit.c compilation
* libguile/jit.c: Finish adaptation for lightening.  Still crashes
  though.
2019-04-03 21:08:30 +02:00
Andy Wingo
83b086e40e Remove -Wdeclaration-after-statement
* configure.ac (HOST_CC): Now that we have C99, there's no need to warn
  on mixed statements and declarations.
2019-04-03 19:37:31 +02:00
Andy Wingo
1308404b5b Merge from upstream lightening 2019-04-03 19:24:47 +02:00
Andy Wingo
0903a01812 Add jit_same_{gprs,fprs} helpers 2019-04-03 19:23:36 +02:00
Andy Wingo
061c967bfe Checkpoint for lightning to lightening conversion 2019-04-03 17:42:27 +02:00
Andy Wingo
9f22ec9e2d Merge from upstream Lightening 2019-04-03 17:38:00 +02:00
Andy Wingo
f9da599ef5 Fix jit_reset to be useful 2019-04-03 17:37:18 +02:00
Andy Wingo
22d06620ee Allow users to pass custom allocators 2019-04-03 15:25:21 +02:00
Andy Wingo
e9be4ea73d Adapt to lightning -> lightening name change
* libguile/jit.c: Include lightening.h.
* libguile/Makefile.am: Adapt.
2019-04-03 14:08:06 +02:00
Andy Wingo
2e4fb1e665 Merge in changes from upstream lightening 2019-04-03 13:59:33 +02:00
Andy Wingo
f348b8ed6d Change headers and files to be named "lightening" instead of "jit"
This improves integration with other projects.  Like for example Guile
already has files named jit.c and jit.h; it's easier to manage if
lightening uses its own file names.
2019-04-03 13:57:48 +02:00
Andy Wingo
d351f13bc2 Add subdir-objects option to libguile makefile.
* libguile/Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects, to allow
  for having two files named "jit.c".
2019-04-03 13:37:35 +02:00
Andy Wingo
985faf35c1 Replace GNU Lightning with Lightening 2019-04-03 13:28:13 +02:00
Andy Wingo
573af9c19b Clean up stack after calls 2019-04-03 12:09:38 +02:00
Andy Wingo
99b4fd2d79 Provide some type safety for jit_gpr_t and jit_fpr_t 2019-04-03 11:50:32 +02:00
Andy Wingo
cacdeeee4b Implement arg shuffling for jit_call{i,r} 2019-04-03 11:04:39 +02:00
Andy Wingo
b4169e25ba get_temp_{gpr,xpr} returns a jit_{gpr,fpr}_t 2019-04-03 11:04:19 +02:00
Mark H Weaver
94230d27e0 Fix typo in comment.
* module/ice-9/boot-9.scm: Fix typo.
2019-04-01 21:42:06 -04:00
Andy Wingo
998006b304 Remove old tests 2019-03-26 22:36:08 +01:00
Andy Wingo
40ebd5de44 Add movi_[df] tests 2019-03-26 22:34:04 +01:00
Andy Wingo
bbb8bd94f2 Add int->float tests 2019-03-26 22:32:40 +01:00