mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
minor vm-engine cleanups
* libguile/vm-engine.c: Some very minor cleanups: indenting, use of VM_ASSERT, commenting.
This commit is contained in:
parent
52182d5280
commit
27c7c630a1
1 changed files with 18 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -33,11 +33,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Registers
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Register optimization. [ stolen from librep/src/lispmach.h,v 1.3 ]
|
/* Register optimization. [ stolen from librep/src/lispmach.h,v 1.3 ]
|
||||||
|
|
||||||
Some compilers underestimate the use of the local variables representing
|
Some compilers underestimate the use of the local variables representing
|
||||||
|
@ -113,13 +108,14 @@
|
||||||
#define JT_REG
|
#define JT_REG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VM_ASSERT(condition, handler) \
|
||||||
/*
|
do { \
|
||||||
* Cache/Sync
|
if (SCM_UNLIKELY (!(condition))) \
|
||||||
*/
|
{ \
|
||||||
|
SYNC_ALL(); \
|
||||||
#define VM_ASSERT(condition, handler) \
|
handler; \
|
||||||
do { if (SCM_UNLIKELY (!(condition))) { SYNC_ALL(); handler; } } while (0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#ifdef VM_ENABLE_ASSERTIONS
|
#ifdef VM_ENABLE_ASSERTIONS
|
||||||
# define ASSERT(condition) VM_ASSERT (condition, abort())
|
# define ASSERT(condition) VM_ASSERT (condition, abort())
|
||||||
|
@ -148,13 +144,11 @@
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
#define ASSERT_VARIABLE(x) \
|
#define ASSERT_VARIABLE(x) \
|
||||||
do { if (!SCM_VARIABLEP (x)) { SYNC_REGISTER (); abort(); } \
|
VM_ASSERT (SCM_VARIABLEP (x), abort())
|
||||||
} while (0)
|
|
||||||
#define ASSERT_BOUND_VARIABLE(x) \
|
#define ASSERT_BOUND_VARIABLE(x) \
|
||||||
do { ASSERT_VARIABLE (x); \
|
VM_ASSERT (SCM_VARIABLEP (x) \
|
||||||
if (scm_is_eq (SCM_VARIABLE_REF (x), SCM_UNDEFINED)) \
|
&& !scm_is_eq (SCM_VARIABLE_REF (x), SCM_UNDEFINED), \
|
||||||
{ SYNC_REGISTER (); abort(); } \
|
abort())
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#ifdef VM_ENABLE_PARANOID_ASSERTIONS
|
#ifdef VM_ENABLE_PARANOID_ASSERTIONS
|
||||||
#define CHECK_IP() \
|
#define CHECK_IP() \
|
||||||
|
@ -162,8 +156,7 @@
|
||||||
#define ASSERT_ALIGNED_PROCEDURE() \
|
#define ASSERT_ALIGNED_PROCEDURE() \
|
||||||
do { if ((scm_t_bits)bp % 8) abort (); } while (0)
|
do { if ((scm_t_bits)bp % 8) abort (); } while (0)
|
||||||
#define ASSERT_BOUND(x) \
|
#define ASSERT_BOUND(x) \
|
||||||
do { if (scm_is_eq ((x), SCM_UNDEFINED)) { SYNC_REGISTER (); abort(); } \
|
VM_ASSERT (!scm_is_eq ((x), SCM_UNDEFINED), abort())
|
||||||
} while (0)
|
|
||||||
#else
|
#else
|
||||||
#define CHECK_IP()
|
#define CHECK_IP()
|
||||||
#define ASSERT_ALIGNED_PROCEDURE()
|
#define ASSERT_ALIGNED_PROCEDURE()
|
||||||
|
@ -228,8 +221,6 @@
|
||||||
* Hooks
|
* Hooks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef RUN_HOOK
|
|
||||||
#undef RUN_HOOK1
|
|
||||||
#if VM_USE_HOOKS
|
#if VM_USE_HOOKS
|
||||||
#define RUN_HOOK(h) \
|
#define RUN_HOOK(h) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -350,9 +341,9 @@ do \
|
||||||
|
|
||||||
#undef NEXT_JUMP
|
#undef NEXT_JUMP
|
||||||
#ifdef HAVE_LABELS_AS_VALUES
|
#ifdef HAVE_LABELS_AS_VALUES
|
||||||
#define NEXT_JUMP() goto *jump_table[FETCH () & SCM_VM_INSTRUCTION_MASK]
|
# define NEXT_JUMP() goto *jump_table[FETCH () & SCM_VM_INSTRUCTION_MASK]
|
||||||
#else
|
#else
|
||||||
#define NEXT_JUMP() goto vm_start
|
# define NEXT_JUMP() goto vm_start
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NEXT \
|
#define NEXT \
|
||||||
|
@ -524,6 +515,8 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
|
||||||
abort (); /* never reached */
|
abort (); /* never reached */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef RUN_HOOK
|
||||||
|
#undef RUN_HOOK1
|
||||||
#undef VM_USE_HOOKS
|
#undef VM_USE_HOOKS
|
||||||
#undef VM_CHECK_OBJECT
|
#undef VM_CHECK_OBJECT
|
||||||
#undef VM_CHECK_FREE_VARIABLE
|
#undef VM_CHECK_FREE_VARIABLE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue