Mercurial > hg > xemacs-beta
comparison src/bytecode.c @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | 84b14dcb0985 |
children | abe6d1db359e |
comparison
equal
deleted
inserted
replaced
439:357dd071b03c | 440:8de8e3f6228a |
---|---|
684 case Bvarset+7: n = READ_UINT_2; goto do_varset; | 684 case Bvarset+7: n = READ_UINT_2; goto do_varset; |
685 case Bvarset+6: n = READ_UINT_1; /* most common */ | 685 case Bvarset+6: n = READ_UINT_1; /* most common */ |
686 do_varset: | 686 do_varset: |
687 { | 687 { |
688 Lisp_Object symbol = constants_data[n]; | 688 Lisp_Object symbol = constants_data[n]; |
689 struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); | 689 Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); |
690 Lisp_Object old_value = symbol_ptr->value; | 690 Lisp_Object old_value = symbol_ptr->value; |
691 Lisp_Object new_value = POP; | 691 Lisp_Object new_value = POP; |
692 if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) | 692 if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) |
693 symbol_ptr->value = new_value; | 693 symbol_ptr->value = new_value; |
694 else | 694 else |
705 case Bvarbind+7: n = READ_UINT_2; goto do_varbind; | 705 case Bvarbind+7: n = READ_UINT_2; goto do_varbind; |
706 case Bvarbind+6: n = READ_UINT_1; /* most common */ | 706 case Bvarbind+6: n = READ_UINT_1; /* most common */ |
707 do_varbind: | 707 do_varbind: |
708 { | 708 { |
709 Lisp_Object symbol = constants_data[n]; | 709 Lisp_Object symbol = constants_data[n]; |
710 struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); | 710 Lisp_Symbol *symbol_ptr = XSYMBOL (symbol); |
711 Lisp_Object old_value = symbol_ptr->value; | 711 Lisp_Object old_value = symbol_ptr->value; |
712 Lisp_Object new_value = POP; | 712 Lisp_Object new_value = POP; |
713 if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) | 713 if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value)) |
714 { | 714 { |
715 specpdl_ptr->symbol = symbol; | 715 specpdl_ptr->symbol = symbol; |
1892 program = alloca_array (Opbyte, 1 + 2 * XSTRING_LENGTH (f->instructions)); | 1892 program = alloca_array (Opbyte, 1 + 2 * XSTRING_LENGTH (f->instructions)); |
1893 optimize_byte_code (f->instructions, f->constants, | 1893 optimize_byte_code (f->instructions, f->constants, |
1894 program, &program_length, &varbind_count); | 1894 program, &program_length, &varbind_count); |
1895 f->specpdl_depth = XINT (Flength (f->arglist)) + varbind_count; | 1895 f->specpdl_depth = XINT (Flength (f->arglist)) + varbind_count; |
1896 f->instructions = | 1896 f->instructions = |
1897 make_opaque (program_length * sizeof (Opbyte), | 1897 make_opaque (program, program_length * sizeof (Opbyte)); |
1898 (CONST void *) program); | |
1899 } | 1898 } |
1900 | 1899 |
1901 assert (OPAQUEP (f->instructions)); | 1900 assert (OPAQUEP (f->instructions)); |
1902 } | 1901 } |
1903 | 1902 |
2022 internal_hash (f->instructions, depth + 1), | 2021 internal_hash (f->instructions, depth + 1), |
2023 internal_hash (f->constants, depth + 1)); | 2022 internal_hash (f->constants, depth + 1)); |
2024 } | 2023 } |
2025 | 2024 |
2026 static const struct lrecord_description compiled_function_description[] = { | 2025 static const struct lrecord_description compiled_function_description[] = { |
2027 { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, instructions), 4 }, | 2026 { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) }, |
2027 { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) }, | |
2028 { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, arglist) }, | |
2029 { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, doc_and_interactive) }, | |
2028 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK | 2030 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK |
2029 { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, annotated), 1 }, | 2031 { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, annotated) }, |
2030 #endif | 2032 #endif |
2031 { XD_END } | 2033 { XD_END } |
2032 }; | 2034 }; |
2033 | 2035 |
2034 DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, | 2036 DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, |