[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/comp-static-data 87a249440f 1/2: src/comp.c: Use `long' rvalues
From: |
Vibhav Pant |
Subject: |
scratch/comp-static-data 87a249440f 1/2: src/comp.c: Use `long' rvalues for storing values with GC bits. |
Date: |
Sat, 19 Nov 2022 11:44:03 -0500 (EST) |
branch: scratch/comp-static-data
commit 87a249440fef5253f55c16e8e3dc1ceedac16e30
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>
src/comp.c: Use `long' rvalues for storing values with GC bits.
* src/comp.c (emit_lisp_string_constructor_rval,
float_block_emit_constructor, emit_comp_lisp_obj): Use
`gcc_jit_context_new_rvalue_from_long' to ensure that GC bits are
correctly encoded in any ptrdiff_t rvalue.
---
src/comp.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/comp.c b/src/comp.c
index 89e16b1c4b..b5668d1a4e 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -2184,12 +2184,12 @@ emit_lisp_string_constructor_rval (Lisp_Object str)
gcc_jit_global_set_initializer (str_data, SDATA (str), str_size);
gcc_jit_rvalue *size_bytes
= STRING_MULTIBYTE (str)
- ? gcc_jit_context_new_rvalue_from_int (comp.ctxt,
+ ? gcc_jit_context_new_rvalue_from_long (comp.ctxt,
comp.ptrdiff_type,
SBYTES (str))
// Mark unibyte strings as immovable, so that pin_string does
// not attempt to modify them.
- : gcc_jit_context_new_rvalue_from_int (comp.ctxt,
+ : gcc_jit_context_new_rvalue_from_long (comp.ctxt,
comp.ptrdiff_type, -3);
// Perma-mark all string constants, which lets us declare them as
// constants.
@@ -2690,8 +2690,8 @@ float_block_emit_constructor (Lisp_Object block)
SAFE_NALLOCA (gcmarkbits, 1, float_block_gcmarkbits_length);
for (ptrdiff_t i = 0; i < float_block_gcmarkbits_length; i++)
gcmarkbits[i]
- = gcc_jit_context_new_rvalue_from_int (comp.ctxt,
- comp.ptrdiff_type, ~0u);
+ = gcc_jit_context_new_rvalue_from_long (comp.ctxt,
+ comp.ptrdiff_type, ~0u);
gcc_jit_field *fields[] = {
comp.float_block_floats,
@@ -3069,8 +3069,10 @@ emit_comp_lisp_obj (Lisp_Object obj,
}
}
+ /* Perma-mark static vectors, so that they can be declared
+ * as consts. */
gcc_jit_rvalue *struct_values[] = {
- gcc_jit_context_new_rvalue_from_int (comp.ctxt,
+ gcc_jit_context_new_rvalue_from_long (comp.ctxt,
comp.ptrdiff_type,
ASIZE (obj)
| ARRAY_MARK_FLAG),