Changeset 13511 for trunk/abcl/src/org


Ignore:
Timestamp:
08/19/11 15:42:38 (10 years ago)
Author:
ehuelsmann
Message:

Re #116: while working to fix the issue, at least tell the user we're
unable to generate a conforming class file.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r13490 r13511  
    5252(declaim (special *memory-class-loader*))
    5353
     54
     55(declaim (inline pool-name pool-name-and-type pool-string
     56                 pool-field pool-method pool-int pool-float pool-long
     57                 pool-double add-exception-handler))
    5458(defun pool-name (name)
    5559  (pool-add-utf8 *pool* name))
     
    11781182                     (list +java-string+) +lisp-object+))
    11791183
     1184(defun external-constant-resource-name (class)
     1185  (declare (ignore class))
     1186  ;; dummy implementation to suppress compiler warnings
     1187  ;; which break abcl compilation
     1188  )
     1189
    11801190(defun serialize-object (object)
    11811191  "Generate code to restore a serialized object which is not of any
     
    11831193  (let ((s (with-output-to-string (stream)
    11841194             (dump-form object stream))))
    1185     (emit 'ldc (pool-string s))
    1186     (emit-invokestatic +lisp+ "readObjectFromString"
    1187                        (list +java-string+) +lisp-object+)))
     1195    (cond
     1196      ((< (length s) #xFFFF)  ;; maximum string size in class file
     1197       (emit 'ldc (pool-string s))
     1198       (emit-invokestatic +lisp+ "readObjectFromString"
     1199                          (list +java-string+) +lisp-object+))
     1200      (t
     1201       (assert (not "Serialized representation too long to be stored in a string"))
     1202       (aload 0) ;; this
     1203       (emit-invokevirtual +java-object+ "getClass" '() +java-class+)
     1204       (emit 'ldc (pool-string (external-constant-resource-name *this-class*)))
     1205       (emit-invokevirtual +java-class+ "getResourceAsStream"
     1206                           (list +java-string+)
     1207                           +java-io-input-stream+)
     1208       (emit-invokestatic +lisp+ "readObjectFromStream"
     1209                          (list +java-io-input-stream+)
     1210                          +lisp-object+)))))
    11881211
    11891212(defun serialize-symbol (symbol)
  • trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r13440 r13511  
    131131     ,documentation))
    132132
     133(define-class-name +java-class+ "java.lang.Class")
    133134(define-class-name +java-object+ "java.lang.Object")
    134135(define-class-name +java-string+ "java.lang.String")
    135136(define-class-name +java-system+ "java.lang.System")
     137(define-class-name +java-io-input-stream+ "java.io.InputStream")
    136138(define-class-name +lisp-object+ "org.armedbear.lisp.LispObject")
    137139(defconstant +lisp-object-array+ (class-array +lisp-object+))
Note: See TracChangeset for help on using the changeset viewer.