Changeset 13114 for trunk/abcl/src/org


Ignore:
Timestamp:
01/01/11 11:52:26 (11 years ago)
Author:
ehuelsmann
Message:

Register each node being created with its parent.
A parent is always part of the same compiland.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/jvm.lisp

    r13046 r13114  
    390390(defstruct node
    391391  form
     392  children
    392393  (compiland *current-compiland*))
    393394;; No need for a special constructor: nobody instantiates
    394395;; nodes directly
     396
     397(declaim (inline add-node-child))
     398(defun add-node-child (parent child)
     399  "Add a child node to the `children` list of a parent node,
     400if that parent belongs to the same compiland."
     401  (when parent
     402    (when (eq (node-compiland parent) *current-compiland*)
     403      (push child (node-children parent)))))
    395404
    396405;; control-transferring blocks: TAGBODY, CATCH, to do: BLOCK
     
    419428  (let ((block (%make-tagbody-node)))
    420429    (push block (compiland-blocks *current-compiland*))
     430    (add-node-child (car *blocks*) block)
    421431    block))
    422432
     
    431441  (let ((block (%make-catch-node)))
    432442    (push block (compiland-blocks *current-compiland*))
     443    (add-node-child (car *blocks*) block)
    433444    block))
    434445
     
    448459  (let ((block (%make-block-node name)))
    449460    (push block (compiland-blocks *current-compiland*))
     461    (add-node-child (car *blocks*) block)
    450462    block))
    451463
     
    471483  (let ((block (%make-let/let*-node)))
    472484    (push block (compiland-blocks *current-compiland*))
     485    (add-node-child (car *blocks*) block)
    473486    block))
    474487
     
    480493  (let ((block (%make-flet-node)))
    481494    (push block (compiland-blocks *current-compiland*))
     495    (add-node-child (car *blocks*) block)
    482496    block))
    483497
     
    489503  (let ((block (%make-labels-node)))
    490504    (push block (compiland-blocks *current-compiland*))
     505    (add-node-child (car *blocks*) block)
    491506    block))
    492507
     
    498513  (let ((block (%make-m-v-b-node)))
    499514    (push block (compiland-blocks *current-compiland*))
     515    (add-node-child (car *blocks*) block)
    500516    block))
    501517
     
    516532  (let ((block (%make-locally-node)))
    517533    (push block (compiland-blocks *current-compiland*))
     534    (add-node-child (car *blocks*) block)
    518535    block))
    519536
     
    526543  (let ((block (%make-protected-node)))
    527544    (push block (compiland-blocks *current-compiland*))
     545    (add-node-child (car *blocks*) block)
    528546    block))
    529547
     
    535553  (let ((block (%make-unwind-protect-node)))
    536554    (push block (compiland-blocks *current-compiland*))
     555    (add-node-child (car *blocks*) block)
    537556    block))
    538557
     
    544563  (let ((block (%make-synchronized-node)))
    545564    (push block (compiland-blocks *current-compiland*))
     565    (add-node-child (car *blocks*) block)
    546566    block))
    547567
Note: See TracChangeset for help on using the changeset viewer.