comparison src/data.c @ 105885:8103235103a7

Let integers use up 2 tags to give them one extra bit and double their range. * lisp.h (USE_2_TAGS_FOR_INTS): New macro. (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P): New macros. (enum Lisp_Type): Use them. Give explicit values. (Lisp_Type_Limit): Remove. (XINT, XUINT, make_number) [!USE_LISP_UNION_TYPE]: (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK): Pay attention to USE_2_TAGS_FOR_INTS. (INTEGERP): Use LISP_INT_TAG_P. * fns.c (internal_equal): Simplify the default case. (sxhash): Use case_Lisp_Int. * data.c (wrong_type_argument): Don't check against Lisp_Type_Limit any more. (Ftype_of): Use case_Lisp_Int. (store_symval_forwarding): Take into account the fact that Ints can now have more than one tag. * buffer.c (syms_of_buffer): Use LISP_INT_TAG. buffer_slot_type_mismatch): * xfaces.c (face_attr_equal_p): * print.c (print_object): * alloc.c (mark_maybe_object, mark_object, survives_gc_p): Use case_Lisp_Int.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 06 Nov 2009 18:47:48 +0000
parents 21bdda3ded62
children f2cea199b0c4
comparison
equal deleted inserted replaced
105884:3c37f8b33131 105885:8103235103a7
106 106
107 Lisp_Object 107 Lisp_Object
108 wrong_type_argument (predicate, value) 108 wrong_type_argument (predicate, value)
109 register Lisp_Object predicate, value; 109 register Lisp_Object predicate, value;
110 { 110 {
111 /* If VALUE is not even a valid Lisp object, abort here 111 /* If VALUE is not even a valid Lisp object, we'd want to abort here
112 where we can get a backtrace showing where it came from. */ 112 where we can get a backtrace showing where it came from. We used
113 if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit) 113 to try and do that by checking the tagbits, but nowadays all
114 abort (); 114 tagbits are potentially valid. */
115 /* if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit)
116 * abort (); */
115 117
116 xsignal2 (Qwrong_type_argument, predicate, value); 118 xsignal2 (Qwrong_type_argument, predicate, value);
117 } 119 }
118 120
119 void 121 void
182 (object) 184 (object)
183 Lisp_Object object; 185 Lisp_Object object;
184 { 186 {
185 switch (XTYPE (object)) 187 switch (XTYPE (object))
186 { 188 {
187 case Lisp_Int: 189 case_Lisp_Int:
188 return Qinteger; 190 return Qinteger;
189 191
190 case Lisp_Symbol: 192 case Lisp_Symbol:
191 return Qsymbol; 193 return Qsymbol;
192 194
973 case Lisp_Misc_Buffer_Objfwd: 975 case Lisp_Misc_Buffer_Objfwd:
974 { 976 {
975 int offset = XBUFFER_OBJFWD (valcontents)->offset; 977 int offset = XBUFFER_OBJFWD (valcontents)->offset;
976 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; 978 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
977 979
978 if (! NILP (type) && ! NILP (newval) 980 if (!(NILP (type) || NILP (newval)
979 && XTYPE (newval) != XINT (type)) 981 || (XINT (type) == LISP_INT_TAG
982 ? INTEGERP (newval)
983 : XTYPE (newval) == XINT (type))))
980 buffer_slot_type_mismatch (newval, XINT (type)); 984 buffer_slot_type_mismatch (newval, XINT (type));
981 985
982 if (buf == NULL) 986 if (buf == NULL)
983 buf = current_buffer; 987 buf = current_buffer;
984 PER_BUFFER_VALUE (buf, offset) = newval; 988 PER_BUFFER_VALUE (buf, offset) = newval;