Mercurial > hg > xemacs-beta
comparison src/bytecode.c @ 272:c5d627a313b1 r21-0b34
Import from CVS: tag r21-0b34
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:28:48 +0200 |
parents | 084402c475ba |
children | ca9a9ec9c1c1 |
comparison
equal
deleted
inserted
replaced
271:c7b7086b0a39 | 272:c5d627a313b1 |
---|---|
306 stack = stackp; | 306 stack = stackp; |
307 stacke = stackp + XINT (maxdepth); | 307 stacke = stackp + XINT (maxdepth); |
308 | 308 |
309 /* Initialize the pc-register and convert the string into a fixed-width | 309 /* Initialize the pc-register and convert the string into a fixed-width |
310 format for easier processing. */ | 310 format for easier processing. */ |
311 massaged_code = alloca_array (Emchar, | 311 massaged_code = alloca_array (Emchar, 1 + XSTRING_CHAR_LENGTH (bytestr)); |
312 1 + string_char_length (XSTRING (bytestr))); | |
313 massaged_code_len = | 312 massaged_code_len = |
314 convert_bufbyte_string_into_emchar_string (XSTRING_DATA (bytestr), | 313 convert_bufbyte_string_into_emchar_string (XSTRING_DATA (bytestr), |
315 XSTRING_LENGTH (bytestr), | 314 XSTRING_LENGTH (bytestr), |
316 massaged_code); | 315 massaged_code); |
317 massaged_code[massaged_code_len] = 0; | 316 massaged_code[massaged_code_len] = 0; |
575 break; | 574 break; |
576 | 575 |
577 case Bcondition_case: | 576 case Bcondition_case: |
578 v1 = POP; /* handlers */ | 577 v1 = POP; /* handlers */ |
579 v2 = POP; /* bodyform */ | 578 v2 = POP; /* bodyform */ |
580 TOP = Fcondition_case_3 (v2, TOP, v1); | 579 TOP = condition_case_3 (v2, TOP, v1); |
581 break; | 580 break; |
582 | 581 |
583 case Btemp_output_buffer_setup: | 582 case Btemp_output_buffer_setup: |
584 temp_output_buffer_setup ((char *) XSTRING_DATA (TOP)); | 583 temp_output_buffer_setup ((char *) XSTRING_DATA (TOP)); |
585 TOP = Vstandard_output; | 584 TOP = Vstandard_output; |
612 QUIT; | 611 QUIT; |
613 } | 612 } |
614 goto docar; | 613 goto docar; |
615 | 614 |
616 case Bsymbolp: | 615 case Bsymbolp: |
617 TOP = ((SYMBOLP (TOP)) ? Qt : Qnil); | 616 TOP = SYMBOLP (TOP) ? Qt : Qnil; |
618 break; | 617 break; |
619 | 618 |
620 case Bconsp: | 619 case Bconsp: |
621 TOP = ((CONSP (TOP)) ? Qt : Qnil); | 620 TOP = CONSP (TOP) ? Qt : Qnil; |
622 break; | 621 break; |
623 | 622 |
624 case Bstringp: | 623 case Bstringp: |
625 TOP = ((STRINGP (TOP)) ? Qt : Qnil); | 624 TOP = STRINGP (TOP) ? Qt : Qnil; |
626 break; | 625 break; |
627 | 626 |
628 case Blistp: | 627 case Blistp: |
629 TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil; | 628 TOP = LISTP (TOP) ? Qt : Qnil; |
630 break; | 629 break; |
631 | 630 |
632 case Beq: | 631 case Beq: |
633 v1 = POP; | 632 v1 = POP; |
634 TOP = ((EQ_WITH_EBOLA_NOTICE (v1, TOP)) ? Qt : Qnil); | 633 TOP = EQ_WITH_EBOLA_NOTICE (v1, TOP) ? Qt : Qnil; |
635 break; | 634 break; |
636 | 635 |
637 case Bold_eq: | 636 case Bold_eq: |
638 v1 = POP; | 637 v1 = POP; |
639 TOP = ((HACKEQ_UNSAFE (v1, TOP)) ? Qt : Qnil); | 638 TOP = HACKEQ_UNSAFE (v1, TOP) ? Qt : Qnil; |
640 break; | 639 break; |
641 | 640 |
642 case Bmemq: | 641 case Bmemq: |
643 v1 = POP; | 642 v1 = POP; |
644 TOP = Fmemq (TOP, v1); | 643 TOP = Fmemq (TOP, v1); |
788 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v1); | 787 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v1); |
789 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v2); | 788 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v2); |
790 #ifdef LISP_FLOAT_TYPE | 789 #ifdef LISP_FLOAT_TYPE |
791 if (FLOATP (v1) || FLOATP (v2)) | 790 if (FLOATP (v1) || FLOATP (v2)) |
792 { | 791 { |
793 double f1, f2; | 792 double f1 = (FLOATP (v1) ? float_data (XFLOAT (v1)) : XINT (v1)); |
794 | 793 double f2 = (FLOATP (v2) ? float_data (XFLOAT (v2)) : XINT (v2)); |
795 f1 = (FLOATP (v1) ? float_data (XFLOAT (v1)) : XINT (v1)); | |
796 f2 = (FLOATP (v2) ? float_data (XFLOAT (v2)) : XINT (v2)); | |
797 TOP = (f1 == f2 ? Qt : Qnil); | 794 TOP = (f1 == f2 ? Qt : Qnil); |
798 } | 795 } |
799 else | 796 else |
800 #endif /* LISP_FLOAT_TYPE */ | 797 #endif /* LISP_FLOAT_TYPE */ |
801 TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil); | 798 TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil); |
1128 DISCARD (1); | 1125 DISCARD (1); |
1129 TOP = Fnconc (2, &TOP); | 1126 TOP = Fnconc (2, &TOP); |
1130 break; | 1127 break; |
1131 | 1128 |
1132 case Bnumberp: | 1129 case Bnumberp: |
1133 TOP = ((INT_OR_FLOATP (TOP)) ? Qt : Qnil); | 1130 TOP = INT_OR_FLOATP (TOP) ? Qt : Qnil; |
1134 break; | 1131 break; |
1135 | 1132 |
1136 case Bintegerp: | 1133 case Bintegerp: |
1137 TOP = ((INTP (TOP)) ? Qt : Qnil); | 1134 TOP = INTP (TOP) ? Qt : Qnil; |
1138 break; | 1135 break; |
1139 | 1136 |
1140 default: | 1137 default: |
1141 #ifdef BYTE_CODE_SAFE | 1138 #ifdef BYTE_CODE_SAFE |
1142 if (op < Bconstant) | 1139 if (op < Bconstant) |
1174 { | 1171 { |
1175 #ifdef BYTE_CODE_METER | 1172 #ifdef BYTE_CODE_METER |
1176 | 1173 |
1177 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /* | 1174 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /* |
1178 A vector of vectors which holds a histogram of byte-code usage. | 1175 A vector of vectors which holds a histogram of byte-code usage. |
1179 (aref (aref byte-code-meter 0) CODE) indicates how many times the byte | 1176 \(aref (aref byte-code-meter 0) CODE) indicates how many times the byte |
1180 opcode CODE has been executed. | 1177 opcode CODE has been executed. |
1181 (aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, | 1178 \(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0, |
1182 indicates how many times the byte opcodes CODE1 and CODE2 have been | 1179 indicates how many times the byte opcodes CODE1 and CODE2 have been |
1183 executed in succession. | 1180 executed in succession. |
1184 */ ); | 1181 */ ); |
1185 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on /* | 1182 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on /* |
1186 If non-nil, keep profiling information on byte code usage. | 1183 If non-nil, keep profiling information on byte code usage. |