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

73 commits

Author SHA1 Message Date
Mark H Weaver
b0a702d773 Do not assume that sizeof (long) == sizeof (void *) == sizeof (SCM).
This assumption does not hold on systems that use the LLP64 data model.

Partially fixes <https://debbugs.gnu.org/22406>.
Reported by Peter TB Brett <peter@peter-b.co.uk>.

* libguile/numbers.h (scm_t_inum): Move here from numbers.c, and change
  to be equivalent to 'long' (formerly 'scm_t_signed_bits').
  (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Define based on
  SCM_I_FIXNUM_BIT instead of SCM_T_SIGNED_BITS_MAX.
  (SCM_I_INUM): Adjust definitions to return a 'scm_t_inum', and avoiding
  the assumption that SCM_UNPACK returns a 'long'.
* libguile/numbers.c (scm_t_inum): Move definition to numbers.h.
  Verify that 'scm_t_inum' fits within a SCM value.
  (scm_i_inum2big): Remove preprocessor code that forced a compile error
  unless sizeof (long) == sizeof (void *).
* libguile/vm-i-scheme.c (_CX): For fixnum assembly functions, choose
  the register size based on SCM_I_FIXNUM_BIT instead of SIZEOF_VOID_P.
  (ASM_MUL, "ash", "vector-ref", "vector-set", BV_FIXABLE_INT_REF)
  (BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET)
  (BV_FLOAT_SET): Use 'scm_t_inum' for fixnums instead of
  'scm_t_signed_bits'.
2016-06-20 15:22:27 -04:00
Mark H Weaver
a85c78ea13 VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL outputs.
Reported by Rob Browning <rlb@defaultvalue.org>.

* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
  to the SMULL output registers.
2014-09-20 05:30:41 -04:00
Mark H Weaver
03cce0ce5f Avoid undefined behavior regarding signed integers and left shifts.
* libguile/numbers.c (scm_logbit_p): If the requested bit is the sign
  bit (or above), check the sign portably.  Otherwise, ensure that we're
  testing the bit in a two's complement representation.
  (left_shift_exact_integer): Avoid left-shifting negative integers.

* libguile/vm-i-scheme.c (ash): Avoid left-shifting negative integers.
2014-03-11 21:39:13 -04:00
Mark H Weaver
f07fa85150 Fix inline asm of VM numerical operations for x32.
* libguile/vm-i-scheme.c (_CX): Choose register size based on
  'SIZEOF_VOID_P' instead of '__x86_64__'.
2014-02-12 20:53:55 -05:00
Mark H Weaver
ca7b6f6869 VM: ash: Use SCM_SRS and handle large right shift in fast path.
* libguile/vm-i-scheme.c (ash): Use SCM_SRS.  Handle inum right shift by
  more than SCM_I_FIXNUM_BIT-1 bits in fast path.
2013-08-06 16:38:32 -04:00
Mark H Weaver
48b6f151c7 VM: ASM_ADD and ASM_SUB for x86: clobber _CX not "rcx".
* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB): Clobber _CX not "rcx".
2013-08-04 19:39:43 -04:00
Mark H Weaver
afa3c37ddc VM: Define ASM_MUL on ARM only if SMULL instruction is supported.
* libguile/vm-i-scheme.c (ASM_MUL): Define only if the target
  architecture is known to implement the SMULL instruction.
2013-08-04 18:06:07 -04:00
Mark H Weaver
f91a1864c3 VM: Implement ASM_ADD, ASM_SUB, and ASM_MUL for ARM processors.
* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB, ASM_MUL): Implement for ARM.
2013-08-04 04:16:57 -04:00
Mark H Weaver
b2df1682df VM: Avoid untagging inums in 'logand' and 'logior'.
* libguile/vm-i-scheme.c (logand, logior): Avoid untagging.
2013-08-03 15:09:36 -04:00
Mark H Weaver
4fa65b903b VM: Add ASM_MUL for x86.
* libguile/vm-i-scheme.c (ASM_MUL): New macro.
  (mul): Use ASM_MUL if available.
2013-08-03 15:05:59 -04:00
Mark H Weaver
9f6211707b VM: Support 32-bit x86 in ASM_ADD and ASM_SUB.
* libguile/vm-i-scheme.c (_CX): New macro.
  (ASM_ADD, ASM_SUB): Replace references to "rcx" with _CX.
2013-08-03 15:02:41 -04:00
Mark H Weaver
ddf4ff2475 VM: Add "cc" to the clobber list of ASM_ADD and ASM_SUB.
* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB): Add "cc" to the clobber
  list.  Suggested by Göran Weinholt <goran@weinholt.se>.
2013-08-03 14:59:54 -04:00
Mark H Weaver
4350c15673 VM: Avoid overflow in ASM_ADD when the result is most-positive-fixnum.
* libguile/vm-i-scheme.c (ASM_ADD): Remove the tag from one of the
  operands before adding, to avoid overflow when the result is the most
  positive fixnum.
2013-08-03 14:51:07 -04:00
Mark H Weaver
cb1482e719 VM: Avoid signed overflows in 'add1' and 'sub1'.
* libguile/vm-i-scheme.c (INUM_STEP): New macro.
  (add1, sub1): Avoid signed overflows, and use INUM_STEP.
2013-08-03 14:46:40 -04:00
Mark H Weaver
478fa0d530 VM: Redefine INUM_MIN and INUM_MAX without assumptions.
* libguile/vm-i-scheme.c (INUM_MIN, INUM_MAX): Redefine to avoid
  assumptions about the representation of inums.
2013-08-03 14:32:04 -04:00
Mark H Weaver
7e8166f5bd Fix VM 'ash' for right shifts by large amounts.
Fixes <http://bugs.gnu.org/14864>.
Reported by Göran Weinholt <goran@weinholt.se>.

* libguile/vm-i-scheme.c (ash): Fallback to 'scm_ash' for right shifts
  with counts >= SCM_I_FIXNUM_BIT, since '>>' is not guaranteed to work
  correctly for large counts.
2013-07-14 14:47:10 -04:00
Andy Wingo
776491caa2 fix compilation of glil to assembly
* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
  the value was not a struct.

* module/system/base/compile.scm (find-language-joint): Default to
  joining at the target language.
  (default-language-joiner): Allow sequences of one compiled expression
  to pass through.  Otherwise error as before.
  (read-and-parse): New helper; actually parses.
  (read-and-compile): Use read-and-parse, and fall back to
  default-language-joiner.

Thanks to Nala Ginrut for the report.
2013-01-22 09:19:55 +01:00
Andy Wingo
53bdfcf034 push error handlers out of line in the vm
* libguile/vm.c:
  (vm_error):
  (vm_error_bad_instruction):
  (vm_error_unbound):
  (vm_error_unbound_fluid):
  (vm_error_not_a_variable):
  (vm_error_not_a_thunk):
  (vm_error_apply_to_non_list):
  (vm_error_kwargs_length_not_even):
  (vm_error_kwargs_invalid_keyword):
  (vm_error_kwargs_unrecognized_keyword):
  (vm_error_too_many_args):
  (vm_error_wrong_num_args):
  (vm_error_wrong_type_apply):
  (vm_error_stack_overflow):
  (vm_error_stack_underflow):
  (vm_error_improper_list):
  (vm_error_not_a_pair):
  (vm_error_not_a_bytevector):
  (vm_error_not_a_struct):
  (vm_error_no_values):
  (vm_error_not_enough_values):
  (vm_error_continuation_not_rewindable):
  (vm_error_bad_wide_string_length):
  (vm_error_invalid_address):
  (vm_error_object):
  (vm_error_free_variable): New internal helpers, implementing VM error
  handling.

* libguile/vm-engine.h (VM_ASSERT): New helper macro.
  (ASSERT, CHECK_OBJECT, CHECK_FREE_VARIABLE):
  (PRE_CHECK_UNDERFLOW, PUSH_LIST): Use the new helper.

* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Use VM_ASSERT and the out-of-line error
  handlers.

* libguile/vm-engine.c (vm_engine): Remove inline error handlers, and
  remove a couple of local vars.  Use VM_ASSERT.  Have halt handle the
  return itself.
2012-04-30 21:29:11 +02:00
Andy Wingo
a18e13a57c Revert "vm-i-scheme.c slight refactor"
This reverts commit c0e4449908.

This refactor was needed for the introduction of DEAD(), which does not
appear to have been necessary.
2012-01-29 22:31:49 +01:00
Andy Wingo
a39b116f00 Revert "attempt to clear stale references on VM C stack"
This reverts commit 04b2d77354.

Since it wasn't fixing the "lexical vars are collectable" test, it added
complexity with no benefit.
2012-01-29 22:30:21 +01:00
Andy Wingo
04b2d77354 attempt to clear stale references on VM C stack
* libguile/vm-engine.h (DEAD): New macro, nulls out a value.

* libguile/vm-i-system.c:
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c: Use DEAD when variables become dead.

Later we can #ifdef this out, but I want to give the buildbots a try
with this patch to make sure it's correct.
2012-01-27 19:34:19 +01:00
Andy Wingo
c0e4449908 vm-i-scheme.c slight refactor
* libguile/vm-i-scheme.c: Refactor the RETURN macro to not include
  NEXT.  Adapt all uses to NEXT on their own.
2012-01-27 19:09:32 +01:00
Ludovic Courtès
1002c774e0 Use alignof_type' instead of alignof'.
* libguile/foreign.c: Use `alignof_type' instead of `alignof'; the
  latter was removed from Gnulib's <alignof.h> in
  408e170e3ae81f73fb65686c5834693d89a96594 (Nov. 1 2011).
* libguile/vm-i-scheme.c: Likewise.
2011-12-14 23:46:16 +01:00
Andy Wingo
b2b33168b1 more care regarding SCM_PACK and SCM_UNPACK
* libguile/control.c (reify_partial_continuation):
* libguile/eval.c (RETURN_BOOT_CLOSURE):
* libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref)
  (scm_frame_local_set_x)
* libguile/frames.h (SCM_FRAME_SET_RETURN_ADDRESS):
  (SCM_FRAME_SET_MV_RETURN_ADDRESS, SCM_FRAME_SET_DYNAMIC_LINK):
* libguile/goops.c (scm_class_of, scm_primitive_generic_generic)
  (scm_c_extend_primitive_generic, compute_getters_n_setters)
  (scm_sys_initialize_object):
* libguile/guardians.c (finalize_guarded):
* libguile/list.c (SCM_I_CONS):
* libguile/macros.c (scm_i_make_primitive_macro)
  (scm_make_syntax_transformer):
* libguile/memoize.c (MAKMEMO, SCM_MAKE_MEMOIZER)
  (SCM_MAKE_REST_MEMOIZER):
* libguile/modules.c (scm_module_reverse_lookup)
* libguile/print.c (iprin1):
* libguile/promises.c (scm_make_promise)
* libguile/srcprop.c (scm_make_srcprops):
* libguile/vectors.c (scm_c_vector_ref):
* libguile/vm-engine.c (vm_engine)
* libguile/vm-i-scheme.c (REL, add1, sub1):
* libguile/vm-i-system.c (new_frame, call_cc)
* libguile/weaks.h (SCM_WEAK_PAIR_WORD_DELETED_P): Be more careful about
  SCM_PACK / SCM_UNPACK.
2011-05-13 15:28:08 +02:00
Andy Wingo
eae2438d2b VM tweaks
* libguile/vm-engine.c (VM_CHECK_OBJECT, VM_CHECK_FREE_VARIABLES): Set
  to 0 for both engines.  These are really internal debugging variables,
  which don't affect user-visible features, provided that the compiler
  is correct of course.
  (VM_CHECK_UNDERFLOW): New var, also off by default: whether to check
  for stack underflow when popping values.
  (vm_engine): Don't declare object_count if we are not checking object
  table accesses.

* libguile/vm-engine.h (CACHE_PROGRAM): Don't muck with object_count
  if we are not checking object table accesses.
  (CHECK_UNDERFLOW, PRE_CHECK_UNDERFLOW): Nop out if we are not checking
  underflow.
  (POP2, POP3): New macros which check for underflow before popping more
  than one value.

* libguile/vm-i-loader.c (load_array):
* libguile/vm-i-scheme.c (set_car, set_cdr, vector_set, slot_set)
  (BV_SET_WITH_ENDIANNESS, BV_FIXABLE_INT_SET, BV_INT_SET)
  (BV_FLOAT_SET):
* libguile/vm-i-system.c (partial_cont_call, fix_closure, prompt)
  (fluid_set): Use POP2 / POP3.
  (local_set, long_local_set): Pop to locals instead of using values on
  the stack then dropping; allows for underflow to be checked before the
  value is accessed.
  (BR): Don't NULLSTACK or DROP after the operation.
  (br_if, br_if_not, br_if_eq, br_if_not_eq, br_if_null)
  (br_if_not_null): Pop to locals before doing the compare and jump.
2011-05-05 14:04:23 +02:00
Andy Wingo
ad301b6d58 fix a failure to sync regs in vm bytevector ops
* libguile/vm-i-scheme.c (BV_SET_WITH_ENDIANNESS, BV_FIXABLE_INT_SET)
  (BV_INT_SET, BV_FLOAT_SET): Sync registers before dispatching to the C
  function.
2011-03-23 17:05:28 +01:00
Andy Wingo
e25f37271a fix a number of assuptions that a long could hold an inum
* libguile/bytevectors.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/numbers.c:
* libguile/random.c:
* libguile/read.c:
* libguile/vm-i-scheme.c: Fix a number of assumptions that a long could
  hold an inum. This is not the case on platforms whose void* is larger
  than their long.

* libguile/numbers.c (scm_i_inum2big): New helper, only implemented for
  sizeof(void*) == sizeof(long); produces a compile error on other
  platforms. Basically gmp doesn't have a nice interface for converting
  between mpz values and intmax_t.
2010-11-19 15:22:43 +01:00
Ludovic Courtès
0b54eea09a Optimize fixnum comparison.
* libguile/vm-i-scheme.c (REL): Don't untag X and Y since tagging
  preserves ordering.
2010-11-19 13:34:44 +01:00
Ludovic Courtès
0c57673a11 Add optimized tagged integer addition/subtractions for x86_64.
This results in a 17% improvement in the execution time of the "+" and
"-" benchmarks for fixnums.

* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB)[defined __x86_64__ &&
  SCM_GNUC_PREREQ (4, 5)]: New macros.
  (add)[defined ASM_ADD]: Use `ASM_ADD' for the fast path.
  (sub)[defined ASM_SUB]: Use `ASM_SUB' for the fast path.

* test-suite/tests/numbers.test ("+")["fixnum + fixnum = bignum
  (32-bit)", "fixnum + fixnum = bignum (64-bit)", "bignum + fixnum =
  fixnum", "wrong type"]: New tests.
  ("-")["fixnum - fixnum = bignum (32-bit)", "fixnum - fixnum = bignum
  (64-bit)", "bignum - fixnum = fixnum", "wrong type"]: New tests.

* test-suite/tests/00-initial-env.test ("goopsless")["+ wrong type
  argument"]: Use `with-test-prefix/c&e' instead of `with-test-prefix'.
  ["- wrong type argument"]: New test prefix.
2010-11-19 13:34:43 +01:00
Ludovic Courtès
e78d4bf9a9 Optimize 1+' and 1-' on fixnums.
* libguile/vm-i-scheme.c (INUM_MAX, INUM_MIN): New macros.
  (add1, sub1): Add/subtract without untagging the operand.  This leads
  to a 44% run time improvement compared to the previous
  implementation.

* libguile/vm.c: Include <stdint.h>.

* test-suite/tests/numbers.test ("1+", "1-"): Add tests for
  MOST-POSITIVE-FIXNUM, resp. MOST-NEGATIVE-FIXNUM, for 32-bit and
  34-bit values thereof.

* benchmark-suite/benchmarks/arithmetic.bm: New file.

* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add it.
2010-10-13 01:31:19 +02:00
Andy Wingo
cf45ff030c inline symbol? and vector? to opcodes, and a psyntax inlining tweak
* libguile/vm-i-scheme.c (symbol?, vector?): New
  instructions. Renumbered the rest.
* libguile/vm-i-system.c: Renumber instructions.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* module/ice-9/psyntax.scm (binding-type, binding-value): Define using
  macros so that we inline to car and cdr opcodes. Oh, for an inliner :)

* module/language/tree-il/compile-glil.scm (*primcall-ops*)
* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*, *effect-free-primitives*)
  (*effect+exception-free-primitives*): Add symbol? and vector?
  inlines.
2010-10-08 12:31:56 +02:00
Andy Wingo
41e49280f3 better error reporting from the vm
* libguile/vm-engine.c: Add func_name local, for error reporting.
  (vm_error_apply_to_non_list): New error case.
  (vm_error_wrong_type_arg): Remove this generic error case.
  (vm_error_wrong_type_apply): Remove FUNC_NAME -- no sense in seeing
  "vm-debug-engine" in the error report.
  (vm_error_not_a_pair, vm_error_not_a_bytevector)
  (vm_error_not_a_struct, vm_error_not_a_thunk): Use func_name instead
  of FUNC_NAME, so we can indicate what caused the error.

* libguile/vm-i-scheme.c (VM_VALIDATE_CONS, car, cdr, set-car!)
  (set-cdr!): Indicate provenance of errors.
  (VM_VALIDATE_STRUCT, struct-vtable):
  (VM_VALIDATE_BYTEVECTOR, BV_FIXABLE_INT_REF, BV_INT_REF)
  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Same.

* libguile/vm-i-system.c (apply, tail-apply): Use
  vm_error_apply_to_non_list.
2010-07-15 12:44:15 +02:00
Ludovic Courtès
1b68d62762 Fix `VM_VALIDATE_BYTEVECTOR' macro wrt. trailing semicolons.
* libguile/vm-i-scheme.c (VM_VALIDATE_BYTEVECTOR): Enclose in "do { }
  while (0)".
2010-06-01 00:42:58 +02:00
Ludovic Courtès
daccfef47b Fix unaligned accesses by the bytevector instructions.
* libguile/vm-i-scheme.c (ALIGNED_P): New macro.
  (BV_FIXABLE_INT_REF, BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET,
  BV_INT_SET, BV_FLOAT_SET): Check the alignment of the pointer instead
  of checking "i % size == 0".  This fixes bus errors on
  `sparc64-linux-gnu'.

* libguile/vm.c: Include <alignof.h>.
2010-06-01 00:40:00 +02:00
Andy Wingo
384dce46bf add underflow check in make-array
* libguile/vm-i-scheme.c (make-array): Check for underflow before making
  the array.
2010-05-02 13:15:22 +02:00
Andy Wingo
c99865c123 simplify make-struct
* libguile/vm-i-scheme.c: Use DROPN idiom.
2010-05-01 00:49:06 +02:00
Andy Wingo
9a974fd384 optimize and bugfix make-struct VM opcode
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for make-struct
  change.

* libguile/struct.c (scm_i_alloc_struct): Use scm_words instead of
  scm_gc_malloc to simplify the code and inline the call to GC_MALLOC.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
  make-struct/no-tail to make-struct.

* module/language/tree-il/primitives.scm (define-primitive-expander):
  Allow a conditional branch of #f to aboirt inlining.
  (make-struct): Expand into make-struct/no-tail in the case that
  tail-size is 0.

* libguile/vm-i-scheme.c (make-struct): Adapt to always assume tail-size
  is 0. Inline allocation if possible. Don't decrement the SP past live
  objects on the stack, which could cause GC to miss references. Use the
  NULLSTACK macro.
2010-05-01 00:31:18 +02:00
Andy Wingo
1a461493a3 sync regs before calling scm_class_of
* libguile/vm-i-scheme.c (class-of): Sync registers before calling
  scm_class_of.
2010-04-08 10:56:14 +02:00
Andy Wingo
7b702b5391 fix vector-ref and vector-set opcodes for weak vectors
* libguile/vectors.h (SCM_I_IS_NONWEAK_VECTOR): New internal predicate.
* libguile/vm-i-scheme.c (vector-ref, vector-set): Only inline access to
  nonweak vectors.
2010-04-01 09:05:59 +02:00
Andy Wingo
8ecd1943ef fix bug in ash opcode
* libguile/vm-i-scheme.c (ash): Fix embarrassing bug in (ash 1 32).
* test-suite/tests/bit-operations.test ("bitshifts on word boundaries"):
  Add tests.
2010-03-31 22:29:29 +02:00
Andy Wingo
2533f10b40 nil is null, whee
* libguile/pairs.h (scm_is_null): Nil is also null.

* libguile/vm-i-scheme.c (not, not-not, null?, not-null?):
* libguile/vm-i-system.c (br-if-null, br-if-not-null): Remove some more
  nil special cases.
2010-03-30 10:31:27 +02:00
Ludovic Courtès
9823fd399c Make sure the whole VM stack is always scanned by the GC.
Thanks to Andy for noticing this.

* libguile/vm-engine.h (SYNC_REGISTER, CACHE_REGISTER): Add comment.

* libguile/vm-i-scheme.c (make_struct): Call `SYNC_REGISTER ()' in all
  cases since the GC is going to run.
  (struct_ref, struct_set): Call `SYNC_REGISTER ()' on the slow path.
  (BV_REF_WITH_ENDIANNESS, BV_FIXABLE_INT_REF, BV_INT_REF): Likewise.
  (BV_FLOAT_REF): Always `SYNC_REGISTER ()'.
2010-03-15 15:39:43 +01:00
Andy Wingo
827dc8dcb6 renumber VM opcodes
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Renumber ops. Add a foreign-call op stub.
  Rearrange some ops.

* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump
2010-01-26 22:56:41 +01:00
Ludovic Courtès
a752c0dc27 Add struct-ref' and struct-set' VM opcodes.
* libguile/vm-i-scheme.c (make_struct): Optimize the
  `SCM_VTABLE_FLAG_SIMPLE' case.
  (struct_ref, struct_set): New opcodes.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
  `struct-ref' and `struct-set!'.

* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Likewise.
  (*effect-free-primitives*): Add `struct-ref'.
2010-01-23 16:43:50 +01:00
Andy Wingo
e30f5b7d40 make-array bugfix
* libguile/vm-i-scheme.c (make-array): Fix terrible stack corruption
  bug.
2010-01-12 00:21:16 +01:00
Andy Wingo
73788ca8be allow compilation of #@2(1 2 3)
* libguile/arrays.h:
* libguile/arrays.c (scm_from_contiguous_array): New public function,
  like scm_from_contiguous_typed_array but for arrays of generic Scheme
  values.

* libguile/vm-i-scheme.c (make-struct): Sync regs before making the
  struct, so if we get a GC the regs are on the heap.
  (make-array): New instruction, makes an generic (untyped) Scheme
  array.

* module/language/glil/compile-assembly.scm (dump-object): Correctly
  compile arrays.
2010-01-11 21:47:10 +01:00
Ludovic Courtès
bd91ecce14 Add opcodes for struct?', struct-vtable', and `make-struct'.
* libguile/vm-engine.c (VM_NAME)[vm_error_not_a_struct]: New label.

* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): New macro.
  (struct_p, struct_vtable, make_struct): New instructions.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
  `struct?', `struct-vtable', and `make-struct'.

* module/language/tree-il/primitives.scm (*interesting-primitive-names*,
  *effect-free-primitives*): Likewise.
2009-12-11 13:03:45 +01:00
Ludovic Courtès
5c8cefe591 Remove remaining uses of discouraged constructs.
* libguile/frames.c, libguile/instructions.c, libguile/objcodes.c,
  libguile/programs.c, libguile/throw.c, libguile/vm-i-scheme.c,
  libguile/vm.c:  Replace uses of discouraged constructs by their
  current counterparts.
2009-11-28 15:11:31 +01:00
Ludovic Courtès
9bd48cb17b Remove uses of discouraged constructs.
* libguile/vm-i-scheme.c, libguile/vm-i-system.c, libguile/vm.c: Replace
  uses of discouraged constructs by their current counterparts.
2009-11-25 23:46:17 +01:00
Andy Wingo
b10d93309b opcodes for bit twiddling (ash, logand, logior, logxor)
* module/language/tree-il/compile-glil.scm:
* module/language/tree-il/primitives.scm:
* libguile/vm-i-scheme.c (ash, logand, logior, logxor): New opcodes.
2009-11-15 21:03:33 +01:00