From 68b32482437e05f0994c4dd0ab5b0c27d39f0f6d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Aug 2012 12:56:38 -0600 Subject: This introduces a thread-state object and moves various C globals there. It also introduces #defines for these globals to avoid a monster patch. The #defines mean that this patch also has to rename a few fields whose names clash with the defines. There is currently just a single "thread"; so this patch does not impact Emacs behavior in any significant way. --- src/bytecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bytecode.c') diff --git a/src/bytecode.c b/src/bytecode.c index 5ac8b4fa2bd..019459491e9 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -328,7 +328,7 @@ struct byte_stack done. Signaling an error truncates the list analogous to gcprolist. */ -struct byte_stack *byte_stack_list; +/* struct byte_stack *byte_stack_list; */ /* Mark objects on byte_stack_list. Called during GC. */ -- cgit v1.2.1 From 2d525b793f1b0fd2b6f66881310bec8684bceffe Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Aug 2012 13:01:36 -0600 Subject: This parameterizes the GC a bit to make it thread-ready. The basic idea is that whenever a thread "exits lisp" -- that is, releases the global lock in favor of another thread -- it must save its stack boundaries in the thread object. This way the boundaries are always available for marking. This is the purpose of flush_stack_call_func. I haven't tested this under all the possible GC configurations. There is a new FIXME in a spot that i didn't convert. Arguably all_threads should go in the previous patch. --- src/bytecode.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/bytecode.c') diff --git a/src/bytecode.c b/src/bytecode.c index 019459491e9..d61e37d7886 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -335,12 +335,11 @@ struct byte_stack #if BYTE_MARK_STACK void -mark_byte_stack (void) +mark_byte_stack (struct byte_stack *stack) { - struct byte_stack *stack; Lisp_Object *obj; - for (stack = byte_stack_list; stack; stack = stack->next) + for (; stack; stack = stack->next) { /* If STACK->top is null here, this means there's an opcode in Fbyte_code that wasn't expected to GC, but did. To find out @@ -364,11 +363,9 @@ mark_byte_stack (void) counters. Called when GC has completed. */ void -unmark_byte_stack (void) +unmark_byte_stack (struct byte_stack *stack) { - struct byte_stack *stack; - - for (stack = byte_stack_list; stack; stack = stack->next) + for (; stack; stack = stack->next) { if (stack->byte_string_start != SDATA (stack->byte_string)) { -- cgit v1.2.1 From 66a5abb102ec1d6e4c327632ef235d1eb6433291 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 5 Dec 2016 22:50:44 +0200 Subject: Fix compilation problems. --- src/bytecode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bytecode.c') diff --git a/src/bytecode.c b/src/bytecode.c index 3ac94055f33..7d5f85de140 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -891,7 +891,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, if (sys_setjmp (c->jmp)) { struct handler *c = handlerlist; - int desc; + int dest; top = c->bytecode_top; dest = c->bytecode_dest; handlerlist = c->next; -- cgit v1.2.1 From 137898d89359c63ec05d7bb5eedc2d2f59102a11 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 6 Dec 2016 20:11:47 +0200 Subject: Fix a typo in bytecode.c. --- src/bytecode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/bytecode.c') diff --git a/src/bytecode.c b/src/bytecode.c index 7d5f85de140..6439268a9ab 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -656,7 +656,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, if (SYMBOLP (sym) && !EQ (val, Qunbound) && !XSYMBOL (sym)->redirect - && !SYMBOL_TRAPPED_WRITE_P (sym)) + && !SYMBOL_TRAPPED_WRITE_P (sym)) SET_SYMBOL_VAL (XSYMBOL (sym), val); else set_internal (sym, val, Qnil, SET_INTERNAL_SET); @@ -754,7 +754,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CASE (Bgoto): BYTE_CODE_QUIT; - op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */ + op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */ CHECK_RANGE (op); stack.pc = stack.byte_string_start + op; NEXT; @@ -778,6 +778,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, CHECK_RANGE (op); stack.pc = stack.byte_string_start + op; } + else DISCARD (1); NEXT; CASE (Bgotoifnonnilelsepop): -- cgit v1.2.1