mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
5e80f2cea3
commit
a39b116f00
4 changed files with 10 additions and 229 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -152,8 +152,6 @@
|
|||
#define ASSERT_BOUND(x)
|
||||
#endif
|
||||
|
||||
#define DEAD(v) v = SCM_UNDEFINED
|
||||
|
||||
#if VM_CHECK_OBJECT
|
||||
#define SET_OBJECT_COUNT(n) object_count = n
|
||||
#else
|
||||
|
@ -327,7 +325,6 @@ do \
|
|||
CONS (l, x, l); \
|
||||
} \
|
||||
PUSH (l); \
|
||||
DEAD (l); \
|
||||
} while (0)
|
||||
|
||||
/* The opposite: push all of the elements in L onto the list. */
|
||||
|
@ -353,9 +350,7 @@ do { \
|
|||
CONS (l, o, l); \
|
||||
POP (o); \
|
||||
} \
|
||||
DEAD (o); \
|
||||
PUSH (l); \
|
||||
DEAD (l); \
|
||||
} while (0)
|
||||
|
||||
#define POP_CONS_MARK() \
|
||||
|
@ -368,9 +363,7 @@ do { \
|
|||
CONS (l, o, l); \
|
||||
POP (o); \
|
||||
} \
|
||||
DEAD (o); \
|
||||
PUSH (l); \
|
||||
DEAD (l); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001,2008,2009,2010,2011,2012 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001,2008,2009,2010,2011 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -73,9 +73,6 @@ VM_DEFINE_LOADER (104, load_program, "load-program")
|
|||
|
||||
PUSH (scm_make_program (objcode, objs, SCM_BOOL_F));
|
||||
|
||||
DEAD (objs);
|
||||
DEAD (objcode);
|
||||
|
||||
ip += len;
|
||||
|
||||
NEXT;
|
||||
|
@ -87,7 +84,6 @@ VM_DEFINE_INSTRUCTION (105, link_now, "link-now", 0, 1, 1)
|
|||
POP (what);
|
||||
SYNC_REGISTER ();
|
||||
PUSH (resolve_variable (what, scm_current_module ()));
|
||||
DEAD (what);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -99,8 +95,6 @@ VM_DEFINE_LOADER (106, load_array, "load-array")
|
|||
POP2 (shape, type);
|
||||
SYNC_REGISTER ();
|
||||
PUSH (scm_from_contiguous_typed_array (type, shape, ip, len));
|
||||
DEAD (type);
|
||||
DEAD (shape);
|
||||
ip += len;
|
||||
NEXT;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ VM_DEFINE_FUNCTION (128, not, "not", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (scm_is_false (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -41,7 +40,6 @@ VM_DEFINE_FUNCTION (129, not_not, "not-not", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (!scm_is_false (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -49,8 +47,6 @@ VM_DEFINE_FUNCTION (130, eq, "eq?", 2)
|
|||
{
|
||||
ARGS2 (x, y);
|
||||
RETURN (scm_from_bool (scm_is_eq (x, y)));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -58,8 +54,6 @@ VM_DEFINE_FUNCTION (131, not_eq, "not-eq?", 2)
|
|||
{
|
||||
ARGS2 (x, y);
|
||||
RETURN (scm_from_bool (!scm_is_eq (x, y)));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -67,7 +61,6 @@ VM_DEFINE_FUNCTION (132, nullp, "null?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (scm_is_null (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -75,7 +68,6 @@ VM_DEFINE_FUNCTION (133, not_nullp, "not-null?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (!scm_is_null (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -91,8 +83,6 @@ VM_DEFINE_FUNCTION (134, eqv, "eqv?", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_eqv_p (x, y));
|
||||
}
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -108,8 +98,6 @@ VM_DEFINE_FUNCTION (135, equal, "equal?", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_equal_p (x, y));
|
||||
}
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -117,7 +105,6 @@ VM_DEFINE_FUNCTION (136, pairp, "pair?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (scm_is_pair (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -125,7 +112,6 @@ VM_DEFINE_FUNCTION (137, listp, "list?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (scm_ilength (x) >= 0));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -133,7 +119,6 @@ VM_DEFINE_FUNCTION (138, symbolp, "symbol?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (scm_is_symbol (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -141,7 +126,6 @@ VM_DEFINE_FUNCTION (139, vectorp, "vector?", 1)
|
|||
{
|
||||
ARGS1 (x);
|
||||
RETURN (scm_from_bool (SCM_I_IS_VECTOR (x)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -155,8 +139,6 @@ VM_DEFINE_FUNCTION (140, cons, "cons", 2)
|
|||
ARGS2 (x, y);
|
||||
CONS (x, x, y);
|
||||
RETURN (x);
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -173,7 +155,6 @@ VM_DEFINE_FUNCTION (141, car, "car", 1)
|
|||
ARGS1 (x);
|
||||
VM_VALIDATE_CONS (x, "car");
|
||||
RETURN (SCM_CAR (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -182,7 +163,6 @@ VM_DEFINE_FUNCTION (142, cdr, "cdr", 1)
|
|||
ARGS1 (x);
|
||||
VM_VALIDATE_CONS (x, "cdr");
|
||||
RETURN (SCM_CDR (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -192,8 +172,6 @@ VM_DEFINE_INSTRUCTION (143, set_car, "set-car!", 0, 2, 0)
|
|||
POP2 (y, x);
|
||||
VM_VALIDATE_CONS (x, "set-car!");
|
||||
SCM_SETCAR (x, y);
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -203,8 +181,6 @@ VM_DEFINE_INSTRUCTION (144, set_cdr, "set-cdr!", 0, 2, 0)
|
|||
POP2 (y, x);
|
||||
VM_VALIDATE_CONS (x, "set-cdr!");
|
||||
SCM_SETCDR (x, y);
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -225,8 +201,6 @@ VM_DEFINE_INSTRUCTION (144, set_cdr, "set-cdr!", 0, 2, 0)
|
|||
SYNC_REGISTER (); \
|
||||
RETURN (srel (x, y)); \
|
||||
} \
|
||||
DEAD (x); \
|
||||
DEAD (y); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -276,15 +250,11 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
|
|||
if (SCM_FIXABLE (n)) \
|
||||
{ \
|
||||
RETURN (SCM_I_MAKINUM (n)); \
|
||||
DEAD (x); \
|
||||
DEAD (y); \
|
||||
NEXT; \
|
||||
} \
|
||||
} \
|
||||
SYNC_REGISTER (); \
|
||||
RETURN (SFUNC (x, y)); \
|
||||
DEAD (x); \
|
||||
DEAD (y); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -349,8 +319,6 @@ VM_DEFINE_FUNCTION (150, add, "add", 2)
|
|||
ASM_ADD (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_sum (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
#endif
|
||||
}
|
||||
|
@ -372,15 +340,12 @@ VM_DEFINE_FUNCTION (151, add1, "add1", 1)
|
|||
if (SCM_LIKELY (SCM_I_INUMP (result)))
|
||||
{
|
||||
RETURN (result);
|
||||
DEAD (result);
|
||||
NEXT;
|
||||
}
|
||||
DEAD (result);
|
||||
}
|
||||
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_sum (x, SCM_I_MAKINUM (1)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -393,8 +358,6 @@ VM_DEFINE_FUNCTION (152, sub, "sub", 2)
|
|||
ASM_SUB (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_difference (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
#endif
|
||||
}
|
||||
|
@ -416,15 +379,12 @@ VM_DEFINE_FUNCTION (153, sub1, "sub1", 1)
|
|||
if (SCM_LIKELY (SCM_I_INUMP (result)))
|
||||
{
|
||||
RETURN (result);
|
||||
DEAD (result);
|
||||
NEXT;
|
||||
}
|
||||
DEAD (result);
|
||||
}
|
||||
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_difference (x, SCM_I_MAKINUM (1)));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -436,8 +396,6 @@ VM_DEFINE_FUNCTION (154, mul, "mul", 2)
|
|||
ARGS2 (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_product (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -446,8 +404,6 @@ VM_DEFINE_FUNCTION (155, div, "div", 2)
|
|||
ARGS2 (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_divide (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -456,8 +412,6 @@ VM_DEFINE_FUNCTION (156, quo, "quo", 2)
|
|||
ARGS2 (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_quotient (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -466,8 +420,6 @@ VM_DEFINE_FUNCTION (157, rem, "rem", 2)
|
|||
ARGS2 (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_remainder (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -476,8 +428,6 @@ VM_DEFINE_FUNCTION (158, mod, "mod", 2)
|
|||
ARGS2 (x, y);
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_modulo (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -490,8 +440,6 @@ VM_DEFINE_FUNCTION (159, ash, "ash", 2)
|
|||
/* Right shift, will be a fixnum. */
|
||||
{
|
||||
RETURN (SCM_I_MAKINUM (SCM_I_INUM (x) >> -SCM_I_INUM (y)));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
else
|
||||
|
@ -507,8 +455,6 @@ VM_DEFINE_FUNCTION (159, ash, "ash", 2)
|
|||
(SCM_SRS (nn, (SCM_I_FIXNUM_BIT-1 - bits_to_shift)) + 1)
|
||||
<= 1))
|
||||
{
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
RETURN (SCM_I_MAKINUM (nn << bits_to_shift));
|
||||
NEXT;
|
||||
}
|
||||
|
@ -518,8 +464,6 @@ VM_DEFINE_FUNCTION (159, ash, "ash", 2)
|
|||
}
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_ash (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -533,8 +477,6 @@ VM_DEFINE_FUNCTION (160, logand, "logand", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_logand (x, y));
|
||||
}
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -548,8 +490,6 @@ VM_DEFINE_FUNCTION (161, logior, "logior", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_logior (x, y));
|
||||
}
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -563,8 +503,6 @@ VM_DEFINE_FUNCTION (162, logxor, "logxor", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_logxor (x, y));
|
||||
}
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -587,8 +525,6 @@ VM_DEFINE_FUNCTION (163, vector_ref, "vector-ref", 2)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_vector_ref (vect, idx));
|
||||
}
|
||||
DEAD (vect);
|
||||
DEAD (idx);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -607,9 +543,6 @@ VM_DEFINE_INSTRUCTION (164, vector_set, "vector-set", 0, 3, 0)
|
|||
SYNC_REGISTER ();
|
||||
scm_vector_set_x (vect, idx, val);
|
||||
}
|
||||
DEAD (vect);
|
||||
DEAD (idx);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -625,10 +558,8 @@ VM_DEFINE_INSTRUCTION (165, make_array, "make-array", 3, -1, 1)
|
|||
SYNC_REGISTER ();
|
||||
PRE_CHECK_UNDERFLOW (len);
|
||||
ret = scm_from_contiguous_array (shape, sp - len + 1, len);
|
||||
DEAD (shape);
|
||||
DROPN (len);
|
||||
PUSH (ret);
|
||||
DEAD (ret);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -648,7 +579,6 @@ VM_DEFINE_FUNCTION (166, struct_p, "struct?", 1)
|
|||
{
|
||||
ARGS1 (obj);
|
||||
RETURN (scm_from_bool (SCM_STRUCTP (obj)));
|
||||
DEAD (obj);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -657,7 +587,6 @@ VM_DEFINE_FUNCTION (167, struct_vtable, "struct-vtable", 1)
|
|||
ARGS1 (obj);
|
||||
VM_VALIDATE_STRUCT (obj, "struct_vtable");
|
||||
RETURN (SCM_STRUCT_VTABLE (obj));
|
||||
DEAD (obj);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -687,11 +616,9 @@ VM_DEFINE_INSTRUCTION (168, make_struct, "make-struct", 2, -1, 1)
|
|||
}
|
||||
else
|
||||
ret = scm_c_make_structv (vtable, 0, n - 1, (scm_t_bits *) inits);
|
||||
DEAD (vtable);
|
||||
|
||||
DROPN (n);
|
||||
PUSH (ret);
|
||||
DEAD (ret);
|
||||
|
||||
NEXT;
|
||||
}
|
||||
|
@ -719,16 +646,12 @@ VM_DEFINE_FUNCTION (169, struct_ref, "struct-ref", 2)
|
|||
{
|
||||
scm_t_bits *data = SCM_STRUCT_DATA (obj);
|
||||
RETURN (SCM_PACK (data[index]));
|
||||
DEAD (obj);
|
||||
DEAD (pos);
|
||||
NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_struct_ref (obj, pos));
|
||||
DEAD (obj);
|
||||
DEAD (pos);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -754,20 +677,13 @@ VM_DEFINE_FUNCTION (170, struct_set, "struct-set", 3)
|
|||
{
|
||||
scm_t_bits *data = SCM_STRUCT_DATA (obj);
|
||||
data[index] = SCM_UNPACK (val);
|
||||
/* FIXME: Shouldn't be returning anything, right? */
|
||||
RETURN (val);
|
||||
DEAD (obj);
|
||||
DEAD (pos);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
SYNC_REGISTER ();
|
||||
RETURN (scm_struct_set_x (obj, pos, val));
|
||||
DEAD (obj);
|
||||
DEAD (pos);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -785,7 +701,6 @@ VM_DEFINE_FUNCTION (171, class_of, "class-of", 1)
|
|||
SYNC_REGISTER ();
|
||||
RETURN (scm_class_of (obj));
|
||||
}
|
||||
DEAD (obj);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -795,9 +710,7 @@ VM_DEFINE_FUNCTION (172, slot_ref, "slot-ref", 2)
|
|||
size_t slot;
|
||||
ARGS2 (instance, idx);
|
||||
slot = SCM_I_INUM (idx);
|
||||
DEAD (idx);
|
||||
RETURN (SCM_PACK (SCM_STRUCT_DATA (instance) [slot]));
|
||||
DEAD (instance);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -808,10 +721,7 @@ VM_DEFINE_INSTRUCTION (173, slot_set, "slot-set", 0, 3, 0)
|
|||
size_t slot;
|
||||
POP3 (val, idx, instance);
|
||||
slot = SCM_I_INUM (idx);
|
||||
DEAD (idx);
|
||||
SCM_STRUCT_DATA (instance) [slot] = SCM_UNPACK (val);
|
||||
DEAD (instance);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -836,17 +746,11 @@ VM_DEFINE_INSTRUCTION (173, slot_set, "slot-set", 0, 3, 0)
|
|||
SCM endianness; \
|
||||
POP (endianness); \
|
||||
if (scm_is_eq (endianness, scm_i_native_endianness)) \
|
||||
{ \
|
||||
DEAD (endianness); \
|
||||
goto VM_LABEL (bv_##stem##_native_ref); \
|
||||
} \
|
||||
goto VM_LABEL (bv_##stem##_native_ref); \
|
||||
{ \
|
||||
ARGS2 (bv, idx); \
|
||||
SYNC_REGISTER (); \
|
||||
RETURN (scm_bytevector_##fn_stem##_ref (bv, idx, endianness)); \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
DEAD (endianness); \
|
||||
NEXT; \
|
||||
} \
|
||||
}
|
||||
|
@ -894,8 +798,6 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
|
|||
SYNC_REGISTER (); \
|
||||
RETURN (scm_bytevector_ ## fn_stem ## _ref (bv, idx)); \
|
||||
} \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -928,8 +830,6 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
|
|||
SYNC_REGISTER (); \
|
||||
RETURN (scm_bytevector_ ## stem ## _native_ref (bv, idx)); \
|
||||
} \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -951,8 +851,6 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
|
|||
RETURN (scm_from_double (*float_ptr)); \
|
||||
else \
|
||||
RETURN (scm_bytevector_ ## fn_stem ## _native_ref (bv, idx)); \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -996,18 +894,11 @@ BV_FLOAT_REF (f64, ieee_double, double, 8)
|
|||
SCM endianness; \
|
||||
POP (endianness); \
|
||||
if (scm_is_eq (endianness, scm_i_native_endianness)) \
|
||||
{ \
|
||||
DEAD (endianness); \
|
||||
goto VM_LABEL (bv_##stem##_native_set); \
|
||||
} \
|
||||
goto VM_LABEL (bv_##stem##_native_set); \
|
||||
{ \
|
||||
SCM bv, idx, val; POP3 (val, idx, bv); \
|
||||
SYNC_REGISTER (); \
|
||||
scm_bytevector_##fn_stem##_set_x (bv, idx, val, endianness); \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
DEAD (val); \
|
||||
DEAD (endianness); \
|
||||
NEXT; \
|
||||
} \
|
||||
}
|
||||
|
@ -1055,9 +946,6 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
|
|||
SYNC_REGISTER (); \
|
||||
scm_bytevector_ ## fn_stem ## _set_x (bv, idx, val); \
|
||||
} \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
DEAD (val); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -1082,9 +970,6 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
|
|||
SYNC_REGISTER (); \
|
||||
scm_bytevector_ ## stem ## _native_set_x (bv, idx, val); \
|
||||
} \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
DEAD (val); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
@ -1109,9 +994,6 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
|
|||
SYNC_REGISTER (); \
|
||||
scm_bytevector_ ## fn_stem ## _native_set_x (bv, idx, val); \
|
||||
} \
|
||||
DEAD (bv); \
|
||||
DEAD (idx); \
|
||||
DEAD (val); \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ VM_DEFINE_INSTRUCTION (3, dup, "dup", 0, 0, 1)
|
|||
{
|
||||
SCM x = *sp;
|
||||
PUSH (x);
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -214,7 +213,6 @@ VM_DEFINE_INSTRUCTION (18, vector, "vector", 2, -1, 1)
|
|||
memcpy (SCM_I_VECTOR_WELTS(vect), sp, sizeof(SCM) * len);
|
||||
NULLSTACK (len);
|
||||
*sp = vect;
|
||||
DEAD (vect);
|
||||
|
||||
NEXT;
|
||||
}
|
||||
|
@ -319,7 +317,6 @@ VM_DEFINE_INSTRUCTION (25, variable_ref, "variable-ref", 0, 1, 1)
|
|||
{
|
||||
SCM o = VARIABLE_REF (x);
|
||||
*sp = o;
|
||||
DEAD (o);
|
||||
}
|
||||
|
||||
NEXT;
|
||||
|
@ -337,20 +334,18 @@ VM_DEFINE_INSTRUCTION (26, variable_bound, "variable-bound?", 0, 1, 1)
|
|||
}
|
||||
else
|
||||
*sp = scm_from_bool (VARIABLE_BOUNDP (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (27, toplevel_ref, "toplevel-ref", 1, 0, 1)
|
||||
{
|
||||
unsigned objnum = FETCH ();
|
||||
SCM what;
|
||||
SCM what, resolved;
|
||||
CHECK_OBJECT (objnum);
|
||||
what = OBJECT_REF (objnum);
|
||||
|
||||
if (!SCM_VARIABLEP (what))
|
||||
{
|
||||
SCM resolved;
|
||||
SYNC_REGISTER ();
|
||||
resolved = resolve_variable (what, scm_program_module (program));
|
||||
if (!VARIABLE_BOUNDP (resolved))
|
||||
|
@ -359,18 +354,16 @@ VM_DEFINE_INSTRUCTION (27, toplevel_ref, "toplevel-ref", 1, 0, 1)
|
|||
goto vm_error_unbound;
|
||||
}
|
||||
what = resolved;
|
||||
DEAD (resolved);
|
||||
OBJECT_SET (objnum, what);
|
||||
}
|
||||
|
||||
PUSH (VARIABLE_REF (what));
|
||||
DEAD (what);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (28, long_toplevel_ref, "long-toplevel-ref", 2, 0, 1)
|
||||
{
|
||||
SCM what;
|
||||
SCM what, resolved;
|
||||
unsigned int objnum = FETCH ();
|
||||
objnum <<= 8;
|
||||
objnum += FETCH ();
|
||||
|
@ -379,7 +372,6 @@ VM_DEFINE_INSTRUCTION (28, long_toplevel_ref, "long-toplevel-ref", 2, 0, 1)
|
|||
|
||||
if (!SCM_VARIABLEP (what))
|
||||
{
|
||||
SCM resolved;
|
||||
SYNC_REGISTER ();
|
||||
resolved = resolve_variable (what, scm_program_module (program));
|
||||
if (!VARIABLE_BOUNDP (resolved))
|
||||
|
@ -388,12 +380,10 @@ VM_DEFINE_INSTRUCTION (28, long_toplevel_ref, "long-toplevel-ref", 2, 0, 1)
|
|||
goto vm_error_unbound;
|
||||
}
|
||||
what = resolved;
|
||||
DEAD (resolved);
|
||||
OBJECT_SET (objnum, what);
|
||||
}
|
||||
|
||||
PUSH (VARIABLE_REF (what));
|
||||
DEAD (what);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -404,7 +394,6 @@ VM_DEFINE_INSTRUCTION (29, local_set, "local-set", 1, 1, 0)
|
|||
SCM x;
|
||||
POP (x);
|
||||
LOCAL_SET (FETCH (), x);
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -416,7 +405,6 @@ VM_DEFINE_INSTRUCTION (30, long_local_set, "long-local-set", 2, 1, 0)
|
|||
i += FETCH ();
|
||||
POP (x);
|
||||
LOCAL_SET (i, x);
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -448,7 +436,6 @@ VM_DEFINE_INSTRUCTION (32, toplevel_set, "toplevel-set", 1, 1, 0)
|
|||
}
|
||||
|
||||
VARIABLE_SET (what, *sp);
|
||||
DEAD (what);
|
||||
DROP ();
|
||||
NEXT;
|
||||
}
|
||||
|
@ -470,7 +457,6 @@ VM_DEFINE_INSTRUCTION (33, long_toplevel_set, "long-toplevel-set", 2, 1, 0)
|
|||
}
|
||||
|
||||
VARIABLE_SET (what, *sp);
|
||||
DEAD (what);
|
||||
DROP ();
|
||||
NEXT;
|
||||
}
|
||||
|
@ -497,6 +483,7 @@ VM_DEFINE_INSTRUCTION (33, long_toplevel_set, "long-toplevel-set", 2, 1, 0)
|
|||
ip += offset; \
|
||||
if (offset < 0) \
|
||||
VM_HANDLE_INTERRUPTS; \
|
||||
NEXT; \
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (34, br, "br", 3, 0, 0)
|
||||
|
@ -514,8 +501,6 @@ VM_DEFINE_INSTRUCTION (35, br_if, "br-if", 3, 0, 0)
|
|||
SCM x;
|
||||
POP (x);
|
||||
BR (scm_is_true (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (36, br_if_not, "br-if-not", 3, 0, 0)
|
||||
|
@ -523,8 +508,6 @@ VM_DEFINE_INSTRUCTION (36, br_if_not, "br-if-not", 3, 0, 0)
|
|||
SCM x;
|
||||
POP (x);
|
||||
BR (scm_is_false (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (37, br_if_eq, "br-if-eq", 3, 0, 0)
|
||||
|
@ -532,9 +515,6 @@ VM_DEFINE_INSTRUCTION (37, br_if_eq, "br-if-eq", 3, 0, 0)
|
|||
SCM x, y;
|
||||
POP2 (y, x);
|
||||
BR (scm_is_eq (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (38, br_if_not_eq, "br-if-not-eq", 3, 0, 0)
|
||||
|
@ -542,9 +522,6 @@ VM_DEFINE_INSTRUCTION (38, br_if_not_eq, "br-if-not-eq", 3, 0, 0)
|
|||
SCM x, y;
|
||||
POP2 (y, x);
|
||||
BR (!scm_is_eq (x, y));
|
||||
DEAD (x);
|
||||
DEAD (y);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (39, br_if_null, "br-if-null", 3, 0, 0)
|
||||
|
@ -552,8 +529,6 @@ VM_DEFINE_INSTRUCTION (39, br_if_null, "br-if-null", 3, 0, 0)
|
|||
SCM x;
|
||||
POP (x);
|
||||
BR (scm_is_null (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
VM_DEFINE_INSTRUCTION (40, br_if_not_null, "br-if-not-null", 3, 0, 0)
|
||||
|
@ -561,8 +536,6 @@ VM_DEFINE_INSTRUCTION (40, br_if_not_null, "br-if-not-null", 3, 0, 0)
|
|||
SCM x;
|
||||
POP (x);
|
||||
BR (!scm_is_null (x));
|
||||
DEAD (x);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
||||
|
@ -726,8 +699,6 @@ VM_DEFINE_INSTRUCTION (48, bind_kwargs, "bind-kwargs", 5, 0, 0)
|
|||
goto vm_error_kwargs_invalid_keyword;
|
||||
}
|
||||
|
||||
DEAD (kw);
|
||||
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -745,7 +716,6 @@ VM_DEFINE_INSTRUCTION (49, push_rest, "push-rest", 2, -1, -1)
|
|||
/* No need to check for underflow. */
|
||||
CONS (rest, *sp--, rest);
|
||||
PUSH (rest);
|
||||
DEAD (rest);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -762,7 +732,6 @@ VM_DEFINE_INSTRUCTION (50, bind_rest, "bind-rest", 4, -1, -1)
|
|||
/* No need to check for underflow. */
|
||||
CONS (rest, *sp--, rest);
|
||||
LOCAL_SET (i, rest);
|
||||
DEAD (rest);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -953,7 +922,6 @@ VM_DEFINE_INSTRUCTION (55, subr_call, "subr-call", 1, -1, -1)
|
|||
abort ();
|
||||
}
|
||||
|
||||
DEAD (pointer);
|
||||
NULLSTACK_FOR_NONLOCAL_EXIT ();
|
||||
|
||||
if (SCM_UNLIKELY (SCM_VALUESP (ret)))
|
||||
|
@ -962,13 +930,11 @@ VM_DEFINE_INSTRUCTION (55, subr_call, "subr-call", 1, -1, -1)
|
|||
ret = scm_struct_ref (ret, SCM_INUM0);
|
||||
nvalues = scm_ilength (ret);
|
||||
PUSH_LIST (ret, scm_is_null);
|
||||
DEAD (ret);
|
||||
goto vm_return_values;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUSH (ret);
|
||||
DEAD (ret);
|
||||
goto vm_return;
|
||||
}
|
||||
}
|
||||
|
@ -1003,7 +969,6 @@ VM_DEFINE_INSTRUCTION (56, smob_call, "smob-call", 1, -1, -1)
|
|||
abort ();
|
||||
}
|
||||
|
||||
DEAD (smob);
|
||||
NULLSTACK_FOR_NONLOCAL_EXIT ();
|
||||
|
||||
if (SCM_UNLIKELY (SCM_VALUESP (ret)))
|
||||
|
@ -1012,13 +977,11 @@ VM_DEFINE_INSTRUCTION (56, smob_call, "smob-call", 1, -1, -1)
|
|||
ret = scm_struct_ref (ret, SCM_INUM0);
|
||||
nvalues = scm_ilength (ret);
|
||||
PUSH_LIST (ret, scm_is_null);
|
||||
DEAD (ret);
|
||||
goto vm_return_values;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUSH (ret);
|
||||
DEAD (ret);
|
||||
goto vm_return;
|
||||
}
|
||||
}
|
||||
|
@ -1034,7 +997,6 @@ VM_DEFINE_INSTRUCTION (57, foreign_call, "foreign-call", 1, -1, -1)
|
|||
|
||||
ret = scm_i_foreign_call (foreign, sp - nargs + 1);
|
||||
|
||||
DEAD (foreign);
|
||||
NULLSTACK_FOR_NONLOCAL_EXIT ();
|
||||
|
||||
if (SCM_UNLIKELY (SCM_VALUESP (ret)))
|
||||
|
@ -1043,13 +1005,11 @@ VM_DEFINE_INSTRUCTION (57, foreign_call, "foreign-call", 1, -1, -1)
|
|||
ret = scm_struct_ref (ret, SCM_INUM0);
|
||||
nvalues = scm_ilength (ret);
|
||||
PUSH_LIST (ret, scm_is_null);
|
||||
DEAD (ret);
|
||||
goto vm_return_values;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUSH (ret);
|
||||
DEAD (ret);
|
||||
goto vm_return;
|
||||
}
|
||||
}
|
||||
|
@ -1066,7 +1026,7 @@ VM_DEFINE_INSTRUCTION (58, continuation_call, "continuation-call", 0, -1, 0)
|
|||
sp - (fp - 1), fp);
|
||||
scm_i_reinstate_continuation (contregs);
|
||||
|
||||
/* no DEAD, no NEXT */
|
||||
/* no NEXT */
|
||||
abort ();
|
||||
}
|
||||
|
||||
|
@ -1076,15 +1036,12 @@ VM_DEFINE_INSTRUCTION (59, partial_cont_call, "partial-cont-call", 0, -1, 0)
|
|||
POP2 (intwinds, vmcont);
|
||||
SYNC_REGISTER ();
|
||||
if (SCM_UNLIKELY (!SCM_VM_CONT_REWINDABLE_P (vmcont)))
|
||||
{
|
||||
finish_args = vmcont;
|
||||
{ finish_args = vmcont;
|
||||
goto vm_error_continuation_not_rewindable;
|
||||
}
|
||||
prevwinds = scm_i_dynwinds ();
|
||||
vm_reinstate_partial_continuation (vm, vmcont, intwinds, sp + 1 - fp, fp,
|
||||
vm_cookie);
|
||||
DEAD (vmcont);
|
||||
DEAD (intwinds);
|
||||
|
||||
/* Rewind prompt jmpbuffers, if any. */
|
||||
{
|
||||
|
@ -1092,9 +1049,7 @@ VM_DEFINE_INSTRUCTION (59, partial_cont_call, "partial-cont-call", 0, -1, 0)
|
|||
for (; !scm_is_eq (winds, prevwinds); winds = scm_cdr (winds))
|
||||
if (SCM_PROMPT_P (scm_car (winds)) && SCM_PROMPT_SETJMP (scm_car (winds)))
|
||||
break;
|
||||
DEAD (winds);
|
||||
}
|
||||
DEAD (prevwinds);
|
||||
|
||||
CACHE_REGISTER ();
|
||||
program = SCM_FRAME_PROGRAM (fp);
|
||||
|
@ -1107,7 +1062,6 @@ VM_DEFINE_INSTRUCTION (60, tail_call_nargs, "tail-call/nargs", 0, 0, 1)
|
|||
SCM x;
|
||||
POP (x);
|
||||
nargs = scm_to_int (x);
|
||||
DEAD (x);
|
||||
/* FIXME: should truncate values? */
|
||||
goto vm_tail_call;
|
||||
}
|
||||
|
@ -1117,7 +1071,6 @@ VM_DEFINE_INSTRUCTION (61, call_nargs, "call/nargs", 0, 0, 1)
|
|||
SCM x;
|
||||
POP (x);
|
||||
nargs = scm_to_int (x);
|
||||
DEAD (x);
|
||||
/* FIXME: should truncate values? */
|
||||
goto vm_call;
|
||||
}
|
||||
|
@ -1192,7 +1145,6 @@ VM_DEFINE_INSTRUCTION (63, apply, "apply", 1, -1, 1)
|
|||
}
|
||||
|
||||
PUSH_LIST (ls, SCM_NULL_OR_NIL_P);
|
||||
DEAD (ls);
|
||||
|
||||
nargs += len - 2;
|
||||
goto vm_call;
|
||||
|
@ -1215,7 +1167,6 @@ VM_DEFINE_INSTRUCTION (64, tail_apply, "tail-apply", 1, -1, 1)
|
|||
}
|
||||
|
||||
PUSH_LIST (ls, SCM_NULL_OR_NIL_P);
|
||||
DEAD (ls);
|
||||
|
||||
nargs += len - 2;
|
||||
goto vm_tail_call;
|
||||
|
@ -1229,16 +1180,13 @@ VM_DEFINE_INSTRUCTION (65, call_cc, "call/cc", 0, 1, 1)
|
|||
SYNC_ALL ();
|
||||
vm_cont = scm_i_vm_capture_stack (vp->stack_base, fp, sp, ip, NULL, 0);
|
||||
cont = scm_i_make_continuation (&first, vm, vm_cont);
|
||||
DEAD (vm_cont);
|
||||
if (first)
|
||||
{
|
||||
PUSH (SCM_PACK (0)); /* dynamic link */
|
||||
PUSH (SCM_PACK (0)); /* mvra */
|
||||
PUSH (SCM_PACK (0)); /* ra */
|
||||
PUSH (proc);
|
||||
DEAD (proc);
|
||||
PUSH (cont);
|
||||
DEAD (cont);
|
||||
nargs = 1;
|
||||
goto vm_call;
|
||||
}
|
||||
|
@ -1251,8 +1199,6 @@ VM_DEFINE_INSTRUCTION (65, call_cc, "call/cc", 0, 1, 1)
|
|||
|
||||
So, pull our regs back down from the vp, and march on to the
|
||||
next instruction. */
|
||||
DEAD (proc);
|
||||
DEAD (cont);
|
||||
CACHE_REGISTER ();
|
||||
program = SCM_FRAME_PROGRAM (fp);
|
||||
CACHE_PROGRAM ();
|
||||
|
@ -1276,20 +1222,15 @@ VM_DEFINE_INSTRUCTION (66, tail_call_cc, "tail-call/cc", 0, 1, 1)
|
|||
SCM_FRAME_MV_RETURN_ADDRESS (fp),
|
||||
0);
|
||||
cont = scm_i_make_continuation (&first, vm, vm_cont);
|
||||
DEAD (vm_cont);
|
||||
if (first)
|
||||
{
|
||||
PUSH (proc);
|
||||
DEAD (proc);
|
||||
PUSH (cont);
|
||||
DEAD (cont);
|
||||
nargs = 1;
|
||||
goto vm_tail_call;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEAD (proc);
|
||||
DEAD (cont);
|
||||
/* Otherwise, cache regs and NEXT, as above. Invoking the continuation
|
||||
does a return from the frame, either to the RA or
|
||||
MVRA. */
|
||||
|
@ -1333,8 +1274,6 @@ VM_DEFINE_INSTRUCTION (67, return, "return", 0, 1, 1)
|
|||
|
||||
/* Set return value (sp is already pushed) */
|
||||
*sp = ret;
|
||||
|
||||
DEAD (ret);
|
||||
}
|
||||
|
||||
/* Restore the last program */
|
||||
|
@ -1420,7 +1359,6 @@ VM_DEFINE_INSTRUCTION (69, return_values_star, "return/values*", 1, -1, -1)
|
|||
goto vm_error_improper_list;
|
||||
}
|
||||
|
||||
DEAD (l);
|
||||
goto vm_return_values;
|
||||
}
|
||||
|
||||
|
@ -1429,7 +1367,6 @@ VM_DEFINE_INSTRUCTION (70, return_nvalues, "return/nvalues", 0, 1, -1)
|
|||
SCM n;
|
||||
POP (n);
|
||||
nvalues = scm_to_int (n);
|
||||
DEAD (n);
|
||||
ASSERT (nvalues >= 0);
|
||||
goto vm_return_values;
|
||||
}
|
||||
|
@ -1440,7 +1377,6 @@ VM_DEFINE_INSTRUCTION (71, truncate_values, "truncate-values", 2, -1, -1)
|
|||
int nbinds, rest;
|
||||
POP (x);
|
||||
nvalues = scm_to_int (x);
|
||||
DEAD (x);
|
||||
nbinds = FETCH ();
|
||||
rest = FETCH ();
|
||||
|
||||
|
@ -1464,7 +1400,6 @@ VM_DEFINE_INSTRUCTION (72, box, "box", 1, 1, 0)
|
|||
POP (val);
|
||||
SYNC_BEFORE_GC ();
|
||||
LOCAL_SET (FETCH (), scm_cell (scm_tc7_variable, SCM_UNPACK (val)));
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1486,7 +1421,6 @@ VM_DEFINE_INSTRUCTION (74, local_boxed_ref, "local-boxed-ref", 1, 0, 1)
|
|||
SCM v = LOCAL_REF (FETCH ());
|
||||
ASSERT_BOUND_VARIABLE (v);
|
||||
PUSH (VARIABLE_REF (v));
|
||||
DEAD (v);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1497,8 +1431,6 @@ VM_DEFINE_INSTRUCTION (75, local_boxed_set, "local-boxed-set", 1, 1, 0)
|
|||
POP (val);
|
||||
ASSERT_VARIABLE (v);
|
||||
VARIABLE_SET (v, val);
|
||||
DEAD (v);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1521,7 +1453,6 @@ VM_DEFINE_INSTRUCTION (77, free_boxed_ref, "free-boxed-ref", 1, 0, 1)
|
|||
v = FREE_VARIABLE_REF (idx);
|
||||
ASSERT_BOUND_VARIABLE (v);
|
||||
PUSH (VARIABLE_REF (v));
|
||||
DEAD (v);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1534,8 +1465,6 @@ VM_DEFINE_INSTRUCTION (78, free_boxed_set, "free-boxed-set", 1, 1, 0)
|
|||
v = FREE_VARIABLE_REF (idx);
|
||||
ASSERT_BOUND_VARIABLE (v);
|
||||
VARIABLE_SET (v, val);
|
||||
DEAD (v);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1554,7 +1483,6 @@ VM_DEFINE_INSTRUCTION (79, make_closure, "make-closure", 2, -1, 1)
|
|||
sp[-len] = closure;
|
||||
for (n = 0; n < len; n++)
|
||||
SCM_PROGRAM_FREE_VARIABLE_SET (closure, n, sp[-len + 1 + n]);
|
||||
DEAD (closure);
|
||||
DROPN (len);
|
||||
NEXT;
|
||||
}
|
||||
|
@ -1580,7 +1508,6 @@ VM_DEFINE_INSTRUCTION (81, fix_closure, "fix-closure", 2, -1, 0)
|
|||
len = SCM_PROGRAM_NUM_FREE_VARIABLES (x);
|
||||
for (n = 0; n < len; n++)
|
||||
SCM_PROGRAM_FREE_VARIABLE_SET (x, n, sp[-len + 1 + n]);
|
||||
DEAD (x);
|
||||
DROPN (len);
|
||||
NEXT;
|
||||
}
|
||||
|
@ -1593,8 +1520,6 @@ VM_DEFINE_INSTRUCTION (82, define, "define", 0, 0, 2)
|
|||
VARIABLE_SET (scm_sym2var (sym, scm_current_module_lookup_closure (),
|
||||
SCM_BOOL_T),
|
||||
val);
|
||||
DEAD (sym);
|
||||
DEAD (val);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1638,8 +1563,6 @@ VM_DEFINE_INSTRUCTION (85, prompt, "prompt", 4, 2, 0)
|
|||
vm_engine that can be assigned *has* been assigned. So we need to pull
|
||||
all our state back from the ip/fp/sp.
|
||||
*/
|
||||
DEAD (k);
|
||||
DEAD (prompt);
|
||||
CACHE_REGISTER ();
|
||||
program = SCM_FRAME_PROGRAM (fp);
|
||||
CACHE_PROGRAM ();
|
||||
|
@ -1649,9 +1572,6 @@ VM_DEFINE_INSTRUCTION (85, prompt, "prompt", 4, 2, 0)
|
|||
NEXT;
|
||||
}
|
||||
|
||||
DEAD (k);
|
||||
DEAD (prompt);
|
||||
|
||||
/* Otherwise setjmp returned for the first time, so we go to execute the
|
||||
prompt's body. */
|
||||
NEXT;
|
||||
|
@ -1676,8 +1596,6 @@ VM_DEFINE_INSTRUCTION (86, wind, "wind", 0, 2, 0)
|
|||
goto vm_error_not_a_thunk;
|
||||
}
|
||||
scm_i_set_dynwinds (scm_cons (scm_cons (wind, unwind), scm_i_dynwinds ()));
|
||||
DEAD (wind);
|
||||
DEAD (unwind);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1713,7 +1631,6 @@ VM_DEFINE_INSTRUCTION (89, wind_fluids, "wind-fluids", 1, -1, 0)
|
|||
|
||||
scm_i_swap_with_fluids (wf, current_thread->dynamic_state);
|
||||
scm_i_set_dynwinds (scm_cons (wf, scm_i_dynwinds ()));
|
||||
DEAD (wf);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1723,7 +1640,6 @@ VM_DEFINE_INSTRUCTION (90, unwind_fluids, "unwind-fluids", 0, 0, 0)
|
|||
wf = scm_car (scm_i_dynwinds ());
|
||||
scm_i_set_dynwinds (scm_cdr (scm_i_dynwinds ()));
|
||||
scm_i_swap_with_fluids (wf, current_thread->dynamic_state);
|
||||
DEAD (wf);
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
@ -1738,14 +1654,12 @@ VM_DEFINE_INSTRUCTION (91, fluid_ref, "fluid-ref", 0, 1, 1)
|
|||
|| ((num = SCM_I_FLUID_NUM (*sp)) >= SCM_SIMPLE_VECTOR_LENGTH (fluids)))
|
||||
{
|
||||
/* Punt dynstate expansion and error handling to the C proc. */
|
||||
DEAD (fluids);
|
||||
SYNC_REGISTER ();
|
||||
*sp = scm_fluid_ref (*sp);
|
||||
}
|
||||
else
|
||||
{
|
||||
SCM val = SCM_SIMPLE_VECTOR_REF (fluids, num);
|
||||
DEAD (fluids);
|
||||
if (scm_is_eq (val, SCM_UNDEFINED))
|
||||
val = SCM_I_FLUID_DEFAULT (*sp);
|
||||
if (SCM_UNLIKELY (scm_is_eq (val, SCM_UNDEFINED)))
|
||||
|
@ -1775,9 +1689,7 @@ VM_DEFINE_INSTRUCTION (92, fluid_set, "fluid-set", 0, 2, 0)
|
|||
}
|
||||
else
|
||||
SCM_SIMPLE_VECTOR_SET (fluids, num, val);
|
||||
DEAD (fluids);
|
||||
DEAD (fluid);
|
||||
DEAD (val);
|
||||
|
||||
NEXT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue