comparison src/bytecode.c @ 867:804517e16990

[xemacs-hg @ 2002-06-05 09:54:39 by ben] Textual renaming: text/char names abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, charset.h, chartab.c, chartab.h, cmds.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console-x.h, console.h, data.c, device-msw.c, device-x.c, dialog-msw.c, dired-msw.c, dired.c, doc.c, doprnt.c, editfns.c, eldap.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-unixoid.c, events.c, events.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, glyphs-eimage.c, glyphs-msw.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-x.c, gui-x.h, gui.c, gui.h, hpplay.c, indent.c, insdel.c, insdel.h, intl-win32.c, keymap.c, line-number.c, line-number.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, md5.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, ndir.h, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, procimpl.h, realpath.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, search.c, select-common.h, select-gtk.c, select-x.c, sound.h, symbols.c, syntax.c, syntax.h, sysdep.c, sysdep.h, sysdir.h, sysfile.h, sysproc.h, syspwd.h, systime.h, syswindows.h, termcap.c, tests.c, text.c, text.h, toolbar-common.c, tooltalk.c, ui-gtk.c, unexnt.c, unicode.c, win32.c: Text/char naming rationalization. [a] distinguish between "charptr" when it refers to operations on the pointer itself and when it refers to operations on text; and [b] use consistent naming for everything referring to internal format, i.e. Itext == text in internal format Ibyte == a byte in such text Ichar == a char as represented in internal character format thus e.g. set_charptr_emchar -> set_itext_ichar The pre and post tags on either side of this change are: pre-internal-format-textual-renaming post-internal-format-textual-renaming See the Internals Manual for details of exactly how this was done, how to handle the change in your workspace, etc.
author ben
date Wed, 05 Jun 2002 09:58:45 +0000
parents 2b6fa2618f76
children 79c6ff3eef26
comparison
equal deleted inserted replaced
866:613552a02607 867:804517e16990
1408 return stack_ptr; 1408 return stack_ptr;
1409 } 1409 }
1410 1410
1411 1411
1412 DOESNT_RETURN 1412 DOESNT_RETURN
1413 invalid_byte_code (const CIntbyte *reason, Lisp_Object frob) 1413 invalid_byte_code (const CIbyte *reason, Lisp_Object frob)
1414 { 1414 {
1415 signal_error (Qinvalid_byte_code, reason, frob); 1415 signal_error (Qinvalid_byte_code, reason, frob);
1416 } 1416 }
1417 1417
1418 /* Check for valid opcodes. Change this when adding new opcodes. */ 1418 /* Check for valid opcodes. Change this when adding new opcodes. */
1437 idx, XVECTOR_LENGTH (constants) - 1); 1437 idx, XVECTOR_LENGTH (constants) - 1);
1438 } 1438 }
1439 1439
1440 /* Get next character from Lisp instructions string. */ 1440 /* Get next character from Lisp instructions string. */
1441 #define READ_INSTRUCTION_CHAR(lvalue) do { \ 1441 #define READ_INSTRUCTION_CHAR(lvalue) do { \
1442 (lvalue) = charptr_emchar (ptr); \ 1442 (lvalue) = itext_ichar (ptr); \
1443 INC_CHARPTR (ptr); \ 1443 INC_IBYTEPTR (ptr); \
1444 *icounts_ptr++ = program_ptr - program; \ 1444 *icounts_ptr++ = program_ptr - program; \
1445 if (lvalue > UCHAR_MAX) \ 1445 if (lvalue > UCHAR_MAX) \
1446 invalid_byte_code \ 1446 invalid_byte_code \
1447 ("Invalid character in byte code string", make_char (lvalue)); \ 1447 ("Invalid character in byte code string", make_char (lvalue)); \
1448 } while (0) 1448 } while (0)
1544 struct jump * const jumps = alloca_array (struct jump, comfy_size); 1544 struct jump * const jumps = alloca_array (struct jump, comfy_size);
1545 struct jump *jumps_ptr = jumps; 1545 struct jump *jumps_ptr = jumps;
1546 1546
1547 Opbyte *program_ptr = program; 1547 Opbyte *program_ptr = program;
1548 1548
1549 const Intbyte *ptr = XSTRING_DATA (instructions); 1549 const Ibyte *ptr = XSTRING_DATA (instructions);
1550 const Intbyte * const end = ptr + instructions_length; 1550 const Ibyte * const end = ptr + instructions_length;
1551 1551
1552 *varbind_count = 0; 1552 *varbind_count = 0;
1553 1553
1554 while (ptr < end) 1554 while (ptr < end)
1555 { 1555 {
1992 1992
1993 { 1993 {
1994 /* Invert action performed by optimize_byte_code() */ 1994 /* Invert action performed by optimize_byte_code() */
1995 Lisp_Opaque *opaque = XOPAQUE (f->instructions); 1995 Lisp_Opaque *opaque = XOPAQUE (f->instructions);
1996 1996
1997 Intbyte * const buffer = 1997 Ibyte * const buffer =
1998 alloca_array (Intbyte, OPAQUE_SIZE (opaque) * MAX_EMCHAR_LEN); 1998 alloca_array (Ibyte, OPAQUE_SIZE (opaque) * MAX_ICHAR_LEN);
1999 Intbyte *bp = buffer; 1999 Ibyte *bp = buffer;
2000 2000
2001 const Opbyte * const program = (const Opbyte *) OPAQUE_DATA (opaque); 2001 const Opbyte * const program = (const Opbyte *) OPAQUE_DATA (opaque);
2002 const Opbyte *program_ptr = program; 2002 const Opbyte *program_ptr = program;
2003 const Opbyte * const program_end = program_ptr + OPAQUE_SIZE (opaque); 2003 const Opbyte * const program_end = program_ptr + OPAQUE_SIZE (opaque);
2004 2004
2005 while (program_ptr < program_end) 2005 while (program_ptr < program_end)
2006 { 2006 {
2007 Opcode opcode = (Opcode) READ_UINT_1; 2007 Opcode opcode = (Opcode) READ_UINT_1;
2008 bp += set_charptr_emchar (bp, opcode); 2008 bp += set_itext_ichar (bp, opcode);
2009 switch (opcode) 2009 switch (opcode)
2010 { 2010 {
2011 case Bvarref+7: 2011 case Bvarref+7:
2012 case Bvarset+7: 2012 case Bvarset+7:
2013 case Bvarbind+7: 2013 case Bvarbind+7:
2014 case Bcall+7: 2014 case Bcall+7:
2015 case Bunbind+7: 2015 case Bunbind+7:
2016 case Bconstant2: 2016 case Bconstant2:
2017 bp += set_charptr_emchar (bp, READ_UINT_1); 2017 bp += set_itext_ichar (bp, READ_UINT_1);
2018 bp += set_charptr_emchar (bp, READ_UINT_1); 2018 bp += set_itext_ichar (bp, READ_UINT_1);
2019 break; 2019 break;
2020 2020
2021 case Bvarref+6: 2021 case Bvarref+6:
2022 case Bvarset+6: 2022 case Bvarset+6:
2023 case Bvarbind+6: 2023 case Bvarbind+6:
2024 case Bcall+6: 2024 case Bcall+6:
2025 case Bunbind+6: 2025 case Bunbind+6:
2026 case BlistN: 2026 case BlistN:
2027 case BconcatN: 2027 case BconcatN:
2028 case BinsertN: 2028 case BinsertN:
2029 bp += set_charptr_emchar (bp, READ_UINT_1); 2029 bp += set_itext_ichar (bp, READ_UINT_1);
2030 break; 2030 break;
2031 2031
2032 case Bgoto: 2032 case Bgoto:
2033 case Bgotoifnil: 2033 case Bgotoifnil:
2034 case Bgotoifnonnil: 2034 case Bgotoifnonnil:
2038 int jump = READ_INT_2; 2038 int jump = READ_INT_2;
2039 Opbyte buf2[2]; 2039 Opbyte buf2[2];
2040 Opbyte *buf2p = buf2; 2040 Opbyte *buf2p = buf2;
2041 /* Convert back to program-relative address */ 2041 /* Convert back to program-relative address */
2042 WRITE_INT16 (jump + (program_ptr - 2 - program), buf2p); 2042 WRITE_INT16 (jump + (program_ptr - 2 - program), buf2p);
2043 bp += set_charptr_emchar (bp, buf2[0]); 2043 bp += set_itext_ichar (bp, buf2[0]);
2044 bp += set_charptr_emchar (bp, buf2[1]); 2044 bp += set_itext_ichar (bp, buf2[1]);
2045 break; 2045 break;
2046 } 2046 }
2047 2047
2048 case BRgoto: 2048 case BRgoto:
2049 case BRgotoifnil: 2049 case BRgotoifnil:
2050 case BRgotoifnonnil: 2050 case BRgotoifnonnil:
2051 case BRgotoifnilelsepop: 2051 case BRgotoifnilelsepop:
2052 case BRgotoifnonnilelsepop: 2052 case BRgotoifnonnilelsepop:
2053 bp += set_charptr_emchar (bp, READ_INT_1 + 127); 2053 bp += set_itext_ichar (bp, READ_INT_1 + 127);
2054 break; 2054 break;
2055 2055
2056 default: 2056 default:
2057 break; 2057 break;
2058 } 2058 }