Changeset 5862


Ignore:
Timestamp:
02/17/04 15:24:50 (17 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r5861 r5862  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: jvm.lisp,v 1.69 2004-02-17 01:40:58 piso Exp $
     4;;; $Id: jvm.lisp,v 1.70 2004-02-17 15:24:50 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    609609        87 ; POP
    610610        89 ; DUP
     611        91 ; DUP_X2
    611612        95 ; SWAP
    612613        153 ; IFEQ
     
    768769    (89 ; DUP
    769770     1)
     771    (91
     772     1) ; DUP_X2
    770773    (95 ; SWAP
    771774     0)
     
    20252028      (return-from compile-setq))
    20262029    (when (memq sym *closure-vars*)
    2027       (error "Unable to compile function defined in non-null lexical environment."))
     2030      (let ((g (declare-object *env*)))
     2031        (emit 'getstatic
     2032              *this-class*
     2033              g
     2034              "Lorg/armedbear/lisp/LispObject;"))
     2035      ;; FIXME Move this to constructor!
     2036      ;; Cast it to an Environment object.
     2037      (emit 'checkcast +lisp-environment-class+)
     2038      (let ((g (declare-symbol sym)))
     2039        (emit 'getstatic
     2040              *this-class*
     2041              g
     2042              "Lorg/armedbear/lisp/Symbol;"))
     2043      (compile-form (cadr rest))
     2044      (unless (remove-store-value)
     2045        (emit-push-value))
     2046      ;; stack: env sym val
     2047      (emit 'dup_x2)
     2048      (emit-invokevirtual +lisp-environment-class+
     2049                          "rebind"
     2050                          "(Lorg/armedbear/lisp/Symbol;Lorg/armedbear/lisp/LispObject;)V"
     2051                          -3)
     2052      (emit-store-value)
     2053      (return-from compile-setq))
    20282054    ;; still not found
    20292055    ;; must be a global variable
     
    22592285              g
    22602286              "Lorg/armedbear/lisp/LispObject;"))
     2287      ;; FIXME Move this to constructor!
    22612288      ;; Cast it to an Environment object.
    22622289      (emit 'checkcast +lisp-environment-class+)
Note: See TracChangeset for help on using the changeset viewer.