22 |
hacked on by jwz@lucid.com 17-jun-91 |
hacked on by jwz@lucid.com 17-jun-91 |
23 |
o added a compile-time switch to turn on simple sanity checking; |
o added a compile-time switch to turn on simple sanity checking; |
24 |
o put back the obsolete byte-codes for error-detection; |
o put back the obsolete byte-codes for error-detection; |
25 |
o added a new instruction, unbind_all, which I will use for |
o added a new instruction, unbind_all, which I will use for |
26 |
tail-recursion elimination; |
tail-recursion elimination; |
27 |
o made temp_output_buffer_show be called with the right number |
o made temp_output_buffer_show be called with the right number |
28 |
of args; |
of args; |
46 |
#endif |
#endif |
47 |
|
|
48 |
/* |
/* |
49 |
* define BYTE_CODE_SAFE to enable some minor sanity checking (useful for |
* define BYTE_CODE_SAFE to enable some minor sanity checking (useful for |
50 |
* debugging the byte compiler...) |
* debugging the byte compiler...) |
51 |
* |
* |
52 |
* define BYTE_CODE_METER to enable generation of a byte-op usage histogram. |
* define BYTE_CODE_METER to enable generation of a byte-op usage histogram. |
53 |
*/ |
*/ |
54 |
/* #define BYTE_CODE_SAFE */ |
/* #define BYTE_CODE_SAFE */ |
55 |
/* #define BYTE_CODE_METER */ |
/* #define BYTE_CODE_METER */ |
287 |
recorded value of `stack' here. */ |
recorded value of `stack' here. */ |
288 |
if (!stack->top) |
if (!stack->top) |
289 |
abort (); |
abort (); |
290 |
|
|
291 |
for (obj = stack->bottom; obj <= stack->top; ++obj) |
for (obj = stack->bottom; obj <= stack->top; ++obj) |
292 |
if (!XMARKBIT (*obj)) |
if (!XMARKBIT (*obj)) |
293 |
{ |
{ |
313 |
/* Unmark objects in the stacks on byte_stack_list. Relocate program |
/* Unmark objects in the stacks on byte_stack_list. Relocate program |
314 |
counters. Called when GC has completed. */ |
counters. Called when GC has completed. */ |
315 |
|
|
316 |
void |
void |
317 |
unmark_byte_stack () |
unmark_byte_stack () |
318 |
{ |
{ |
319 |
struct byte_stack *stack; |
struct byte_stack *stack; |
466 |
stack.byte_string = bytestr; |
stack.byte_string = bytestr; |
467 |
stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; |
stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; |
468 |
stack.constants = vector; |
stack.constants = vector; |
469 |
stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) |
stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) |
470 |
* sizeof (Lisp_Object)); |
* sizeof (Lisp_Object)); |
471 |
top = stack.bottom - 1; |
top = stack.bottom - 1; |
472 |
stack.top = NULL; |
stack.top = NULL; |
476 |
#ifdef BYTE_CODE_SAFE |
#ifdef BYTE_CODE_SAFE |
477 |
stacke = stack.bottom - 1 + XFASTINT (maxdepth); |
stacke = stack.bottom - 1 + XFASTINT (maxdepth); |
478 |
#endif |
#endif |
479 |
|
|
480 |
while (1) |
while (1) |
481 |
{ |
{ |
482 |
#ifdef BYTE_CODE_SAFE |
#ifdef BYTE_CODE_SAFE |
500 |
op = FETCH2; |
op = FETCH2; |
501 |
goto varref; |
goto varref; |
502 |
|
|
503 |
case Bvarref: |
case Bvarref: |
504 |
case Bvarref + 1: |
case Bvarref + 1: |
505 |
case Bvarref + 2: |
case Bvarref + 2: |
506 |
case Bvarref + 3: |
case Bvarref + 3: |
507 |
case Bvarref + 4: |
case Bvarref + 4: |
508 |
case Bvarref + 5: |
case Bvarref + 5: |
509 |
op = op - Bvarref; |
op = op - Bvarref; |
510 |
goto varref; |
goto varref; |
619 |
varset: |
varset: |
620 |
{ |
{ |
621 |
Lisp_Object sym, val; |
Lisp_Object sym, val; |
622 |
|
|
623 |
sym = vectorp[op]; |
sym = vectorp[op]; |
624 |
val = TOP; |
val = TOP; |
625 |
|
|
1352 |
{ |
{ |
1353 |
Lisp_Object v1; |
Lisp_Object v1; |
1354 |
BEFORE_POTENTIAL_GC (); |
BEFORE_POTENTIAL_GC (); |
1355 |
XSETFASTINT (v1, current_column ()); |
XSETFASTINT (v1, (int) current_column ()); /* iftc */ |
1356 |
AFTER_POTENTIAL_GC (); |
AFTER_POTENTIAL_GC (); |
1357 |
PUSH (v1); |
PUSH (v1); |
1358 |
break; |
break; |
1731 |
#else |
#else |
1732 |
abort (); |
abort (); |
1733 |
#endif |
#endif |
1734 |
|
|
1735 |
return result; |
return result; |
1736 |
} |
} |
1737 |
|
|
1752 |
\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, |
\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, |
1753 |
indicates how many times the byte opcodes CODE1 and CODE2 have been |
indicates how many times the byte opcodes CODE1 and CODE2 have been |
1754 |
executed in succession. */); |
executed in succession. */); |
1755 |
|
|
1756 |
DEFVAR_BOOL ("byte-metering-on", &byte_metering_on, |
DEFVAR_BOOL ("byte-metering-on", &byte_metering_on, |
1757 |
doc: /* If non-nil, keep profiling information on byte code usage. |
doc: /* If non-nil, keep profiling information on byte code usage. |
1758 |
The variable byte-code-meter indicates how often each byte opcode is used. |
The variable byte-code-meter indicates how often each byte opcode is used. |