diff options
author | Andy Wingo <wingo@pobox.com> | 2020-04-14 22:08:45 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2020-04-14 22:18:02 +0200 |
commit | d804177be4525feb517feb63ca09502d187fc016 (patch) | |
tree | fe99bbf9aa760874d717c8e9d7ee693f2c0d7e8d /module | |
parent | ff9979b6bc6a72e03085d7ce21fd3f8f1bd39b64 (diff) | |
download | guile-d804177be4525feb517feb63ca09502d187fc016.tar.gz |
bitvector-bit-set? / bitvector-bit-clear? replace bitvector-ref
This is an opportunity to make a new interface that can be more
efficient in 3.0 (because no generic array support), easier to read (no
need for 'not'), and more consistent with other bitvector interfaces.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/array-handle.h (bitvector_ref, scm_array_get_handle): Adapt
to bitvector changes.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_bit_is_set)
(scm_c_bitvector_bit_is_clear): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_ref): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace
bitvector-ref with bitvector-bit-set? / bitvector-bit-clear?.
* module/system/vm/disassembler.scm (instruction-has-fallthrough): Use
bitvector-bit-clear?.
* test-suite/tests/bitvectors.test: Update.
Diffstat (limited to 'module')
-rw-r--r-- | module/ice-9/sandbox.scm | 3 | ||||
-rw-r--r-- | module/system/vm/disassembler.scm | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/module/ice-9/sandbox.scm b/module/ice-9/sandbox.scm index b2c0658e9..26958cce4 100644 --- a/module/ice-9/sandbox.scm +++ b/module/ice-9/sandbox.scm @@ -1082,7 +1082,8 @@ allocation limit is exceeded, an exception will be thrown to the bitvector bitvector->list bitvector-length - bitvector-ref + bitvector-bit-set? + bitvector-bit-clear? bitvector? list->bitvector make-bitvector))) diff --git a/module/system/vm/disassembler.scm b/module/system/vm/disassembler.scm index e6ce864e6..4d539a17d 100644 --- a/module/system/vm/disassembler.scm +++ b/module/system/vm/disassembler.scm @@ -509,7 +509,7 @@ address of that offset." subr-call foreign-call continuation-call j)) (let ((opcode (logand (bytevector-u32-native-ref code pos) #xff))) - (not (bitvector-ref non-fallthrough-set opcode)))) + (bitvector-bit-clear? non-fallthrough-set opcode))) (define-syntax define-jump-parser (lambda (x) |