Changeset 8621


Ignore:
Timestamp:
02/21/05 18:26:52 (16 years ago)
Author:
piso
Message:

DECLARE-STRUCTURE

File:
1 edited

Legend:

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

    r8615 r8621  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.401 2005-02-20 15:19:31 piso Exp $
     4;;; $Id: jvm.lisp,v 1.402 2005-02-21 18:26:52 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    22462246    g))
    22472247
     2248(defun declare-structure (obj)
     2249  (aver (not (null *compile-file-truename*)))
     2250  (aver (sys::structure-object-p obj))
     2251  (multiple-value-bind (creation-form initialization-form)
     2252      (make-load-form obj)
     2253    (let* ((g (symbol-name (gensym)))
     2254           (*print-level* nil)
     2255           (*print-length* nil)
     2256           (s (%format nil "~S" creation-form))
     2257           (*code* *static-code*))
     2258      (declare-field g +lisp-object+)
     2259      (emit 'ldc (pool-string s))
     2260      (emit-invokestatic +lisp-class+ "readObjectFromString"
     2261                         (list +java-string+) +lisp-object+)
     2262      (emit-invokestatic +lisp-class+ "loadTimeValue"
     2263                         (list +lisp-object+) +lisp-object+)
     2264      (emit 'putstatic *this-class* g +lisp-object+)
     2265      (setf *static-code* *code*)
     2266      g)))
     2267
    22482268(defun declare-package (obj)
    22492269  (let* ((g (symbol-name (gensym)))
     
    23682388         (let ((g (if *compile-file-truename*
    23692389                      (declare-package form)
     2390                      (declare-object form))))
     2391           (emit 'getstatic *this-class* g +lisp-object+)))
     2392        ((sys::structure-object-p form)
     2393         (let ((g (if *compile-file-truename*
     2394                      (declare-structure form)
    23702395                      (declare-object form))))
    23712396           (emit 'getstatic *this-class* g +lisp-object+)))
Note: See TracChangeset for help on using the changeset viewer.