repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 0713a2dcee88bb12a14f6b336204abe11a084389: path_to: revision_to:
commit 0713a2dcee88bb12a14f6b336204abe11a084389 Author: Marc LehmannDate: Mon May 28 16:40:03 2012 +0000 add some ecb_hot/ecb_cold diff --git a/Changes b/Changes
--- a/Changes
+++ b/Changes
@@ -42,6 +42,8 @@ TODO: DEC PM 4h/4l should toggle jumpscroll on or off (PrivMode_smoothScroll)
- allocate all screen memory in one go and let the virtual memory
subsystem sort it out. this simplifies code, improves access
locality, saves a bit of ram and makes thigs a bit faster, too.
+ - selectively mark some methods as cache-hot/cache cold, which
+ might speed up execution but deifnitely decreases codesize.
9.15 Sat Jan 21 13:36:56 CET 2012
- remove "using namespace std" because clang erroneously
diff --git a/src/command.C b/src/command.C
--- a/src/command.C
+++ b/src/command.C
@@ -133,7 +133,7 @@ static unsigned short iso14755_symtab[] = {
0,
};
-void
+void ecb_cold
rxvt_term::iso14755_54 (int x, int y)
{
x = Pixel2Col (x);
@@ -160,7 +160,7 @@ rxvt_term::iso14755_54 (int x, int y)
}
}
-void
+void ecb_cold
rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
{
rxvt_fontset *fs = FONTSET (r);
@@ -256,7 +256,7 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
}
#endif
-void
+void ecb_cold
rxvt_term::commit_iso14755 ()
{
wchar_t ch = iso14755buf & ISO_14755_MASK;
@@ -284,7 +284,7 @@ rxvt_term::commit_iso14755 ()
iso14755buf = 0;
}
-static int
+static int ecb_cold
hex_keyval (XKeyEvent &ev)
{
// check whether this event corresponds to a hex digit
@@ -303,7 +303,7 @@ hex_keyval (XKeyEvent &ev)
}
#endif
-static inline KeySym
+static inline KeySym ecb_cold
translate_keypad (KeySym keysym, bool kp)
{
#ifdef XK_KP_Home
@@ -339,7 +339,7 @@ translate_keypad (KeySym keysym, bool kp)
return keysym;
}
-static inline int
+static inline int ecb_cold
map_function_key (KeySym keysym)
{
int param = 0;
@@ -398,7 +398,7 @@ map_function_key (KeySym keysym)
return param;
}
-void
+void ecb_cold
rxvt_term::key_press (XKeyEvent &ev)
{
int ctrl, meta, shft, len;
@@ -857,7 +857,7 @@ rxvt_term::key_press (XKeyEvent &ev)
tt_write (kbuf, (unsigned int)len);
}
-void
+void ecb_cold
rxvt_term::key_release (XKeyEvent &ev)
{
#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL
@@ -1221,7 +1221,7 @@ rxvt_term::pty_cb (ev::io &w, int revents)
refresh_check ();
}
-void
+void ecb_cold
rxvt_term::pointer_unblank ()
{
XDefineCursor (dpy, vt, TermWin_cursor);
@@ -1236,7 +1236,7 @@ rxvt_term::pointer_unblank ()
}
#ifdef POINTER_BLANK
-void
+void ecb_cold
rxvt_term::pointer_blank ()
{
if (!option (Opt_pointerBlank))
@@ -1248,7 +1248,7 @@ rxvt_term::pointer_blank ()
hidden_pointer = 1;
}
-void
+void ecb_cold
rxvt_term::pointer_cb (ev::timer &w, int revents)
{
make_current ();
@@ -1350,7 +1350,7 @@ rxvt_term::mouse_report (XButtonEvent &ev)
}
/*{{{ process an X event */
-void
+void ecb_hot
rxvt_term::x_cb (XEvent &ev)
{
make_current ();
@@ -1715,7 +1715,7 @@ rxvt_term::x_cb (XEvent &ev)
}
#if ENABLE_FRILLS
-void
+void ecb_cold
rxvt_term::set_urgency (bool enable)
{
if (enable == urgency_hint)
@@ -1731,7 +1731,7 @@ rxvt_term::set_urgency (bool enable)
}
#endif
-void
+void ecb_cold
rxvt_term::focus_in ()
{
if (!focus)
@@ -1766,7 +1766,7 @@ rxvt_term::focus_in ()
}
}
-void
+void ecb_cold
rxvt_term::focus_out ()
{
if (focus)
@@ -1809,7 +1809,7 @@ rxvt_term::focus_out ()
}
}
-void
+void ecb_cold
rxvt_term::update_fade_color (unsigned int idx)
{
#if OFF_FOCUS_FADING
@@ -1823,7 +1823,7 @@ rxvt_term::update_fade_color (unsigned int idx)
}
#if ENABLE_TRANSPARENCY || ENABLE_PERL
-void
+void ecb_hot
rxvt_term::rootwin_cb (XEvent &ev)
{
make_current ();
@@ -2217,7 +2217,7 @@ rxvt_term::button_release (XButtonEvent &ev)
/*}}} */
-void
+void ecb_hot
rxvt_term::cmd_parse ()
{
wchar_t ch = NOCHAR;
@@ -2346,7 +2346,7 @@ rxvt_term::cmd_parse ()
}
// read the next character
-wchar_t
+wchar_t ecb_hot
rxvt_term::next_char () NOTHROW
{
while (cmdbuf_ptr < cmdbuf_endp)
@@ -2380,7 +2380,7 @@ rxvt_term::next_char () NOTHROW
}
// read the next octet
-uint32_t
+uint32_t ecb_hot
rxvt_term::next_octet () NOTHROW
{
return cmdbuf_ptr < cmdbuf_endp
@@ -2390,7 +2390,7 @@ rxvt_term::next_octet () NOTHROW
static class out_of_input out_of_input;
-wchar_t
+wchar_t ecb_hot
rxvt_term::cmd_getc () THROW ((class out_of_input))
{
wchar_t c = next_char ();
@@ -2401,7 +2401,7 @@ rxvt_term::cmd_getc () THROW ((class out_of_input))
return c;
}
-uint32_t
+uint32_t ecb_hot
rxvt_term::cmd_get8 () THROW ((class out_of_input))
{
uint32_t c = next_octet ();
@@ -2415,7 +2415,7 @@ rxvt_term::cmd_get8 () THROW ((class out_of_input))
/*{{{ print pipe */
/*----------------------------------------------------------------------*/
#ifdef PRINTPIPE
-FILE *
+FILE * ecb_cold
rxvt_term::popen_printer ()
{
FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w");
@@ -2426,7 +2426,7 @@ rxvt_term::popen_printer ()
return stream;
}
-int
+int ecb_cold
rxvt_term::pclose_printer (FILE *stream)
{
fflush (stream);
@@ -2436,7 +2436,7 @@ rxvt_term::pclose_printer (FILE *stream)
/*
* simulate attached vt100 printer
*/
-void
+void ecb_cold
rxvt_term::process_print_pipe ()
{
FILE *fd = popen_printer ();
@@ -2501,7 +2501,7 @@ enum {
};
/*{{{ process non-printing single characters */
-void
+void ecb_hot
rxvt_term::process_nonprinting (unicode_t ch)
{
switch (ch)
@@ -2557,7 +2557,7 @@ rxvt_term::process_nonprinting (unicode_t ch)
/*{{{ process VT52 escape sequences */
-void
+void ecb_cold
rxvt_term::process_escape_vt52 (unicode_t ch)
{
int row, col;
@@ -2617,7 +2617,7 @@ rxvt_term::process_escape_vt52 (unicode_t ch)
/*{{{ process escape sequences */
-void
+void ecb_hot
rxvt_term::process_escape_seq ()
{
unicode_t ch = cmd_getc ();
@@ -2779,7 +2779,7 @@ static const unsigned char csi_defaults[] =
make_byte (0,0,0,0,0,0,0,0), /* x, y, z, {, |, }, ~, */
};
-void
+void ecb_hot
rxvt_term::process_csi_seq ()
{
unicode_t ch, priv, i;
@@ -3598,7 +3598,7 @@ rxvt_term::process_xterm_seq (int op, char *str, char resp)
* 't' = toggle
* so no need for fancy checking
*/
-int
+int ecb_cold
rxvt_term::privcases (int mode, unsigned long bit)
{
int state;
@@ -3828,7 +3828,7 @@ rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int na
/*}}} */
/*{{{ process sgr sequences */
-void
+void ecb_hot
rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg)
{
unsigned int i;
diff --git a/src/init.C b/src/init.C
--- a/src/init.C +++ b/src/init.C @@ -78,7 +78,7 @@ #include#include -static char * +static char * ecb_cold rxvt_network_display (const char *display) { char buffer[1024], *rval = NULL; diff --git a/src/main.C b/src/main.C
--- a/src/main.C
+++ b/src/main.C
@@ -376,7 +376,7 @@ rxvt_emergency_cleanup ()
}
#if !ENABLE_MINIMAL
-static void
+static void ecb_cold
print_x_error (Display *dpy, XErrorEvent *event)
{
char buffer[BUFSIZ];
@@ -424,7 +424,7 @@ print_x_error (Display *dpy, XErrorEvent *event)
}
#endif
-int
+int ecb_cold
rxvt_xerror_handler (Display *display, XErrorEvent *event)
{
if (GET_R->allowedxerror == -1)
@@ -443,7 +443,7 @@ rxvt_xerror_handler (Display *display, XErrorEvent *event)
return 0;
}
-int
+int ecb_cold
rxvt_xioerror_handler (Display *display)
{
rxvt_warn ("X connection to '%s' broken, unable to recover, exiting.\n",
diff --git a/src/rxvt.h b/src/rxvt.h
--- a/src/rxvt.h +++ b/src/rxvt.h @@ -149,8 +149,8 @@ const char * rxvt_basename (const char *str) NOTHROW; void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; void rxvt_log (const char *fmt,...) NOTHROW; void rxvt_warn (const char *fmt,...) NOTHROW; -void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn; -void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn; +void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn ecb_cold; +void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn ecb_cold; char * rxvt_strtrim (char *str) NOTHROW; char ** rxvt_strsplit (char delim, const char *str) NOTHROW; diff --git a/src/screen.C b/src/screen.C
--- a/src/screen.C
+++ b/src/screen.C
@@ -157,7 +157,7 @@ rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW
* ------------------------------------------------------------------------- */
void
-rxvt_term::scr_alloc ()
+rxvt_term::scr_alloc () NOTHROW
{
int tsize = sizeof (text_t) * ncol;
int rsize = sizeof (rend_t) * ncol;
@@ -190,7 +190,7 @@ rxvt_term::scr_alloc ()
row_buf = swap_buf + nrow;
}
-void
+void ecb_cold
rxvt_term::scr_reset ()
{
#if ENABLE_OVERLAY
@@ -432,7 +432,7 @@ rxvt_term::scr_reset ()
/*
* Free everything. That way malloc debugging can find leakage.
*/
-void
+void ecb_cold
rxvt_term::scr_release () NOTHROW
{
free (chunk);
@@ -443,7 +443,7 @@ rxvt_term::scr_release () NOTHROW
/*
* Hard/Soft reset
*/
-void
+void ecb_cold
rxvt_term::scr_poweron ()
{
scr_release ();
@@ -459,7 +459,7 @@ rxvt_term::scr_poweron ()
scr_refresh ();
}
-void
+void ecb_cold
rxvt_term::scr_soft_reset () NOTHROW
{
/* only affects modes, nothing drastic such as clearing the screen */
@@ -635,7 +635,7 @@ rxvt_term::scr_rendition (int set, int style) NOTHROW
* count positive ==> scroll up
* count negative ==> scroll down
*/
-int
+int ecb_hot
rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
{
if (count == 0 || (row1 > row2))
@@ -779,7 +779,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
/*
* Add text given in of length to screen struct
*/
-void
+void ecb_hot
rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW
{
if (len <= 0) /* sanity */
@@ -1139,7 +1139,7 @@ rxvt_term::scr_tab (int count, bool ht) NOTHROW
* in that row right. Clear left column.
*/
#if !ENABLE_MINIMAL
-void
+void ecb_cold
rxvt_term::scr_backindex () NOTHROW
{
if (screen.cur.col > 0)
@@ -1156,7 +1156,7 @@ rxvt_term::scr_backindex () NOTHROW
* in that row left. Clear right column.
*/
#if !ENABLE_MINIMAL
-void
+void ecb_cold
rxvt_term::scr_forwardindex () NOTHROW
{
if (screen.cur.col < ncol - 1)
@@ -1417,7 +1417,7 @@ rxvt_term::scr_erase_savelines () NOTHROW
* Fill the screen with `E's
* XTERM_SEQ: Screen Alignment Test: ESC # 8
*/
-void
+void ecb_cold
rxvt_term::scr_E () NOTHROW
{
rend_t fs;
@@ -1591,7 +1591,7 @@ rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW
* Set the scrolling region
* XTERM_SEQ: Set region - inclusive: ESC [ ; r
*/
-void
+void ecb_cold
rxvt_term::scr_scroll_region (int top, int bot) NOTHROW
{
max_it (top, 0);
@@ -1611,7 +1611,7 @@ rxvt_term::scr_scroll_region (int top, int bot) NOTHROW
* XTERM_SEQ: Make cursor visible : ESC [ ? 25 h
* XTERM_SEQ: Make cursor invisible: ESC [ ? 25 l
*/
-void
+void ecb_cold
rxvt_term::scr_cursor_visible (int mode) NOTHROW
{
want_refresh = 1;
@@ -1628,7 +1628,7 @@ rxvt_term::scr_cursor_visible (int mode) NOTHROW
* XTERM_SEQ: Set Wraparound : ESC [ ? 7 h
* XTERM_SEQ: Unset Wraparound: ESC [ ? 7 l
*/
-void
+void ecb_cold
rxvt_term::scr_autowrap (int mode) NOTHROW
{
if (mode)
@@ -1647,7 +1647,7 @@ rxvt_term::scr_autowrap (int mode) NOTHROW
* XTERM_SEQ: Set Absolute: ESC [ ? 6 h
* XTERM_SEQ: Set Relative: ESC [ ? 6 l
*/
-void
+void ecb_cold
rxvt_term::scr_relative_origin (int mode) NOTHROW
{
if (mode)
@@ -1664,7 +1664,7 @@ rxvt_term::scr_relative_origin (int mode) NOTHROW
* XTERM_SEQ: Set Insert mode : ESC [ ? 4 h
* XTERM_SEQ: Set Replace mode: ESC [ ? 4 l
*/
-void
+void ecb_cold
rxvt_term::scr_insert_mode (int mode) NOTHROW
{
if (mode)
@@ -1680,7 +1680,7 @@ rxvt_term::scr_insert_mode (int mode) NOTHROW
* XTERM_SEQ: Clear tab at current column: ESC [ 0 g
* XTERM_SEQ: Clear all tabs : ESC [ 3 g
*/
-void
+void ecb_cold
rxvt_term::scr_set_tab (int mode) NOTHROW
{
if (mode < 0)
@@ -1729,7 +1729,7 @@ rxvt_term::scr_rvideo_mode (bool on) NOTHROW
* Report current cursor position
* XTERM_SEQ: Report position: ESC [ 6 n
*/
-void
+void ecb_cold
rxvt_term::scr_report_position () NOTHROW
{
tt_printf ("\033[%d;%dR", screen.cur.row + 1, screen.cur.col + 1);
@@ -1742,7 +1742,7 @@ rxvt_term::scr_report_position () NOTHROW
/*
* Set font style
*/
-void
+void ecb_cold
rxvt_term::set_font_style () NOTHROW
{
#if 0
@@ -1774,7 +1774,7 @@ rxvt_term::set_font_style () NOTHROW
* XTERM_SEQ: Invoke G2 character set: ESC N
* XTERM_SEQ: Invoke G3 character set: ESC O
*/
-void
+void ecb_cold
rxvt_term::scr_charset_choose (int set) NOTHROW
{
screen.charset = set;
@@ -1805,7 +1805,7 @@ rxvt_term::scr_charset_set (int set, unsigned int ch) NOTHROW
/*
* refresh matching text.
*/
-bool
+bool ecb_cold
rxvt_term::scr_refresh_rend (rend_t mask, rend_t value) NOTHROW
{
bool found = false;
@@ -1834,7 +1834,7 @@ enum {
RC_COUNT
};
-void
+void ecb_hot
rxvt_term::scr_expose (int x, int y, int ewidth, int eheight, bool refresh) NOTHROW
{
int i;
@@ -1970,7 +1970,7 @@ rxvt_term::scr_bell () NOTHROW
}
/* ------------------------------------------------------------------------- */
-void
+void ecb_cold
rxvt_term::scr_printscreen (int fullhist) NOTHROW
{
#ifdef PRINTPIPE
@@ -2029,7 +2029,7 @@ rxvt_term::scr_printscreen (int fullhist) NOTHROW
* drawn_text/drawn_rend contain the screen information before the update.
* screen.text/screen.rend contain what the screen will change to.
*/
-void
+void ecb_hot
rxvt_term::scr_refresh () NOTHROW
{
int16_t col, row, /* column/row we're processing */
@@ -2505,7 +2505,7 @@ rxvt_term::scr_refresh () NOTHROW
num_scr_allow = 1;
}
-void
+void ecb_cold
rxvt_term::scr_remap_chars (line_t &l) NOTHROW
{
if (!l.valid ())
@@ -2517,7 +2517,7 @@ rxvt_term::scr_remap_chars (line_t &l) NOTHROW
l.r[i] = SET_FONT (l.r[i], FONTSET (l.r[i])->find_font (l.t[i]));
}
-void
+void ecb_cold
rxvt_term::scr_remap_chars () NOTHROW
{
for (int i = total_rows; i--; )
@@ -2530,7 +2530,7 @@ rxvt_term::scr_remap_chars () NOTHROW
}
}
-void
+void ecb_cold
rxvt_term::scr_recolour (bool refresh) NOTHROW
{
bool transparent = false;
@@ -2643,7 +2643,7 @@ rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, ren
}
/* ------------------------------------------------------------------------- */
-void
+void ecb_hot
rxvt_term::scr_reverse_selection () NOTHROW
{
if (selection.op
@@ -2944,7 +2944,7 @@ rxvt_term::selection_grab (Time tm, bool clipboard) NOTHROW
* Mark or select text based upon number of clicks: 1, 2, or 3
* EXT: button 1 press
*/
-void
+void ecb_cold
rxvt_term::selection_click (int clicks, int x, int y) NOTHROW
{
clicks = ((clicks - 1) % 3) + 1;
@@ -2973,7 +2973,7 @@ rxvt_term::selection_click (int clicks, int x, int y) NOTHROW
/*
* Mark a selection at the specified col/row
*/
-void
+void ecb_cold
rxvt_term::selection_start_colrow (int col, int row) NOTHROW
{
want_refresh = 1;
@@ -3010,7 +3010,7 @@ rxvt_term::selection_start_colrow (int col, int row) NOTHROW
(unicode::is_space (x) ? 2 : (x) <= 0xff && !!strchr (rs[Rs_cutchars], (x)))
#define DELIMIT_REND(x) 1
-void
+void ecb_cold
rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) NOTHROW
{
int col, row, dirnadd, tcol, trow, w1, w2;
@@ -3094,7 +3094,7 @@ rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, r
* flag == 1 ==> button 3 press
* flag == 2 ==> button 3 motion
*/
-void
+void ecb_cold
rxvt_term::selection_extend (int x, int y, int flag) NOTHROW
{
int col = clamp (Pixel2Col (x), 0, ncol);
@@ -3130,7 +3130,7 @@ rxvt_term::selection_extend (int x, int y, int flag) NOTHROW
/*
* Extend the selection to the specified col/row
*/
-void
+void ecb_cold
rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange) NOTHROW
{
row_col_t pos;
@@ -3331,7 +3331,7 @@ rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int b
}
#if !ENABLE_MINIMAL
-void
+void ecb_cold
rxvt_term::selection_remove_trailing_spaces () NOTHROW
{
int32_t end_col, end_row;
@@ -3379,7 +3379,7 @@ rxvt_term::selection_remove_trailing_spaces () NOTHROW
* Double click on button 3 when already selected
* EXT: button 3 double click
*/
-void
+void ecb_cold
rxvt_term::selection_rotate (int x, int y) NOTHROW
{
selection.clicks = selection.clicks % 3 + 1;
@@ -3391,7 +3391,7 @@ rxvt_term::selection_rotate (int x, int y) NOTHROW
* Respond to a request for our current selection
* EXT: SelectionRequest
*/
-void
+void ecb_cold
rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW
{
Atom property = rq.property == None ? rq.target : rq.property;
@@ -3535,7 +3535,7 @@ rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW
/* ------------------------------------------------------------------------- */
#ifdef USE_XIM
-void
+void ecb_cold
rxvt_term::im_set_position (XPoint &pos) NOTHROW
{
XWindowAttributes xwa;
-----END OF PAGE-----