From: Chris Hanson Date: Thu, 5 Jan 2017 19:07:34 +0000 (-0800) Subject: Split TC_BYTEVECTOR from TC_CHARACTER_STRING to simplify transition. X-Git-Tag: mit-scheme-pucked-9.2.12~227^2~231 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=622bbdf2779cb573216740c89c1ec8a9ed5029c9;p=mit-scheme.git Split TC_BYTEVECTOR from TC_CHARACTER_STRING to simplify transition. --- diff --git a/src/microcode/const.h b/src/microcode/const.h index 50851ce5e..a4aa5a4b9 100644 --- a/src/microcode/const.h +++ b/src/microcode/const.h @@ -101,7 +101,7 @@ USA. #define Are_The_Constants_Incompatible \ ((TC_FALSE != 0x00) || (TC_CONSTANT != 0x08) || \ (TC_FIXNUM != 0x1A) || (TC_BROKEN_HEART != 0x22) || \ - (TC_BYTEVECTOR != 0x1E)) + (TC_CHARACTER_STRING != 0x1E)) /* The values used above are in sdata.h and types.h, check for consistency if the check below fails. */ diff --git a/src/microcode/debug.c b/src/microcode/debug.c index ea3450495..00b070ab7 100644 --- a/src/microcode/debug.c +++ b/src/microcode/debug.c @@ -379,7 +379,7 @@ do_printing (outf_channel stream, SCHEME_OBJECT Expr, bool Detailed) Expr = (MEMORY_REF ((MEMORY_REF (Expr, ASSIGN_NAME)), VARIABLE_SYMBOL)); goto SPrint; - case TC_BYTEVECTOR: + case TC_CHARACTER_STRING: print_string (stream, Expr); return; diff --git a/src/microcode/gcloop.c b/src/microcode/gcloop.c index 49b91b7a8..42a859ed9 100644 --- a/src/microcode/gcloop.c +++ b/src/microcode/gcloop.c @@ -1281,7 +1281,7 @@ gc_type_t gc_type_map [N_TYPE_CODES] = GC_UNDEFINED, /* was TC_PCOMB1 */ GC_VECTOR, /* TC_CONTROL_POINT */ GC_PAIR, /* TC_INTERNED_SYMBOL */ - GC_VECTOR, /* TC_BYTEVECTOR */ + GC_VECTOR, /* TC_CHARACTER_STRING */ GC_PAIR, /* TC_ACCESS */ GC_TRIPLE, /* TC_HUNK3_A */ GC_PAIR, /* TC_DEFINITION */ @@ -1302,7 +1302,7 @@ gc_type_t gc_type_map [N_TYPE_CODES] = GC_UNDEFINED, /* was TC_PCOMB0 */ GC_VECTOR, /* TC_VECTOR_16B */ GC_SPECIAL, /* TC_REFERENCE_TRAP */ - GC_UNDEFINED, /* 0x33 */ + GC_VECTOR, /* TC_BYTEVECTOR */ GC_TRIPLE, /* TC_CONDITIONAL */ GC_PAIR, /* TC_DISJUNCTION */ GC_CELL, /* TC_CELL */ diff --git a/src/microcode/interp.c b/src/microcode/interp.c index 97ab49037..33f09dd50 100644 --- a/src/microcode/interp.c +++ b/src/microcode/interp.c @@ -408,6 +408,7 @@ Interpret (int pop_return_p) case TC_BIG_FIXNUM: /* The self evaluating items */ case TC_BIG_FLONUM: case TC_BYTEVECTOR: + case TC_CHARACTER_STRING: case TC_CHARACTER: case TC_COMPILED_CODE_BLOCK: case TC_COMPLEX: diff --git a/src/microcode/object.h b/src/microcode/object.h index 368d2c263..5c0c22a10 100644 --- a/src/microcode/object.h +++ b/src/microcode/object.h @@ -176,6 +176,7 @@ extern SCHEME_OBJECT * memory_base; #define COMPLEX_P(object) ((OBJECT_TYPE (object)) == TC_COMPLEX) #define CHARACTER_P(object) ((OBJECT_TYPE (object)) == TC_CHARACTER) #define BYTEVECTOR_P(object) ((OBJECT_TYPE (object)) == TC_BYTEVECTOR) +#define STRING_P(object) ((OBJECT_TYPE (object)) == TC_CHARACTER_STRING) #define BIT_STRING_P(object) ((OBJECT_TYPE (object)) == TC_BIT_STRING) #define CELL_P(object) ((OBJECT_TYPE (object)) == TC_CELL) #define PAIR_P(object) ((OBJECT_TYPE (object)) == TC_LIST) @@ -252,8 +253,6 @@ extern SCHEME_OBJECT * memory_base; /* String Operations */ -#define STRING_P BYTEVECTOR_P - /* Add 1 byte to length to account for '\0' at end of string. Add 1 word to length to account for string header word. */ #define STRING_LENGTH_TO_GC_LENGTH(n_chars) \ diff --git a/src/microcode/primutl.c b/src/microcode/primutl.c index c83fe1de4..511ce591b 100644 --- a/src/microcode/primutl.c +++ b/src/microcode/primutl.c @@ -515,7 +515,7 @@ import_primitive_table (SCHEME_OBJECT * entries, long arity = (FIXNUM_TO_LONG (*entries++)); SCHEME_OBJECT prim = (find_primitive - ((MAKE_POINTER_OBJECT (TC_BYTEVECTOR, entries)), + ((MAKE_POINTER_OBJECT (TC_CHARACTER_STRING, entries)), true, true, arity)); if (!PRIMITIVE_P (prim)) diff --git a/src/microcode/string.c b/src/microcode/string.c index 309667013..ebbb46274 100644 --- a/src/microcode/string.c +++ b/src/microcode/string.c @@ -33,7 +33,7 @@ SCHEME_OBJECT allocate_string (unsigned long nbytes) { SCHEME_OBJECT result - = (allocate_non_marked_vector (TC_BYTEVECTOR, + = (allocate_non_marked_vector (TC_CHARACTER_STRING, (STRING_LENGTH_TO_GC_LENGTH (nbytes)), true)); SET_STRING_LENGTH (result, nbytes); @@ -44,7 +44,7 @@ SCHEME_OBJECT allocate_string_no_gc (unsigned long nbytes) { SCHEME_OBJECT result - = (allocate_non_marked_vector (TC_BYTEVECTOR, + = (allocate_non_marked_vector (TC_CHARACTER_STRING, (STRING_LENGTH_TO_GC_LENGTH (nbytes)), false)); SET_STRING_LENGTH (result, nbytes); diff --git a/src/microcode/types.h b/src/microcode/types.h index 31f749899..451157be0 100644 --- a/src/microcode/types.h +++ b/src/microcode/types.h @@ -56,7 +56,7 @@ USA. /* #define TC_PCOMB1 0x1B */ #define TC_CONTROL_POINT 0x1C #define TC_INTERNED_SYMBOL 0x1D -#define TC_BYTEVECTOR 0x1E +#define TC_CHARACTER_STRING 0x1E #define TC_ACCESS 0x1F #define TC_HUNK3_A 0x20 #define TC_DEFINITION 0x21 @@ -77,7 +77,7 @@ USA. /* #define TC_PCOMB0 0x30 */ #define TC_VECTOR_16B 0x31 #define TC_REFERENCE_TRAP 0x32 -/* #define TC_UNUSED_33 0x33 */ +#define TC_BYTEVECTOR 0x33 #define TC_CONDITIONAL 0x34 #define TC_DISJUNCTION 0x35 #define TC_CELL 0x36 @@ -134,7 +134,7 @@ USA. /* 0x1B */ 0, \ /* 0x1C */ "control-point", \ /* 0x1D */ "interned-symbol", \ - /* 0x1e */ "bytevector", \ + /* 0x1e */ "string", \ /* 0x1f */ "access", \ /* 0x20 */ "hunk3-a", \ /* 0x21 */ "definition", \ @@ -155,7 +155,7 @@ USA. /* 0x30 */ 0, \ /* 0x31 */ "vector-16b", \ /* 0x32 */ "reference-trap", \ - /* 0x33 */ 0, \ + /* 0x33 */ "bytevector", \ /* 0x34 */ "conditional", \ /* 0x35 */ "disjunction", \ /* 0x36 */ "cell", \ diff --git a/src/runtime/utabs.scm b/src/runtime/utabs.scm index add288e0d..93837acd9 100644 --- a/src/runtime/utabs.scm +++ b/src/runtime/utabs.scm @@ -265,7 +265,7 @@ USA. (BIGNUM BIG-FIXNUM) (PROMISE DELAYED) (FIXNUM ADDRESS POSITIVE-FIXNUM NEGATIVE-FIXNUM) - (BYTEVECTOR STRING CHARACTER-STRING VECTOR-8B) + (STRING CHARACTER-STRING VECTOR-8B) (HUNK3-A UNMARKED-HISTORY) (TRIPLE HUNK3 HUNK3-B MARKED-HISTORY) (REFERENCE-TRAP UNASSIGNED)