Changeset 13150


Ignore:
Timestamp:
01/15/11 19:49:11 (11 years ago)
Author:
ehuelsmann
Message:

Add basic support for compiler 'listeners' or callbacks:
infrastructure to help debug the compiler.

Location:
branches/unsafe-p-removal/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r13078 r13150  
    10211021(defun finalize-code-attribute (code parent class)
    10221022  "Prepares the `code' attribute for serialization, within method `parent'."
    1023   (declare (ignore parent))
    10241023  (let* ((handlers (code-exception-handlers code))
    10251024         (c (finalize-code
     
    10291028                            (mapcar #'exception-handler-pc handlers))
    10301029                     t)))
     1030    (invoke-callbacks :code-finalized class parent
     1031                      (coerce c 'list) handlers)
    10311032    (unless (code-max-stack code)
    10321033      (setf (code-max-stack code)
  • branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/jvm-instructions.lisp

    r12941 r13150  
    722722        (setf depth (+ depth instruction-stack))
    723723        (setf (instruction-depth instruction) depth)
     724        (unless (<= 0 depth)
     725          (internal-compiler-error "Stack inconsistency detected ~
     726                                    in ~A at index ~D: ~
     727                                    negative depth ~S."
     728                                   (compiland-name *current-compiland*)
     729                                   i depth))
    724730        (when (branch-p opcode)
    725731          (let ((label (car (instruction-args instruction))))
  • branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/jvm.lisp

    r13129 r13150  
    5454
    5555(defvar *enable-dformat* nil)
     56(defvar *callbacks* nil
     57  "A list of functions to be called by the compiler and code generator
     58in order to generate 'compilation events'.")
     59
     60(declaim (inline invoke-callbacks))
     61(defun invoke-callbacks (&rest args)
     62  (dolist (cb *callbacks*)
     63    (apply cb args)))
    5664
    5765#+nil
Note: See TracChangeset for help on using the changeset viewer.