/[emacs]/emacs/src/bytecode.c
ViewVC logotype

Diff of /emacs/src/bytecode.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.69.2.2 by miles, Mon Aug 26 07:38:31 2002 UTC revision 1.69.2.3 by miles, Fri Apr 4 06:20:57 2003 UTC
# Line 248  struct byte_stack Line 248  struct byte_stack
248  {  {
249    /* Program counter.  This points into the byte_string below    /* Program counter.  This points into the byte_string below
250       and is relocated when that string is relocated.  */       and is relocated when that string is relocated.  */
251    unsigned char *pc;    const unsigned char *pc;
252    
253    /* Top and bottom of stack.  The bottom points to an area of memory    /* Top and bottom of stack.  The bottom points to an area of memory
254       allocated with alloca in Fbyte_code.  */       allocated with alloca in Fbyte_code.  */
# Line 258  struct byte_stack Line 258  struct byte_stack
258       Storing this here protects it from GC because mark_byte_stack       Storing this here protects it from GC because mark_byte_stack
259       marks it.  */       marks it.  */
260    Lisp_Object byte_string;    Lisp_Object byte_string;
261    unsigned char *byte_string_start;    const unsigned char *byte_string_start;
262    
263    /* The vector of constants used during byte-code execution.  Storing    /* The vector of constants used during byte-code execution.  Storing
264       this here protects it from GC because mark_byte_stack marks it.  */       this here protects it from GC because mark_byte_stack marks it.  */
# Line 336  unmark_byte_stack () Line 336  unmark_byte_stack ()
336        XUNMARK (stack->byte_string);        XUNMARK (stack->byte_string);
337        XUNMARK (stack->constants);        XUNMARK (stack->constants);
338    
339        if (stack->byte_string_start != XSTRING (stack->byte_string)->data)        if (stack->byte_string_start != SDATA (stack->byte_string))
340          {          {
341            int offset = stack->pc - stack->byte_string_start;            int offset = stack->pc - stack->byte_string_start;
342            stack->byte_string_start = XSTRING (stack->byte_string)->data;            stack->byte_string_start = SDATA (stack->byte_string);
343            stack->pc = stack->byte_string_start + offset;            stack->pc = stack->byte_string_start + offset;
344          }          }
345      }      }
# Line 456  exec_byte_code (bytestr, vector, maxdept Line 456  exec_byte_code (bytestr, vector, maxdept
456       int nargs;       int nargs;
457       Lisp_Object *args;       Lisp_Object *args;
458  {  {
459    int count = specpdl_ptr - specpdl;    int count = SPECPDL_INDEX ();
460  #ifdef BYTE_CODE_METER  #ifdef BYTE_CODE_METER
461    int this_op = 0;    int this_op = 0;
462    int prev_op;    int prev_op;
# Line 496  exec_byte_code (bytestr, vector, maxdept Line 496  exec_byte_code (bytestr, vector, maxdept
496         convert them back to the originally intended unibyte form.  */         convert them back to the originally intended unibyte form.  */
497      bytestr = Fstring_as_unibyte (bytestr);      bytestr = Fstring_as_unibyte (bytestr);
498    
499    bytestr_length = STRING_BYTES (XSTRING (bytestr));    bytestr_length = SBYTES (bytestr);
500    vectorp = XVECTOR (vector)->contents;    vectorp = XVECTOR (vector)->contents;
501    
502    stack.byte_string = bytestr;    stack.byte_string = bytestr;
503    stack.pc = stack.byte_string_start = XSTRING (bytestr)->data;    stack.pc = stack.byte_string_start = SDATA (bytestr);
504    stack.constants = vector;    stack.constants = vector;
505    stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth)    stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth)
506                                           * sizeof (Lisp_Object));                                           * sizeof (Lisp_Object));
# Line 795  exec_byte_code (bytestr, vector, maxdept Line 795  exec_byte_code (bytestr, vector, maxdept
795            op -= Bunbind;            op -= Bunbind;
796          dounbind:          dounbind:
797            BEFORE_POTENTIAL_GC ();            BEFORE_POTENTIAL_GC ();
798            unbind_to (specpdl_ptr - specpdl - op, Qnil);            unbind_to (SPECPDL_INDEX () - op, Qnil);
799            AFTER_POTENTIAL_GC ();            AFTER_POTENTIAL_GC ();
800            break;            break;
801    
# Line 963  exec_byte_code (bytestr, vector, maxdept Line 963  exec_byte_code (bytestr, vector, maxdept
963          case Btemp_output_buffer_setup:          case Btemp_output_buffer_setup:
964            BEFORE_POTENTIAL_GC ();            BEFORE_POTENTIAL_GC ();
965            CHECK_STRING (TOP);            CHECK_STRING (TOP);
966            temp_output_buffer_setup (XSTRING (TOP)->data);            temp_output_buffer_setup (SDATA (TOP));
967            AFTER_POTENTIAL_GC ();            AFTER_POTENTIAL_GC ();
968            TOP = Vstandard_output;            TOP = Vstandard_output;
969            break;            break;
# Line 976  exec_byte_code (bytestr, vector, maxdept Line 976  exec_byte_code (bytestr, vector, maxdept
976              temp_output_buffer_show (TOP);              temp_output_buffer_show (TOP);
977              TOP = v1;              TOP = v1;
978              /* pop binding of standard-output */              /* pop binding of standard-output */
979              unbind_to (specpdl_ptr - specpdl - 1, Qnil);              unbind_to (SPECPDL_INDEX () - 1, Qnil);
980              AFTER_POTENTIAL_GC ();              AFTER_POTENTIAL_GC ();
981              break;              break;
982            }            }
# Line 1845  exec_byte_code (bytestr, vector, maxdept Line 1845  exec_byte_code (bytestr, vector, maxdept
1845    byte_stack_list = byte_stack_list->next;    byte_stack_list = byte_stack_list->next;
1846    
1847    /* Binds and unbinds are supposed to be compiled balanced.  */    /* Binds and unbinds are supposed to be compiled balanced.  */
1848    if (specpdl_ptr - specpdl != count)    if (SPECPDL_INDEX () != count)
1849  #ifdef BYTE_CODE_SAFE  #ifdef BYTE_CODE_SAFE
1850      error ("binding stack not balanced (serious byte compiler bug)");      error ("binding stack not balanced (serious byte compiler bug)");
1851  #else  #else

Legend:
Removed from v.1.69.2.2  
changed lines
  Added in v.1.69.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26