Mercurial > hg > xemacs-beta
view lisp/dumped-lisp.el @ 4921:17362f371cc2
add more byte-code assertions and better failure output
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-03 Ben Wing <ben@xemacs.org>
* alloc.c (Fmake_byte_code):
* bytecode.h:
* lisp.h:
* lread.c:
* lread.c (readevalloop):
* lread.c (Fread):
* lread.c (Fread_from_string):
* lread.c (read_list_conser):
* lread.c (read_list):
* lread.c (vars_of_lread):
* symbols.c:
* symbols.c (Fdefine_function):
Turn on the "compiled-function annotation hack". Implement it
properly by hooking into Fdefalias(). Note in the docstring to
`defalias' that we do this. Remove some old broken code and
change code that implemented the old kludgy way of hooking into
the Lisp reader into bracketed by `#ifdef
COMPILED_FUNCTION_ANNOTATION_HACK_OLD_WAY', which is not enabled.
Also enable byte-code metering when DEBUG_XEMACS -- this is a form
of profiling for computing histograms of which sequences of two
bytecodes are used most often.
* bytecode-ops.h:
* bytecode-ops.h (OPCODE):
New file. Extract out all the opcodes and declare them using
OPCODE(), a bit like frame slots and such. This way the file can
be included multiple times if necessary to iterate multiple times
over the byte opcodes.
* bytecode.c:
* bytecode.c (NUM_REMEMBERED_BYTE_OPS):
* bytecode.c (OPCODE):
* bytecode.c (assert_failed_with_remembered_ops):
* bytecode.c (READ_UINT_2):
* bytecode.c (READ_INT_1):
* bytecode.c (READ_INT_2):
* bytecode.c (PEEK_INT_1):
* bytecode.c (PEEK_INT_2):
* bytecode.c (JUMP_RELATIVE):
* bytecode.c (JUMP_NEXT):
* bytecode.c (PUSH):
* bytecode.c (POP_WITH_MULTIPLE_VALUES):
* bytecode.c (DISCARD):
* bytecode.c (UNUSED):
* bytecode.c (optimize_byte_code):
* bytecode.c (optimize_compiled_function):
* bytecode.c (Fbyte_code):
* bytecode.c (vars_of_bytecode):
* bytecode.c (init_opcode_table_multi_op):
* bytecode.c (reinit_vars_of_bytecode):
* emacs.c (main_1):
* eval.c (funcall_compiled_function):
* symsinit.h:
Any time we change either the instruction pointer or the stack
pointer, assert that we're going to move it to a valid location.
This should catch failures right when they occur rather than
sometime later. This requires that we pass in another couple of
parameters into some functions (only with error-checking enabled,
see below).
Also keep track, using a circular queue, of the last 100 byte
opcodes seen, and when we hit an assert failure during byte-code
execution, output the contents of the queue in a nice readable
fashion. This requires that bytecode-ops.h be included a second
time so that a table mapping opcodes to the name of their operation
can be constructed. This table is constructed in new function
reinit_vars_of_bytecode().
Everything in the last two paras happens only when
ERROR_CHECK_BYTE_CODE.
Add some longish comments describing how the arrays that hold the
stack and instructions, and the pointers used to access them, work.
* gc.c:
Import some code from my `latest-fix' workspace to mark the
staticpro's in order from lowest to highest, rather than highest to
lowest, so it's easier to debug when something goes wrong.
* lisp.h (abort_with_message): Renamed from abort_with_msg().
* symbols.c (defsymbol_massage_name_1):
* symbols.c (defsymbol_nodump):
* symbols.c (defsymbol):
* symbols.c (defkeyword):
* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
Make the various calls to staticpro() instead call staticpro_1(),
passing in the name of the C var being staticpro'ed, so that it
shows up in staticpro_names. Otherwise staticpro_names just has
1000+ copies of the word `location'.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 03 Feb 2010 08:01:55 -0600 |
parents | bd28481bb0e1 |
children | c673987f5f3d 8b2f75cecb89 |
line wrap: on
line source
(defvar packages-hardcoded-lisp '( ;; Nothing at this time ) "Lisp packages that are always dumped with XEmacs. This includes every package that is loaded directly by a package listed in dumped-lisp.el and is not itself listed.") ;; WARNING WARNING WARNING: None of the files below, until where it says ;; "All files after this can have extended characters in them", can have ;; extended (non-ASCII characters) of any sort in them! Unfortunately, you ;; will not get any error at load-time; however, you may get a later very ;; cryptic error "Invalid opcode"! This is caused by the byte-code data ;; being encoded as escape-quoted, when we can't handle that yet. ;; ;; #### We should resurrect the check for the coding-system magic cookie in ;; fileio.c and put in an abort if we are not able to handle it yet. (setq preloaded-file-list (list ;; do not defcustom any variables in these files "backquote" ; needed for defsubst etc. "bytecomp-runtime" ; define defsubst "find-paths" "packages" ; Bootstrap run-time lisp environment "setup-paths" ;; use custom-declare-variable-early, not defcustom, in these files "subr" ; load the most basic Lisp functions "post-gc" "replace" ; match-string used in version.el. "version" "cl" "cl-extra" "cl-seq" "widget" "custom" ; Before the world so everything can be ; customized "cus-start" ; for customization of builtin variables ;; OK, you can use defcustom from here on "cmdloop" "keymap" "syntax" "device" "console" "obsolete" "specifier" "frame" ; needed by faces ;; #### this should be (featurep 'xft) (when (featurep 'xft-fonts) "fontconfig") ; needed by x-faces (when (featurep 'x) "x-faces") ; needed by faces (when (featurep 'gtk) "gtk-faces") (when (valid-console-type-p 'mswindows) "msw-faces") "faces" ; must be loaded before any make-face call ;;(pureload "facemenu") #### not yet ported "glyphs" "objects" "extents" "events" "hash-table" "text-props" "process" ;; This is bad. network-streams may not be defined. (when (featurep 'multicast) "multicast") ; #+network-streams implicitly true "map-ynp" "undo-stack" "window" ; simple needs `save-window-excursion' "window-xemacs" "resize-minibuffer" ; simple needs `resize-minibuffer-mode' "simple" "newcomment" "keydefs" ; Before loaddefs so that keymap vars exist. "abbrev" "derived" "minibuf" "list-mode" "modeline" ; needs simple.el to be loaded first ;; If SparcWorks support is included some additional packages are ;; dumped which would normally have autoloads. To avoid ;; duplicate doc string warnings, SparcWorks uses a separate ;; autoloads file with the dumped packages removed. ;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!! ;; So just make loaddefs-eos go away... ;;(pureload (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs")) "cus-file" "startup" ; For initialization of ; `emacs-user-extension-dir' "misc" ;; (pureload "profile") "loadhist" ; Must be dumped before loaddefs is loaded ; Used by help. ;; (pureload "hyper-apropos") Soon... "files" "lib-complete" "format" "indent" "isearch-mode" "buffer" "buff-menu" "paths" "lisp" "page" "register" "iso8859-1" ; This must be before any modes ; (sets standard syntax table.) "easy-mmode" ; Added for 21.5. Used by help. "help" "easymenu" ; Added for 20.3. "lisp-mode" "text-mode" "fill" "auto-save" ; Added for 20.4 "movemail" ; Added for 21.2 (when (eq system-type 'windows-nt) "win32-native") (when (featurep 'lisp-float-type) "float-sup") "itimer" ; for vars auto-save-timeout and ; auto-gc-threshold "itimer-autosave" "printer" "behavior" "behavior-defs" "diagnose" ;;;;;;;;;;;;;;;;;; GUI support (when (featurep 'window-system) '("gui" "mouse" "mode-motion" )) (when (featurep 'toolbar) "toolbar") (when (featurep 'scrollbar) "scrollbar") (when (featurep 'menubar) "menubar") (when (featurep 'dialog) "dialog") (when (featurep 'gutter) "gutter") (when (featurep 'dragdrop-api) "dragdrop") "select" ;;;;;;;;;;;;;;;;;; Content for GUI's ;; There used to be window-system inserted in the when-feature, ;; but IMHO your configure script should turn off the menubar, ;; toolbar, etc. features when there is no window system. We ;; should just be able to assume that, if (featurep 'menubar), ;; the menubar should work and if items are added, they can be ;; seen clearly and usefully. (when (featurep '(and (not infodock) menubar)) "menubar-items") (when (featurep '(and gutter)) "gutter-items") (when (featurep '(and (not infodock) toolbar)) "toolbar-items") (when (featurep '(and (not infodock) dialog)) "dialog-items") ;;;;;;;;;;;;;;;;;; Coding-system support "coding" "code-files" ;; Handle process with encoding/decoding coding-system. "code-process" ;; Provide basic commands to set coding systems to user "code-cmds" "unicode" ;;;;;;;;;;;;;;;;;; MULE support (when (featurep 'mule) '("mule/mule-charset" "mule/mule-cmds" ; to sync with Emacs 20.1 "mule/mule-coding" "mule/mule-composite-stub" "mule/mule-composite" )) ;; may initialize coding systems (when (featurep '(and mule x)) "mule/mule-x-init") (when (featurep '(and mule tty)) "mule/mule-tty-init") (when (and (featurep 'mule) (memq system-type '(windows-nt cygwin32))) "mule/mule-win32-init") "code-init" ; set up defaults ;; All files after this can have extended characters in them. (when (featurep 'mule) '("mule/mule-category" "mule/kinsoku" )) ;; after this goes the specific lisp routines for a particular input system ;; 97.2.5 JHod Shouldn't these go into a site-load file to allow site ;; or user switching of input systems??? ;(if (featurep 'wnn) ; (progn ; (pureload "egg") ; (pureload "egg-wnn") ; (setq egg-default-startup-file "eggrc-wnn"))) ;; (if (and (boundp 'CANNA) CANNA) ;; (pureload "canna") ;; ) ;; Now load files to set up all the different languages/environments that ;; Mule knows about. Formerly we had to worry about files shadowed by ;; those of the same name in leim/quail.el, but no longer, since we now ;; compile with -no-packages. (when (featurep 'mule) '("mule/arabic" "mule/chinese" "mule/cyrillic" "mule/english" "mule/ethiopic" "mule/greek" "mule/hebrew" "mule/indian" "mule/devanagari" ; must be loaded after indian.el "mule/japanese" "mule/korean" "mule/lao" ; sucks. "mule/latin" "mule/misc-lang" ;; "thai" #### merge thai and thai-xtis!!! ;; #### Even better; take out thai-xtis! It's not even a ;; standard, and no-one uses it. "mule/thai-xtis" "mule/tibetan" "mule/vietnamese" )) ;; Specialized language support (when (featurep 'mule) "mule/canna-leim") ;; needs access to the charsets created by the above ;; language-specific files. (when (and (featurep 'mule) (valid-console-type-p 'mswindows)) "mule/mule-msw-init-late") (when (featurep 'mule) "mule/general-late") ;;; mule-load.el ends here ;; preload InfoDock stuff. should almost certainly not be here if ;; id-menus is not here. infodock needs to figure out a clever way to ;; advise this stuff or we need to export a clean way for infodock or ;; others to control this programmatically. (when (featurep '(and infodock (or x mswindows gtk) menubar)) "id-menus") ;; preload the X code. (when (featurep '(and x scrollbar)) "x-scrollbar") (when (featurep 'x) '("x-mouse" "x-select" "x-misc" "x-init" "x-win-xfree86" "x-win-sun")) ;; preload the GTK code (when (featurep 'gtk) '("gtk-ffi" "gtk-widgets" "gdk" "gtk-init" "gtk-select" "gtk-mouse" "gtk-glyphs" "widgets-gtk")) (when (featurep '(and gtk dialog)) "dialog-gtk") (when (featurep 'glade) "glade") ;; preload the mswindows code. (when (valid-console-type-p 'mswindows) '("msw-glyphs" "msw-mouse" "msw-init" "msw-select")) ;; preload the TTY init code. (when (featurep 'tty) "tty-init") ;;; Formerly in tooltalk/tooltalk-load.el ;; Moved to tooltalk package ;; (when (featurep 'tooltalk) ;; '("tooltalk-macros" "tooltalk-util" "tooltalk-init")) ;; "vc-hooks" ; Packaged. Available in two versions. ;; "ediff-hook" ; Packaged. "fontl-hooks" "auto-show" "paragraphs" ; needs easy-mmode, coding (when (featurep 'ldap) "ldap") ;; (when (featurep 'energize) "energize/energize-load.el") ;;; formerly in sunpro/sunpro-load.el ;; (when (featurep '(and mule sparcworks)) "mime-setup") ;; Moved to Sun package ;; (when (featurep 'sparcworks) ;; '("cc-mode" ; Requires cc-mode package ;; "sunpro-init" ;; "ring" ;; "comint" ; Requires comint package ;; "annotations")) ;;; formerly in eos/sun-eos-load.el ;; (when (featurep 'sparcworks) ;; '("sun-eos-init" ;; "sun-eos-common" ;; "sun-eos-editor" ;; "sun-eos-browser" ;; "sun-eos-debugger" ;; "sun-eos-debugger-extra" ;; "sun-eos-menubar")) "loaddefs" ; <=== autoloads get loaded here )) (setq preloaded-file-list (apply #'nconc (mapcar #'(lambda (x) (if (listp x) x (list x))) preloaded-file-list)))