]> code.delx.au - gnu-emacs/blobdiff - src/bytecode.c
Don't install keyboard hook when debugged on MS-Windows
[gnu-emacs] / src / bytecode.c
index 864db1a0bed394da04297e739b1f9a4ee05d910c..c9e4a25dfa608da8abf8d7fc7e6b13d740dd8b7d 100644 (file)
@@ -1,13 +1,13 @@
 /* Execution of byte code produced by bytecomp.el.
-   Copyright (C) 1985-1988, 1993, 2000-2015 Free Software Foundation,
+   Copyright (C) 1985-1988, 1993, 2000-2016 Free Software Foundation,
    Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -637,7 +637,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
         the table clearer.  */
 #define LABEL(OP) [OP] = &&insn_ ## OP
 
-#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+#if GNUC_PREREQ (4, 6, 0)
 # pragma GCC diagnostic push
 # pragma GCC diagnostic ignored "-Woverride-init"
 #elif defined __clang__
@@ -656,7 +656,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 #undef DEFINE
        };
 
-#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) || defined __clang__
+#if GNUC_PREREQ (4, 6, 0) || defined __clang__
 # pragma GCC diagnostic pop
 #endif
 
@@ -1067,17 +1067,13 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
          type = CATCHER;
          goto pushhandler;
        CASE (Bpushconditioncase): /* New in 24.4.  */
+         type = CONDITION_CASE;
+       pushhandler:
          {
-           struct handler *c;
-           Lisp_Object tag;
-           int dest;
+           Lisp_Object tag = POP;
+           int dest = FETCH2;
 
-           type = CONDITION_CASE;
-         pushhandler:
-           tag = POP;
-           dest = FETCH2;
-
-           PUSH_HANDLER (c, tag, type);
+           struct handler *c = push_handler (tag, type);
            c->bytecode_dest = dest;
            c->bytecode_top = top;
 
@@ -1991,6 +1987,20 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
   return result;
 }
 
+/* `args_template' has the same meaning as in exec_byte_code() above.  */
+Lisp_Object
+get_byte_code_arity (Lisp_Object args_template)
+{
+  eassert (NATNUMP (args_template));
+  EMACS_INT at = XINT (args_template);
+  bool rest = (at & 128) != 0;
+  int mandatory = at & 127;
+  EMACS_INT nonrest = at >> 8;
+
+  return Fcons (make_number (mandatory),
+               rest ? Qmany : make_number (nonrest));
+}
+
 void
 syms_of_bytecode (void)
 {
@@ -2000,9 +2010,9 @@ syms_of_bytecode (void)
 
   DEFVAR_LISP ("byte-code-meter", Vbyte_code_meter,
               doc: /* A vector of vectors which holds a histogram of byte-code usage.
-(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
+\(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
 opcode CODE has been executed.
-(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,
+\(aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,
 indicates how many times the byte opcodes CODE1 and CODE2 have been
 executed in succession.  */);