mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
build fixes for global symbols and vm profiling
This commit is contained in:
parent
d4cd223d7e
commit
c063dadd2e
4 changed files with 7 additions and 7 deletions
5
eval.c
5
eval.c
|
@ -1629,11 +1629,6 @@ sexp sexp_make_setter_op (sexp ctx, sexp self, sexp_sint_t n, sexp name, sexp ty
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SEXP_USE_PROFILE_VM
|
|
||||||
static sexp sexp_reset_vm_profile (sexp ctx, sexp self, sexp_sint_t n);
|
|
||||||
static sexp sexp_print_vm_profile (sexp ctx, sexp self, sexp_sint_t n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static sexp sexp_copy_core (sexp ctx, struct sexp_core_form_struct *core) {
|
static sexp sexp_copy_core (sexp ctx, struct sexp_core_form_struct *core) {
|
||||||
sexp res = sexp_alloc_type(ctx, core, SEXP_CORE);
|
sexp res = sexp_alloc_type(ctx, core, SEXP_CORE);
|
||||||
memcpy(&(res->value), core, sizeof(core[0]));
|
memcpy(&(res->value), core, sizeof(core[0]));
|
||||||
|
|
|
@ -140,6 +140,10 @@ SEXP_API sexp sexp_ratio_denominator_op (sexp ctx, sexp self, sexp_sint_t n, sex
|
||||||
SEXP_API sexp sexp_complex_real_op (sexp ctx, sexp self, sexp_sint_t n, sexp rat);
|
SEXP_API sexp sexp_complex_real_op (sexp ctx, sexp self, sexp_sint_t n, sexp rat);
|
||||||
SEXP_API sexp sexp_complex_imag_op (sexp ctx, sexp self, sexp_sint_t n, sexp rat);
|
SEXP_API sexp sexp_complex_imag_op (sexp ctx, sexp self, sexp_sint_t n, sexp rat);
|
||||||
#endif
|
#endif
|
||||||
|
#if SEXP_USE_PROFILE_VM
|
||||||
|
SEXP_API sexp sexp_reset_vm_profile (sexp ctx, sexp self, sexp_sint_t n);
|
||||||
|
SEXP_API sexp sexp_print_vm_profile (sexp ctx, sexp self, sexp_sint_t n);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SEXP_USE_MATH
|
#if SEXP_USE_MATH
|
||||||
SEXP_API sexp sexp_exp(sexp ctx, sexp self, sexp_sint_t n, sexp z);
|
SEXP_API sexp sexp_exp(sexp ctx, sexp self, sexp_sint_t n, sexp z);
|
||||||
|
|
|
@ -1060,6 +1060,7 @@ SEXP_API sexp_heap sexp_global_heap;
|
||||||
|
|
||||||
#if SEXP_USE_GLOBAL_SYMBOLS
|
#if SEXP_USE_GLOBAL_SYMBOLS
|
||||||
#define sexp_context_symbols(ctx) sexp_symbol_table
|
#define sexp_context_symbols(ctx) sexp_symbol_table
|
||||||
|
SEXP_API sexp sexp_symbol_table[SEXP_SYMBOL_TABLE_SIZE];
|
||||||
#else
|
#else
|
||||||
#define sexp_context_symbols(ctx) sexp_vector_data(sexp_global(ctx, SEXP_G_SYMBOLS))
|
#define sexp_context_symbols(ctx) sexp_vector_data(sexp_global(ctx, SEXP_G_SYMBOLS))
|
||||||
#endif
|
#endif
|
||||||
|
|
4
vm.c
4
vm.c
|
@ -855,7 +855,7 @@ static int sexp_check_type(sexp ctx, sexp a, sexp b) {
|
||||||
sexp_uint_t profile1[SEXP_OP_NUM_OPCODES];
|
sexp_uint_t profile1[SEXP_OP_NUM_OPCODES];
|
||||||
sexp_uint_t profile2[SEXP_OP_NUM_OPCODES][SEXP_OP_NUM_OPCODES];
|
sexp_uint_t profile2[SEXP_OP_NUM_OPCODES][SEXP_OP_NUM_OPCODES];
|
||||||
|
|
||||||
static sexp sexp_reset_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
sexp sexp_reset_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i=0; i<SEXP_OP_NUM_OPCODES; i++) {
|
for (i=0; i<SEXP_OP_NUM_OPCODES; i++) {
|
||||||
profile1[i] = 0;
|
profile1[i] = 0;
|
||||||
|
@ -864,7 +864,7 @@ static sexp sexp_reset_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
||||||
return SEXP_VOID;
|
return SEXP_VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
static sexp sexp_print_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
sexp sexp_print_vm_profile (sexp ctx, sexp self, sexp_sint_t n) {
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i=0; i<SEXP_OP_NUM_OPCODES; i++)
|
for (i=0; i<SEXP_OP_NUM_OPCODES; i++)
|
||||||
fprintf(stderr, "%s %lu\n", sexp_opcode_names[i], profile1[i]);
|
fprintf(stderr, "%s %lu\n", sexp_opcode_names[i], profile1[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue