[armedbear-cvs] r12705 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Tue May 18 22:30:54 UTC 2010
Author: ehuelsmann
Date: Tue May 18 18:30:53 2010
New Revision: 12705
Log:
Eliminate DECLARE-INSTANCE as it has the same effect as
DECLARE-OBJECT-AS-STRING; which is in the process of being
replaced by EMIT-LOAD-EXTERNALIZED-OBJECT.
Modified:
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp (original)
+++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Tue May 18 18:30:53 2010
@@ -2373,32 +2373,6 @@
(setf *code* saved-code))
g))
-(defknown declare-instance (t) t)
-(defun declare-instance (obj)
- (aver (not (null *file-compilation*)))
- (aver (or (structure-object-p obj) (standard-object-p obj)
- (java:java-object-p obj)))
- (let ((g (symbol-name (gensym "INSTANCE")))
- saved-code)
- (let* ((s (with-output-to-string (stream) (dump-form obj stream)))
- (*code* (if *declare-inline* *code* *static-code*)))
- ;; The readObjectFromString call may require evaluation of
- ;; lisp code in the string (think #.() syntax), of which the outcome
- ;; may depend on something which was declared inline
- (declare-field g +lisp-object+ +field-access-private+)
- (emit 'ldc (pool-string s))
- (emit-invokestatic +lisp-class+ "readObjectFromString"
- (list +java-string+) +lisp-object+)
- (emit-invokestatic +lisp-class+ "loadTimeValue"
- (lisp-object-arg-types 1) +lisp-object+)
- (emit 'putstatic *this-class* g +lisp-object+)
- (if *declare-inline*
- (setf saved-code *code*)
- (setf *static-code* *code*)))
- (when *declare-inline*
- (setf *code* saved-code))
- g))
-
(declaim (ftype (function (t &optional t) string) declare-object))
(defun declare-object (obj &optional (obj-ref +lisp-object+)
obj-class)
@@ -2523,10 +2497,7 @@
((or (structure-object-p form)
(standard-object-p form)
(java:java-object-p form))
- (let ((g (if *file-compilation*
- (declare-instance form)
- (declare-object form))))
- (emit 'getstatic *this-class* g +lisp-object+)))
+ (emit-load-externalized-object form))
(t
(if *file-compilation*
(error "COMPILE-CONSTANT unhandled case ~S" form)
More information about the armedbear-cvs
mailing list