aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorStefan Monnier2024-03-24 18:32:25 -0400
committerStefan Monnier2024-04-28 11:58:05 -0400
commit2fa839c1886acd4a7b6c25c50877534fe1d669bb (patch)
tree9db25d761b2de896a902ccae32dc02c7a9dc56f4 /src/alloc.c
parent1e931f1c3db1588ba402d0eab60f03cc036f814a (diff)
downloademacs-2fa839c1886acd4a7b6c25c50877534fe1d669bb.tar.gz
emacs-2fa839c1886acd4a7b6c25c50877534fe1d669bb.zip
(COMPILED): Rename to CLOSURE
In preparation for the use of `PVEC_COMPILED` objects for interpreted functions, rename them to use a more neutral name. * src/lisp.h (enum pvec_type): Rename `PVEC_COMPILED` to `PVEC_CLOSURE`. (enum Lisp_Compiled): Use `CLOSURE_` prefix i.s.o `COMPILED_`. Also use `CODE` rather than `BYTECODE`. (CLOSUREP): Rename from `COMPILEDP`. (enum Lisp_Closure): Rename from `Lisp_Compiled`. * src/alloc.c, src/bytecode.c, src/comp.c, src/data.c, src/eval.c, * src/fns.c, src/lisp.h, src/lread.c, src/pdumper.c, src/print.c, * src/profiler.c: Rename all uses accordingly. * src/.gdbinit (xclosure): Rename from `xcompiled`. (xcompiled): New obsolete alias. (xpr): Adjust accordingly. Also adjust to new PVEC_CLOSURE tag name.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 6779d0ca9ce..a8dfde56739 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3481,7 +3481,7 @@ cleanup_vector (struct Lisp_Vector *vector)
3481 case PVEC_XWIDGET_VIEW: 3481 case PVEC_XWIDGET_VIEW:
3482 case PVEC_TS_NODE: 3482 case PVEC_TS_NODE:
3483 case PVEC_SQLITE: 3483 case PVEC_SQLITE:
3484 case PVEC_COMPILED: 3484 case PVEC_CLOSURE:
3485 case PVEC_CHAR_TABLE: 3485 case PVEC_CHAR_TABLE:
3486 case PVEC_SUB_CHAR_TABLE: 3486 case PVEC_SUB_CHAR_TABLE:
3487 case PVEC_RECORD: 3487 case PVEC_RECORD:
@@ -3813,17 +3813,17 @@ stack before executing the byte-code.
3813usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) 3813usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
3814 (ptrdiff_t nargs, Lisp_Object *args) 3814 (ptrdiff_t nargs, Lisp_Object *args)
3815{ 3815{
3816 if (! ((FIXNUMP (args[COMPILED_ARGLIST]) 3816 if (! ((FIXNUMP (args[CLOSURE_ARGLIST])
3817 || CONSP (args[COMPILED_ARGLIST]) 3817 || CONSP (args[CLOSURE_ARGLIST])
3818 || NILP (args[COMPILED_ARGLIST])) 3818 || NILP (args[CLOSURE_ARGLIST]))
3819 && STRINGP (args[COMPILED_BYTECODE]) 3819 && STRINGP (args[CLOSURE_CODE])
3820 && !STRING_MULTIBYTE (args[COMPILED_BYTECODE]) 3820 && !STRING_MULTIBYTE (args[CLOSURE_CODE])
3821 && VECTORP (args[COMPILED_CONSTANTS]) 3821 && VECTORP (args[CLOSURE_CONSTANTS])
3822 && FIXNATP (args[COMPILED_STACK_DEPTH]))) 3822 && FIXNATP (args[CLOSURE_STACK_DEPTH])))
3823 error ("Invalid byte-code object"); 3823 error ("Invalid byte-code object");
3824 3824
3825 /* Bytecode must be immovable. */ 3825 /* Bytecode must be immovable. */
3826 pin_string (args[COMPILED_BYTECODE]); 3826 pin_string (args[CLOSURE_CODE]);
3827 3827
3828 /* We used to purecopy everything here, if purify-flag was set. This worked 3828 /* We used to purecopy everything here, if purify-flag was set. This worked
3829 OK for Emacs-23, but with Emacs-24's lexical binding code, it can be 3829 OK for Emacs-23, but with Emacs-24's lexical binding code, it can be
@@ -3833,7 +3833,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
3833 just wasteful and other times plainly wrong (e.g. those free vars may want 3833 just wasteful and other times plainly wrong (e.g. those free vars may want
3834 to be setcar'd). */ 3834 to be setcar'd). */
3835 Lisp_Object val = Fvector (nargs, args); 3835 Lisp_Object val = Fvector (nargs, args);
3836 XSETPVECTYPE (XVECTOR (val), PVEC_COMPILED); 3836 XSETPVECTYPE (XVECTOR (val), PVEC_CLOSURE);
3837 return val; 3837 return val;
3838} 3838}
3839 3839
@@ -3845,12 +3845,12 @@ usage: (make-closure PROTOTYPE &rest CLOSURE-VARS) */)
3845 (ptrdiff_t nargs, Lisp_Object *args) 3845 (ptrdiff_t nargs, Lisp_Object *args)
3846{ 3846{
3847 Lisp_Object protofun = args[0]; 3847 Lisp_Object protofun = args[0];
3848 CHECK_TYPE (COMPILEDP (protofun), Qbyte_code_function_p, protofun); 3848 CHECK_TYPE (CLOSUREP (protofun), Qbyte_code_function_p, protofun);
3849 3849
3850 /* Create a copy of the constant vector, filling it with the closure 3850 /* Create a copy of the constant vector, filling it with the closure
3851 variables in the beginning. (The overwritten part should just 3851 variables in the beginning. (The overwritten part should just
3852 contain placeholder values.) */ 3852 contain placeholder values.) */
3853 Lisp_Object proto_constvec = AREF (protofun, COMPILED_CONSTANTS); 3853 Lisp_Object proto_constvec = AREF (protofun, CLOSURE_CONSTANTS);
3854 ptrdiff_t constsize = ASIZE (proto_constvec); 3854 ptrdiff_t constsize = ASIZE (proto_constvec);
3855 ptrdiff_t nvars = nargs - 1; 3855 ptrdiff_t nvars = nargs - 1;
3856 if (nvars > constsize) 3856 if (nvars > constsize)
@@ -3866,7 +3866,7 @@ usage: (make-closure PROTOTYPE &rest CLOSURE-VARS) */)
3866 struct Lisp_Vector *v = allocate_vectorlike (protosize, false); 3866 struct Lisp_Vector *v = allocate_vectorlike (protosize, false);
3867 v->header = XVECTOR (protofun)->header; 3867 v->header = XVECTOR (protofun)->header;
3868 memcpy (v->contents, XVECTOR (protofun)->contents, protosize * word_size); 3868 memcpy (v->contents, XVECTOR (protofun)->contents, protosize * word_size);
3869 v->contents[COMPILED_CONSTANTS] = constvec; 3869 v->contents[CLOSURE_CONSTANTS] = constvec;
3870 return make_lisp_ptr (v, Lisp_Vectorlike); 3870 return make_lisp_ptr (v, Lisp_Vectorlike);
3871} 3871}
3872 3872
@@ -6046,7 +6046,7 @@ purecopy (Lisp_Object obj)
6046 6046
6047 obj = make_lisp_hash_table (purecopy_hash_table (table)); 6047 obj = make_lisp_hash_table (purecopy_hash_table (table));
6048 } 6048 }
6049 else if (COMPILEDP (obj) || VECTORP (obj) || RECORDP (obj)) 6049 else if (CLOSUREP (obj) || VECTORP (obj) || RECORDP (obj))
6050 { 6050 {
6051 struct Lisp_Vector *objp = XVECTOR (obj); 6051 struct Lisp_Vector *objp = XVECTOR (obj);
6052 ptrdiff_t nbytes = vector_nbytes (objp); 6052 ptrdiff_t nbytes = vector_nbytes (objp);
@@ -6059,7 +6059,7 @@ purecopy (Lisp_Object obj)
6059 for (i = 0; i < size; i++) 6059 for (i = 0; i < size; i++)
6060 vec->contents[i] = purecopy (vec->contents[i]); 6060 vec->contents[i] = purecopy (vec->contents[i]);
6061 /* Byte code strings must be pinned. */ 6061 /* Byte code strings must be pinned. */
6062 if (COMPILEDP (obj) && size >= 2 && STRINGP (vec->contents[1]) 6062 if (CLOSUREP (obj) && size >= 2 && STRINGP (vec->contents[1])
6063 && !STRING_MULTIBYTE (vec->contents[1])) 6063 && !STRING_MULTIBYTE (vec->contents[1]))
6064 pin_string (vec->contents[1]); 6064 pin_string (vec->contents[1]);
6065 XSETVECTOR (obj, vec); 6065 XSETVECTOR (obj, vec);
@@ -8014,11 +8014,11 @@ symbol_uses_obj (Lisp_Object symbol, Lisp_Object obj)
8014 return (EQ (val, obj) 8014 return (EQ (val, obj)
8015 || EQ (sym->u.s.function, obj) 8015 || EQ (sym->u.s.function, obj)
8016 || (!NILP (sym->u.s.function) 8016 || (!NILP (sym->u.s.function)
8017 && COMPILEDP (sym->u.s.function) 8017 && CLOSUREP (sym->u.s.function)
8018 && EQ (AREF (sym->u.s.function, COMPILED_BYTECODE), obj)) 8018 && EQ (AREF (sym->u.s.function, CLOSURE_CODE), obj))
8019 || (!NILP (val) 8019 || (!NILP (val)
8020 && COMPILEDP (val) 8020 && CLOSUREP (val)
8021 && EQ (AREF (val, COMPILED_BYTECODE), obj))); 8021 && EQ (AREF (val, CLOSURE_CODE), obj)));
8022} 8022}
8023 8023
8024/* Find at most FIND_MAX symbols which have OBJ as their value or 8024/* Find at most FIND_MAX symbols which have OBJ as their value or
@@ -8343,7 +8343,7 @@ union
8343 enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; 8343 enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
8344 enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; 8344 enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE;
8345 enum Lisp_Bits Lisp_Bits; 8345 enum Lisp_Bits Lisp_Bits;
8346 enum Lisp_Compiled Lisp_Compiled; 8346 enum Lisp_Closure Lisp_Closure;
8347 enum maxargs maxargs; 8347 enum maxargs maxargs;
8348 enum MAX_ALLOCA MAX_ALLOCA; 8348 enum MAX_ALLOCA MAX_ALLOCA;
8349 enum More_Lisp_Bits More_Lisp_Bits; 8349 enum More_Lisp_Bits More_Lisp_Bits;