diff options
| author | Stefan Monnier | 2011-02-17 21:07:36 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-02-17 21:07:36 -0500 |
| commit | b286858c7a0d5dafa302b9e88970c13385358a6a (patch) | |
| tree | 37aca1554bbef09ef09256d7162e619222dbb4a1 /src | |
| parent | 3804652098c7c8824f332e92846a3b8896b9e683 (diff) | |
| download | emacs-b286858c7a0d5dafa302b9e88970c13385358a6a.tar.gz emacs-b286858c7a0d5dafa302b9e88970c13385358a6a.zip | |
Don't GC-scan stack data redundantly.
* src/alloc.c (Fgarbage_collect): When using stack scanning, don't
redundantly scan byte-code stacks, catchlist, and handlerlist.
* src/bytecode.c (BYTE_MAINTAIN_TOP): New macros.
(struct byte_stack): Only define `top' and `bottom' if used.
(mark_byte_stack): Only define if used.
(BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): Nullify if BYTE_MAINTAIN_TOP
is not set.
(Fbyte_code): Don't set `bottom' unless BYTE_MAINTAIN_TOP is set.
* src/lisp.h (BYTE_MARK_STACK): New macro.
(mark_byte_stack): Only declare if BYTE_MARK_STACK is set.
* src/term.c (OUTPUT_IF): Use OUTPUT.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 83 | ||||
| -rw-r--r-- | src/alloc.c | 10 | ||||
| -rw-r--r-- | src/bytecode.c | 19 | ||||
| -rw-r--r-- | src/lisp.h | 7 | ||||
| -rw-r--r-- | src/term.c | 5 |
5 files changed, 80 insertions, 44 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 048fc7f052d..9fbc83f6c0c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2011-02-18 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * lisp.h (BYTE_MARK_STACK): New macro. | ||
| 4 | (mark_byte_stack): Only declare if BYTE_MARK_STACK is set. | ||
| 5 | |||
| 6 | * bytecode.c (BYTE_MAINTAIN_TOP): New macros. | ||
| 7 | (struct byte_stack): Only define `top' and `bottom' if used. | ||
| 8 | (mark_byte_stack): Only define if used. | ||
| 9 | (BEFORE_POTENTIAL_GC, AFTER_POTENTIAL_GC): Nullify if BYTE_MAINTAIN_TOP | ||
| 10 | is not set. | ||
| 11 | (Fbyte_code): Don't set `bottom' unless BYTE_MAINTAIN_TOP is set. | ||
| 12 | |||
| 13 | * term.c (OUTPUT_IF): Use OUTPUT. | ||
| 14 | |||
| 15 | * alloc.c (Fgarbage_collect): When using stack scanning, don't | ||
| 16 | redundantly scan byte-code stacks, catchlist, and handlerlist. | ||
| 17 | |||
| 1 | 2011-02-17 Jan Djärv <jan.h.d@swipnet.se> | 18 | 2011-02-17 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 19 | ||
| 3 | * nsfns.m (Fx_create_frame, ns_set_name_as_filename) | 20 | * nsfns.m (Fx_create_frame, ns_set_name_as_filename) |
| @@ -18,8 +35,8 @@ | |||
| 18 | 35 | ||
| 19 | * xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT. | 36 | * xdisp.c (decode_mode_spec): Don't use MODE_LINE_BINARY_TEXT. |
| 20 | 37 | ||
| 21 | * fileio.c (Finsert_file_contents, Fwrite_region): Remove | 38 | * fileio.c (Finsert_file_contents, Fwrite_region): |
| 22 | references to buffer_file_type. | 39 | Remove references to buffer_file_type. |
| 23 | (syms_of_fileio): Don't intern and staticpro | 40 | (syms_of_fileio): Don't intern and staticpro |
| 24 | find-buffer-file-type. | 41 | find-buffer-file-type. |
| 25 | 42 | ||
| @@ -112,8 +129,8 @@ | |||
| 112 | (strout, print_string, temp_output_buffer_setup, print_object): | 129 | (strout, print_string, temp_output_buffer_setup, print_object): |
| 113 | Replace B_ with BVAR. | 130 | Replace B_ with BVAR. |
| 114 | * msdos.c (IT_frame_up_to_date): Replace B_ with BVAR. | 131 | * msdos.c (IT_frame_up_to_date): Replace B_ with BVAR. |
| 115 | * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Replace | 132 | * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): |
| 116 | B_ with BVAR. | 133 | Replace B_ with BVAR. |
| 117 | * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) | 134 | * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) |
| 118 | (set_marker_both, set_marker_restricted_both, unchain_marker): | 135 | (set_marker_both, set_marker_restricted_both, unchain_marker): |
| 119 | Replace B_ with BVAR. | 136 | Replace B_ with BVAR. |
| @@ -275,8 +292,8 @@ | |||
| 275 | * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. | 292 | * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. |
| 276 | (apply_systemfont_to_menu): Set resources *menubar*font and | 293 | (apply_systemfont_to_menu): Set resources *menubar*font and |
| 277 | *popup*font. Remove defflt. | 294 | *popup*font. Remove defflt. |
| 278 | (set_frame_menubar, create_and_show_popup_menu): Call | 295 | (set_frame_menubar, create_and_show_popup_menu): |
| 279 | apply_systemfont_to_menu before lw_create_widget. | 296 | Call apply_systemfont_to_menu before lw_create_widget. |
| 280 | 297 | ||
| 281 | 2011-02-14 Tom Tromey <tromey@redhat.com> | 298 | 2011-02-14 Tom Tromey <tromey@redhat.com> |
| 282 | 299 | ||
| @@ -305,8 +322,8 @@ | |||
| 305 | (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) | 322 | (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) |
| 306 | (print_object): Use B_. | 323 | (print_object): Use B_. |
| 307 | * font.c (font_at): Use B_. | 324 | * font.c (font_at): Use B_. |
| 308 | * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use | 325 | * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): |
| 309 | B_. | 326 | Use B_. |
| 310 | * callint.c (check_mark, Fcall_interactively): Use B_. | 327 | * callint.c (check_mark, Fcall_interactively): Use B_. |
| 311 | * editfns.c (region_limit, Fmark_marker, save_excursion_save) | 328 | * editfns.c (region_limit, Fmark_marker, save_excursion_save) |
| 312 | (save_excursion_restore, Fprevious_char, Fchar_before) | 329 | (save_excursion_restore, Fprevious_char, Fchar_before) |
| @@ -329,8 +346,8 @@ | |||
| 329 | (Freplace_match): Use B_. | 346 | (Freplace_match): Use B_. |
| 330 | * indent.c (buffer_display_table, recompute_width_table) | 347 | * indent.c (buffer_display_table, recompute_width_table) |
| 331 | (width_run_cache_on_off, current_column, scan_for_column) | 348 | (width_run_cache_on_off, current_column, scan_for_column) |
| 332 | (Findent_to, position_indentation, compute_motion, vmotion): Use | 349 | (Findent_to, position_indentation, compute_motion, vmotion): |
| 333 | B_. | 350 | Use B_. |
| 334 | * casefiddle.c (casify_object, casify_region): Use B_. | 351 | * casefiddle.c (casify_object, casify_region): Use B_. |
| 335 | * casetab.c (Fcurrent_case_table, set_case_table): Use B_. | 352 | * casetab.c (Fcurrent_case_table, set_case_table): Use B_. |
| 336 | * cmds.c (Fself_insert_command, internal_self_insert): Use B_. | 353 | * cmds.c (Fself_insert_command, internal_self_insert): Use B_. |
| @@ -344,8 +361,8 @@ | |||
| 344 | (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. | 361 | (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. |
| 345 | * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. | 362 | * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. |
| 346 | * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) | 363 | * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) |
| 347 | (set_marker_both, set_marker_restricted_both, unchain_marker): Use | 364 | (set_marker_both, set_marker_restricted_both, unchain_marker): |
| 348 | B_. | 365 | Use B_. |
| 349 | * insdel.c (check_markers, insert_char, insert_1_both) | 366 | * insdel.c (check_markers, insert_char, insert_1_both) |
| 350 | (insert_from_string_1, insert_from_gap, insert_from_buffer_1) | 367 | (insert_from_string_1, insert_from_gap, insert_from_buffer_1) |
| 351 | (adjust_after_replace, replace_range, del_range_2) | 368 | (adjust_after_replace, replace_range, del_range_2) |
| @@ -369,8 +386,8 @@ | |||
| 369 | (make_conversion_work_buffer, decode_coding_gap) | 386 | (make_conversion_work_buffer, decode_coding_gap) |
| 370 | (decode_coding_object, encode_coding_object) | 387 | (decode_coding_object, encode_coding_object) |
| 371 | (Fdetect_coding_region, Ffind_coding_systems_region_internal) | 388 | (Fdetect_coding_region, Ffind_coding_systems_region_internal) |
| 372 | (Funencodable_char_position, Fcheck_coding_systems_region): Use | 389 | (Funencodable_char_position, Fcheck_coding_systems_region): |
| 373 | B_. | 390 | Use B_. |
| 374 | * charset.c (Ffind_charset_region): Use B_. | 391 | * charset.c (Ffind_charset_region): Use B_. |
| 375 | * window.c (window_display_table, unshow_buffer, window_loop) | 392 | * window.c (window_display_table, unshow_buffer, window_loop) |
| 376 | (window_min_size_2, set_window_buffer, Fset_window_buffer) | 393 | (window_min_size_2, set_window_buffer, Fset_window_buffer) |
| @@ -601,8 +618,8 @@ | |||
| 601 | callers changed. | 618 | callers changed. |
| 602 | * editfns.c (general_insert_function): Change signature to | 619 | * editfns.c (general_insert_function): Change signature to |
| 603 | match changes to insert functions' signatures. | 620 | match changes to insert functions' signatures. |
| 604 | * keymap.c (map_keymap_char_table_item, map_keymap_internal): Use | 621 | * keymap.c (map_keymap_char_table_item, map_keymap_internal): |
| 605 | explicit cast when converting between void * and function pointer | 622 | Use explicit cast when converting between void * and function pointer |
| 606 | types, as C89 requires this. | 623 | types, as C89 requires this. |
| 607 | 624 | ||
| 608 | 2011-02-05 Paul Eggert <eggert@cs.ucla.edu> | 625 | 2011-02-05 Paul Eggert <eggert@cs.ucla.edu> |
| @@ -722,7 +739,7 @@ | |||
| 722 | 2011-02-01 Paul Eggert <eggert@cs.ucla.edu> | 739 | 2011-02-01 Paul Eggert <eggert@cs.ucla.edu> |
| 723 | 740 | ||
| 724 | format-time-string now supports subsecond time stamp resolution | 741 | format-time-string now supports subsecond time stamp resolution |
| 725 | * editfns.c (emacs_nmemftime): Renamed from emacs_memftimeu, | 742 | * editfns.c (emacs_nmemftime): Rename from emacs_memftimeu, |
| 726 | for consistency with its new argument and with gnulib nstrftime. | 743 | for consistency with its new argument and with gnulib nstrftime. |
| 727 | All callers changed. New argument NS. | 744 | All callers changed. New argument NS. |
| 728 | (Fformat_time_string): Check that the time argument's microseconds | 745 | (Fformat_time_string): Check that the time argument's microseconds |
| @@ -1052,11 +1069,11 @@ | |||
| 1052 | (history_delete_duplicates, inhibit_x_resources) | 1069 | (history_delete_duplicates, inhibit_x_resources) |
| 1053 | (last_nonmenu_event, load_in_progress, max_specpdl_size) | 1070 | (last_nonmenu_event, load_in_progress, max_specpdl_size) |
| 1054 | (minibuffer_auto_raise, print_escape_newlines, scroll_margin) | 1071 | (minibuffer_auto_raise, print_escape_newlines, scroll_margin) |
| 1055 | (use_dialog_box, use_file_dialog): Remove declaration. Include | 1072 | (use_dialog_box, use_file_dialog): Remove declaration. |
| 1056 | globals.h. | 1073 | Include globals.h. |
| 1057 | * keymap.h (Voverriding_local_map) | 1074 | * keymap.h (Voverriding_local_map) |
| 1058 | (Voverriding_local_map_menu_flag, meta_prefix_char): Remove | 1075 | (Voverriding_local_map_menu_flag, meta_prefix_char): |
| 1059 | declaration. | 1076 | Remove declaration. |
| 1060 | * keyboard.h (Vdouble_click_time, Vfunction_key_map) | 1077 | * keyboard.h (Vdouble_click_time, Vfunction_key_map) |
| 1061 | (Vinput_method_function, Vkey_translation_map) | 1078 | (Vinput_method_function, Vkey_translation_map) |
| 1062 | (Vlucid_menu_bar_dirty_flag, Vthis_original_command) | 1079 | (Vlucid_menu_bar_dirty_flag, Vthis_original_command) |
| @@ -1074,16 +1091,16 @@ | |||
| 1074 | (focus_follows_mouse): Remove declaration. | 1091 | (focus_follows_mouse): Remove declaration. |
| 1075 | * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist) | 1092 | * fontset.h (Valternate_fontname_alist, Vfontset_alias_alist) |
| 1076 | (Vignore_relative_composition, Votf_script_alist) | 1093 | (Vignore_relative_composition, Votf_script_alist) |
| 1077 | (Vuse_default_ascent, Vvertical_centering_font_regexp): Remove | 1094 | (Vuse_default_ascent, Vvertical_centering_font_regexp): |
| 1078 | declaration. | 1095 | Remove declaration. |
| 1079 | * font.h (Vfont_log): Remove declaration. | 1096 | * font.h (Vfont_log): Remove declaration. |
| 1080 | * dosfns.h (Vdos_display_scancodes, Vdos_version) | 1097 | * dosfns.h (Vdos_display_scancodes, Vdos_version) |
| 1081 | (Vdos_windows_version, dos_codepage, dos_country_code) | 1098 | (Vdos_windows_version, dos_codepage, dos_country_code) |
| 1082 | (dos_decimal_point, dos_hyper_key, dos_keyboard_layout) | 1099 | (dos_decimal_point, dos_hyper_key, dos_keyboard_layout) |
| 1083 | (dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove | 1100 | (dos_keypad_mode, dos_super_key, dos_timezone_offset): |
| 1084 | declaration. | 1101 | Remove declaration. |
| 1085 | * disptab.h (Vglyph_table, Vstandard_display_table): Remove | 1102 | * disptab.h (Vglyph_table, Vstandard_display_table): |
| 1086 | declaration. | 1103 | Remove declaration. |
| 1087 | * dispextern.h (Vface_remapping_alist, Vglyphless_char_display) | 1104 | * dispextern.h (Vface_remapping_alist, Vglyphless_char_display) |
| 1088 | (Vmouse_autoselect_window, Voverflow_newline_into_fringe) | 1105 | (Vmouse_autoselect_window, Voverflow_newline_into_fringe) |
| 1089 | (Vshow_trailing_whitespace, Vtool_bar_button_margin) | 1106 | (Vshow_trailing_whitespace, Vtool_bar_button_margin) |
| @@ -1111,10 +1128,10 @@ | |||
| 1111 | (Vselect_safe_coding_system_function) | 1128 | (Vselect_safe_coding_system_function) |
| 1112 | (Vtranslation_table_for_input, coding_system_require_warning) | 1129 | (Vtranslation_table_for_input, coding_system_require_warning) |
| 1113 | (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided) | 1130 | (eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided) |
| 1114 | (eol_mnemonic_unix, inherit_process_coding_system): Remove | 1131 | (eol_mnemonic_unix, inherit_process_coding_system): |
| 1115 | declaration. | 1132 | Remove declaration. |
| 1116 | * charset.h (Vcharset_list, Vcurrent_iso639_language): Remove | 1133 | * charset.h (Vcharset_list, Vcurrent_iso639_language): |
| 1117 | declaration. | 1134 | Remove declaration. |
| 1118 | * character.h (Vauto_fill_chars, Vchar_direction_table) | 1135 | * character.h (Vauto_fill_chars, Vchar_direction_table) |
| 1119 | (Vchar_script_table, Vchar_width_table, Vprintable_chars) | 1136 | (Vchar_script_table, Vchar_width_table, Vprintable_chars) |
| 1120 | (Vscript_representative_chars, Vtranslation_table_vector) | 1137 | (Vscript_representative_chars, Vtranslation_table_vector) |
| @@ -1229,8 +1246,8 @@ | |||
| 1229 | (w32_strict_fontnames, w32_strict_painting): Remove. | 1246 | (w32_strict_fontnames, w32_strict_painting): Remove. |
| 1230 | (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode) | 1247 | (Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode) |
| 1231 | (Vw32_recognize_altgr, Vwindow_system_version) | 1248 | (Vw32_recognize_altgr, Vwindow_system_version) |
| 1232 | (w32_num_mouse_buttons, w32_use_visible_system_caret): Remove | 1249 | (w32_num_mouse_buttons, w32_use_visible_system_caret): |
| 1233 | declaration. | 1250 | Remove declaration. |
| 1234 | * w32console.c (syms_of_ntterm): Update. | 1251 | * w32console.c (syms_of_ntterm): Update. |
| 1235 | (w32_use_full_screen_buffer): Remove. | 1252 | (w32_use_full_screen_buffer): Remove. |
| 1236 | (Vtty_defined_color_alist): Remove declaration. | 1253 | (Vtty_defined_color_alist): Remove declaration. |
diff --git a/src/alloc.c b/src/alloc.c index 566c6fe00b9..e8b8f45e9b1 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4842,8 +4842,6 @@ returns nil, because real GC can't be done. */) | |||
| 4842 | (void) | 4842 | (void) |
| 4843 | { | 4843 | { |
| 4844 | register struct specbinding *bind; | 4844 | register struct specbinding *bind; |
| 4845 | struct catchtag *catch; | ||
| 4846 | struct handler *handler; | ||
| 4847 | char stack_top_variable; | 4845 | char stack_top_variable; |
| 4848 | register int i; | 4846 | register int i; |
| 4849 | int message_p; | 4847 | int message_p; |
| @@ -4972,9 +4970,11 @@ returns nil, because real GC can't be done. */) | |||
| 4972 | for (i = 0; i < tail->nvars; i++) | 4970 | for (i = 0; i < tail->nvars; i++) |
| 4973 | mark_object (tail->var[i]); | 4971 | mark_object (tail->var[i]); |
| 4974 | } | 4972 | } |
| 4975 | #endif | ||
| 4976 | |||
| 4977 | mark_byte_stack (); | 4973 | mark_byte_stack (); |
| 4974 | { | ||
| 4975 | struct catchtag *catch; | ||
| 4976 | struct handler *handler; | ||
| 4977 | |||
| 4978 | for (catch = catchlist; catch; catch = catch->next) | 4978 | for (catch = catchlist; catch; catch = catch->next) |
| 4979 | { | 4979 | { |
| 4980 | mark_object (catch->tag); | 4980 | mark_object (catch->tag); |
| @@ -4985,7 +4985,9 @@ returns nil, because real GC can't be done. */) | |||
| 4985 | mark_object (handler->handler); | 4985 | mark_object (handler->handler); |
| 4986 | mark_object (handler->var); | 4986 | mark_object (handler->var); |
| 4987 | } | 4987 | } |
| 4988 | } | ||
| 4988 | mark_backtrace (); | 4989 | mark_backtrace (); |
| 4990 | #endif | ||
| 4989 | 4991 | ||
| 4990 | #ifdef HAVE_WINDOW_SYSTEM | 4992 | #ifdef HAVE_WINDOW_SYSTEM |
| 4991 | mark_fringe_data (); | 4993 | mark_fringe_data (); |
diff --git a/src/bytecode.c b/src/bytecode.c index a88df080c5a..cf4a1fc225f 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -229,6 +229,8 @@ Lisp_Object Qbytecode; | |||
| 229 | #define Bconstant 0300 | 229 | #define Bconstant 0300 |
| 230 | #define CONSTANTLIM 0100 | 230 | #define CONSTANTLIM 0100 |
| 231 | 231 | ||
| 232 | /* Whether to maintain a `top' and `bottom' field in the stack frame. */ | ||
| 233 | #define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK) | ||
| 232 | 234 | ||
| 233 | /* Structure describing a value stack used during byte-code execution | 235 | /* Structure describing a value stack used during byte-code execution |
| 234 | in Fbyte_code. */ | 236 | in Fbyte_code. */ |
| @@ -241,7 +243,9 @@ struct byte_stack | |||
| 241 | 243 | ||
| 242 | /* Top and bottom of stack. The bottom points to an area of memory | 244 | /* Top and bottom of stack. The bottom points to an area of memory |
| 243 | allocated with alloca in Fbyte_code. */ | 245 | allocated with alloca in Fbyte_code. */ |
| 246 | #if BYTE_MAINTAIN_TOP | ||
| 244 | Lisp_Object *top, *bottom; | 247 | Lisp_Object *top, *bottom; |
| 248 | #endif | ||
| 245 | 249 | ||
| 246 | /* The string containing the byte-code, and its current address. | 250 | /* The string containing the byte-code, and its current address. |
| 247 | Storing this here protects it from GC because mark_byte_stack | 251 | Storing this here protects it from GC because mark_byte_stack |
| @@ -268,6 +272,7 @@ struct byte_stack *byte_stack_list; | |||
| 268 | 272 | ||
| 269 | /* Mark objects on byte_stack_list. Called during GC. */ | 273 | /* Mark objects on byte_stack_list. Called during GC. */ |
| 270 | 274 | ||
| 275 | #if BYTE_MARK_STACK | ||
| 271 | void | 276 | void |
| 272 | mark_byte_stack (void) | 277 | mark_byte_stack (void) |
| 273 | { | 278 | { |
| @@ -292,7 +297,7 @@ mark_byte_stack (void) | |||
| 292 | mark_object (stack->constants); | 297 | mark_object (stack->constants); |
| 293 | } | 298 | } |
| 294 | } | 299 | } |
| 295 | 300 | #endif | |
| 296 | 301 | ||
| 297 | /* Unmark objects in the stacks on byte_stack_list. Relocate program | 302 | /* Unmark objects in the stacks on byte_stack_list. Relocate program |
| 298 | counters. Called when GC has completed. */ | 303 | counters. Called when GC has completed. */ |
| @@ -346,8 +351,13 @@ unmark_byte_stack (void) | |||
| 346 | /* Actions that must be performed before and after calling a function | 351 | /* Actions that must be performed before and after calling a function |
| 347 | that might GC. */ | 352 | that might GC. */ |
| 348 | 353 | ||
| 354 | #if !BYTE_MAINTAIN_TOP | ||
| 355 | #define BEFORE_POTENTIAL_GC() ((void)0) | ||
| 356 | #define AFTER_POTENTIAL_GC() ((void)0) | ||
| 357 | #else | ||
| 349 | #define BEFORE_POTENTIAL_GC() stack.top = top | 358 | #define BEFORE_POTENTIAL_GC() stack.top = top |
| 350 | #define AFTER_POTENTIAL_GC() stack.top = NULL | 359 | #define AFTER_POTENTIAL_GC() stack.top = NULL |
| 360 | #endif | ||
| 351 | 361 | ||
| 352 | /* Garbage collect if we have consed enough since the last time. | 362 | /* Garbage collect if we have consed enough since the last time. |
| 353 | We do this at every branch, to avoid loops that never GC. */ | 363 | We do this at every branch, to avoid loops that never GC. */ |
| @@ -447,10 +457,13 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 447 | stack.byte_string = bytestr; | 457 | stack.byte_string = bytestr; |
| 448 | stack.pc = stack.byte_string_start = SDATA (bytestr); | 458 | stack.pc = stack.byte_string_start = SDATA (bytestr); |
| 449 | stack.constants = vector; | 459 | stack.constants = vector; |
| 450 | stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) | 460 | top = (Lisp_Object *) alloca (XFASTINT (maxdepth) |
| 451 | * sizeof (Lisp_Object)); | 461 | * sizeof (Lisp_Object)); |
| 452 | top = stack.bottom - 1; | 462 | #if BYTE_MAINTAIN_TOP |
| 463 | stack.bottom = top; | ||
| 453 | stack.top = NULL; | 464 | stack.top = NULL; |
| 465 | #endif | ||
| 466 | top -= 1; | ||
| 454 | stack.next = byte_stack_list; | 467 | stack.next = byte_stack_list; |
| 455 | byte_stack_list = &stack; | 468 | byte_stack_list = &stack; |
| 456 | 469 | ||
diff --git a/src/lisp.h b/src/lisp.h index 7cc2a8e7d45..82c4f65613d 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2145,6 +2145,11 @@ struct gcpro | |||
| 2145 | #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE | 2145 | #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE |
| 2146 | #endif | 2146 | #endif |
| 2147 | 2147 | ||
| 2148 | /* Whether we do the stack marking manually. */ | ||
| 2149 | #define BYTE_MARK_STACK !(GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ | ||
| 2150 | || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) | ||
| 2151 | |||
| 2152 | |||
| 2148 | #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS | 2153 | #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS |
| 2149 | 2154 | ||
| 2150 | /* Do something silly with gcproN vars just so gcc shuts up. */ | 2155 | /* Do something silly with gcproN vars just so gcc shuts up. */ |
| @@ -3253,7 +3258,9 @@ extern Lisp_Object Qbytecode; | |||
| 3253 | EXFUN (Fbyte_code, 3); | 3258 | EXFUN (Fbyte_code, 3); |
| 3254 | extern void syms_of_bytecode (void); | 3259 | extern void syms_of_bytecode (void); |
| 3255 | extern struct byte_stack *byte_stack_list; | 3260 | extern struct byte_stack *byte_stack_list; |
| 3261 | #ifdef BYTE_MARK_STACK | ||
| 3256 | extern void mark_byte_stack (void); | 3262 | extern void mark_byte_stack (void); |
| 3263 | #endif | ||
| 3257 | extern void unmark_byte_stack (void); | 3264 | extern void unmark_byte_stack (void); |
| 3258 | 3265 | ||
| 3259 | /* Defined in macros.c */ | 3266 | /* Defined in macros.c */ |
diff --git a/src/term.c b/src/term.c index 21ed163c934..f082bb40e89 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -112,10 +112,7 @@ static void vfatal (const char *str, va_list ap) NO_RETURN; | |||
| 112 | #define OUTPUT_IF(tty, a) \ | 112 | #define OUTPUT_IF(tty, a) \ |
| 113 | do { \ | 113 | do { \ |
| 114 | if (a) \ | 114 | if (a) \ |
| 115 | emacs_tputs ((tty), a, \ | 115 | OUTPUT (tty, a); \ |
| 116 | (int) (FRAME_LINES (XFRAME (selected_frame)) \ | ||
| 117 | - curY (tty) ), \ | ||
| 118 | cmputc); \ | ||
| 119 | } while (0) | 116 | } while (0) |
| 120 | 117 | ||
| 121 | #define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) | 118 | #define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) |