Changeset 11507


Ignore:
Timestamp:
12/29/08 21:19:52 (12 years ago)
Author:
ehuelsmann
Message:

Emit the most efficient ALOAD and ASTORE instructions.

File:
1 edited

Legend:

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

    r11506 r11507  
    252252  (setf (symbol-value symbol) nil))
    253253
     254(defknown aload (fixnum) t)
     255(defun aload (index)
     256  (case index
     257    (0 (emit 'aload_0))
     258    (1 (emit 'aload_1))
     259    (2 (emit 'aload_2))
     260    (3 (emit 'aload_3))
     261    (t (emit 'aload index))))
     262
     263(defknown astore (fixnum) t)
     264(defun astore (index)
     265  (case index
     266    (0 (emit 'astore_0))
     267    (1 (emit 'astore_1))
     268    (2 (emit 'astore_2))
     269    (3 (emit 'astore_3))
     270    (t (emit 'astore index))))
     271
    254272(defknown emit-push-nil () t)
    255273(declaim (inline emit-push-nil))
     
    438456  (when *initialize-thread-var*
    439457    (emit-invokestatic +lisp-thread-class+ "currentThread" nil +lisp-thread+)
    440     (emit 'astore *thread*)
     458    (astore *thread*)
    441459    (setf *initialize-thread-var* nil)))
    442460
     
    450468  (declare (optimize speed))
    451469  (ensure-thread-var-initialized)
    452   (emit 'aload *thread*))
     470  (aload *thread*))
    453471
    454472(defun local-variable-p (variable)
     
    463481  (aver (local-variable-p variable))
    464482  (if (variable-register variable)
    465       (emit 'aload (variable-register variable))
     483      (aload (variable-register variable))
    466484      (progn
    467         (emit 'aload (compiland-argument-register *current-compiland*))
     485        (aload (compiland-argument-register *current-compiland*))
    468486        (emit-push-constant-int (variable-index variable))
    469487        (emit 'aaload))))
     
    548566  (aver (not (null (compiland-argument-register *current-compiland*))))
    549567  (let ((label1 (gensym)))
    550     (emit 'aload (compiland-argument-register *current-compiland*))
     568    (aload (compiland-argument-register *current-compiland*))
    551569    (emit 'arraylength)
    552570    (emit-push-constant-int arity)
    553571    (emit 'if_icmpeq `,label1)
    554     (emit 'aload 0) ; this
     572    (aload 0) ; this
    555573    (emit-invokevirtual *this-class* "argCountError" nil nil)
    556574    (emit 'label `,label1)))
     
    12051223           (cond ((variable-register variable)
    12061224                  (dformat t "register = ~S~%" (variable-register variable))
    1207                   (emit 'astore (variable-register variable)))
     1225                  (astore (variable-register variable)))
    12081226                 ((variable-closure-index variable)
    12091227                  (dformat t "closure-index = ~S~%" (variable-closure-index variable))
    12101228                  (aver (not (null (compiland-closure-register *current-compiland*))))
    1211                   (emit 'aload (compiland-closure-register *current-compiland*))
     1229                  (aload (compiland-closure-register *current-compiland*))
    12121230                  (emit 'swap) ; array value
    12131231                  (emit-push-constant-int (variable-closure-index variable))
     
    12171235                  (dformat t "var-set fall-through case~%")
    12181236                  (aver (not (null (compiland-argument-register *current-compiland*))))
    1219                   (emit 'aload (compiland-argument-register *current-compiland*)) ; Stack: value array
     1237                  (aload (compiland-argument-register *current-compiland*)) ; Stack: value array
    12201238                  (emit 'swap) ; array value
    12211239                  (emit-push-constant-int (variable-index variable)) ; array value index
     
    16511669    (setf (method-descriptor-index constructor) (pool-name (method-descriptor constructor)))
    16521670    (setf (method-max-locals constructor) 1)
    1653     (emit 'aload_0) ;; this
     1671    (aload 0) ;; this
    16541672    (cond ((equal super +lisp-compiled-function-class+)
    16551673           (emit-constructor-lambda-name lambda-name)
     
    27102728             (if (notinline-p op)
    27112729                 (emit 'getstatic *this-class* (declare-symbol op) +lisp-symbol+)
    2712                  (emit 'aload 0)))
     2730                 (aload 0)))
    27132731            ((null (symbol-package op))
    27142732             (let ((g (if *compile-file-truename*
     
    28432861      (when (variable-closure-index variable)
    28442862        (let ((register (allocate-register)))
    2845           (emit 'aload (compiland-closure-register *current-compiland*))
     2863          (aload (compiland-closure-register *current-compiland*))
    28462864          (emit-push-constant-int (variable-closure-index variable))
    28472865          (emit 'aaload)
    2848           (emit 'astore register)
     2866          (astore register)
    28492867          (push (cons variable register) saved-vars))))
    28502868    saved-vars))
     
    28542872    (let ((variable (car saved-var))
    28552873          (register (cdr saved-var)))
    2856       (emit 'aload (compiland-closure-register *current-compiland*))
     2874      (aload (compiland-closure-register *current-compiland*))
    28572875      (emit-push-constant-int (variable-closure-index variable))
    2858       (emit 'aload register)
     2876      (aload register)
    28592877      (emit 'aastore))))
    28602878
     
    28902908             (when *closure-variables*
    28912909               (emit 'checkcast +lisp-ctf-class+)
    2892                (emit 'aload (compiland-closure-register compiland))
     2910               (aload (compiland-closure-register compiland))
    28932911               (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    28942912                                  (list +lisp-object+ +lisp-object-array+)
     
    36933711    (emit-push-current-thread)
    36943712    (emit 'getfield +lisp-thread-class+ "_values" "[Lorg/armedbear/lisp/LispObject;")
    3695     (emit 'astore values-register)
     3713    (astore values-register)
    36963714    (dolist (subform subforms)
    36973715      (compile-form subform nil nil))
    36983716    ;; Restore multiple values returned by first subform.
    36993717    (emit-push-current-thread)
    3700     (emit 'aload values-register)
     3718    (aload values-register)
    37013719    (emit 'putfield +lisp-thread-class+ "_values" "[Lorg/armedbear/lisp/LispObject;")
    37023720    ;; Result.
    3703     (emit 'aload result-register)
     3721    (aload result-register)
    37043722    (fix-boxing representation nil)
    37053723    (emit-move-from-stack target)))
     
    37213739       (compile-form (second form) function-register nil)
    37223740       (compile-form (third form) 'stack nil)
    3723        (emit 'aload function-register)
     3741       (aload function-register)
    37243742       (emit-push-current-thread)
    37253743       (emit-invokestatic +lisp-class+ "multipleValueCall1"
     
    37363754       (emit-move-from-stack function-register)
    37373755       (emit 'aconst_null)
    3738        (emit 'astore values-register)
     3756       (astore values-register)
    37393757       (dolist (values-form (cddr form))
    37403758         (compile-form values-form 'stack nil)
    37413759         (emit-push-current-thread)
    37423760         (emit 'swap)
    3743          (emit 'aload values-register)
     3761         (aload values-register)
    37443762         (emit-invokevirtual +lisp-thread-class+ "accumulateValues"
    37453763                             (list +lisp-object+ +lisp-object-array+)
    37463764                             +lisp-object-array+)
    3747          (emit 'astore values-register)
     3765         (astore values-register)
    37483766         (maybe-emit-clear-values values-form))
    3749        (emit 'aload function-register)
    3750        (emit 'aload values-register)
     3767       (aload function-register)
     3768       (aload values-register)
    37513769       (emit-invokevirtual +lisp-object-class+ "dispatch"
    37523770                           (list +lisp-object-array+) +lisp-object+))))
     
    37733791(defun compile-binding (variable)
    37743792  (cond ((variable-register variable)
    3775          (emit 'astore (variable-register variable)))
     3793         (astore (variable-register variable)))
    37763794        ((variable-special-p variable)
    37773795         (emit-push-current-thread)
     
    37823800                             (list +lisp-symbol+ +lisp-object+) nil))
    37833801        ((variable-closure-index variable)
    3784          (emit 'aload (compiland-closure-register *current-compiland*))
     3802         (aload (compiland-closure-register *current-compiland*))
    37853803         (emit 'swap) ; array value
    37863804         (emit-push-constant-int (variable-closure-index variable))
     
    38383856      (emit-push-current-thread)
    38393857      (emit 'getfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    3840       (emit 'astore (block-environment-register block)))
     3858      (astore (block-environment-register block)))
    38413859    ;; Make sure there are no leftover values from previous calls.
    38423860    (emit-clear-values)
     
    38593877             (emit-move-from-stack values-register)
    38603878             ;; Did we get just one value?
    3861              (emit 'aload values-register)
     3879             (aload values-register)
    38623880             (emit 'ifnull LABEL1)
    38633881             ;; Reaching here, we have multiple values (or no values at all). We need
    38643882             ;; the slow path if we have more variables than values.
    3865              (emit 'aload values-register)
     3883             (aload values-register)
    38663884             (emit 'arraylength)
    38673885             (emit-push-constant-int (length vars))
     
    38693887             ;; Reaching here, we have enough values for all the variables. We can use
    38703888             ;; the values we have. This is the fast path.
    3871              (emit 'aload values-register)
     3889             (aload values-register)
    38723890             (emit 'goto LABEL2)
    38733891             (label LABEL1)
    38743892             (emit-push-current-thread)
    3875              (emit 'aload result-register)
     3893             (aload result-register)
    38763894             (emit-push-constant-int (length vars))
    38773895             (emit-invokevirtual +lisp-thread-class+ "getValues"
     
    38963914    (when bind-special-p
    38973915      ;; Restore dynamic environment.
    3898       (emit 'aload *thread*)
    3899       (emit 'aload (block-environment-register block))
     3916      (aload *thread*)
     3917      (aload (block-environment-register block))
    39003918      (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+))))
    39013919
     
    40374055      (when (variable-temp-register variable)
    40384056        (aver (variable-special-p variable))
    4039         (emit 'aload (variable-temp-register variable))
     4057        (aload (variable-temp-register variable))
    40404058        (compile-binding variable))))
    40414059  ;; Now make the variables visible.
     
    41854203      (emit-push-current-thread)
    41864204      (emit 'getfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    4187       (emit 'astore (block-environment-register block)))
     4205      (astore (block-environment-register block)))
    41884206    (propagate-vars block)
    41894207    (ecase (car form)
     
    42014219    (when specialp
    42024220      ;; Restore dynamic environment.
    4203       (emit 'aload *thread*)
    4204       (emit 'aload (block-environment-register block))
     4221      (aload *thread*)
     4222      (aload (block-environment-register block))
    42054223      (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+))))
    42064224
     
    42414259      (emit-push-current-thread)
    42424260      (emit 'getfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    4243       (emit 'astore environment-register))
     4261      (astore environment-register))
    42444262    (label BEGIN-BLOCK)
    42454263    (do* ((rest body (cdr rest))
     
    42694287        ;; The Go object is on the runtime stack. Stack depth is 1.
    42704288        (emit 'dup)
    4271         (emit 'astore go-register)
     4289        (astore go-register)
    42724290        ;; Get the tag.
    42734291        (emit 'checkcast +lisp-go-class+)
    42744292        (emit 'getfield +lisp-go-class+ "tag" +lisp-object+) ; Stack depth is still 1.
    4275         (emit 'astore tag-register)
     4293        (astore tag-register)
    42764294        (dolist (tag local-tags)
    42774295          (let ((NEXT (gensym)))
    4278             (emit 'aload tag-register)
     4296            (aload tag-register)
    42794297            (emit 'getstatic *this-class*
    42804298                  (if *compile-file-truename*
     
    42864304            (emit-push-current-thread)
    42874305            (aver (fixnump environment-register))
    4288             (emit 'aload environment-register)
     4306            (aload environment-register)
    42894307            (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    42904308            (emit 'goto (tag-label tag))
    42914309            (label NEXT)))
    42924310        ;; Not found. Re-throw Go.
    4293         (emit 'aload go-register)
     4311        (aload go-register)
    42944312        (emit 'athrow)
    42954313        ;; Finally...
     
    43354353          (when register
    43364354            ;; Restore dynamic environment.
    4337             (emit 'aload *thread*)
    4338             (emit 'aload register)
     4355            (aload *thread*)
     4356            (aload register)
    43394357            (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+))
    43404358          (maybe-generate-interrupt-check)
     
    44604478                  (emit-push-current-thread)
    44614479                  (emit 'getfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    4462                   (emit 'astore (block-environment-register block)))
     4480                  (astore (block-environment-register block)))
    44634481                 (t
    44644482                  (dformat t "no specials~%")))
     
    44994517           (when (block-environment-register block)
    45004518             ;; We saved the dynamic environment above. Restore it now.
    4501              (emit 'aload *thread*)
    4502              (emit 'aload (block-environment-register block))
     4519             (aload *thread*)
     4520             (aload (block-environment-register block))
    45034521             (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+))
    45044522           (fix-boxing representation nil)
     
    45514569             (emit 'dup)
    45524570             (compile-form `',(block-catch-tag block) 'stack nil) ; Tag.
    4553              (emit 'aload temp-register))))
     4571             (aload temp-register))))
    45544572    (emit-invokespecial-init +lisp-return-class+ (lisp-object-arg-types 2))
    45554573    (emit 'athrow)
     
    46394657    (emit-push-current-thread)
    46404658    (emit 'getfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    4641     (emit 'astore environment-register)
     4659    (astore environment-register)
    46424660    ;; Compile call to Lisp.progvBindVars().
    4643     (emit 'aload *thread*)
     4661    (aload *thread*)
    46444662    (emit-invokestatic +lisp-class+ "progvBindVars"
    46454663                       (list +lisp-object+ +lisp-object+ +lisp-thread+) nil)
     
    46474665    (compile-progn-body (cdddr form) target)
    46484666    ;; Restore dynamic environment.
    4649     (emit 'aload *thread*)
    4650     (emit 'aload environment-register)
     4667    (aload *thread*)
     4668    (aload environment-register)
    46514669    (emit 'putfield +lisp-thread-class+ "lastSpecialBinding" +lisp-special-binding+)
    46524670    (fix-boxing representation nil)))
     
    47684786                            (compiland-closure-register parent))
    47694787                   (emit 'checkcast +lisp-ctf-class+)
    4770                    (emit 'aload (compiland-closure-register parent))
     4788                   (aload (compiland-closure-register parent))
    47714789                   (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    47724790                                      (list +lisp-object+ +lisp-object-array+)
     
    47944812                                    (compiland-closure-register parent))
    47954813                           (emit 'checkcast +lisp-ctf-class+)
    4796                            (emit 'aload (compiland-closure-register parent))
     4814                           (aload (compiland-closure-register parent))
    47974815                           (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    47984816                                              (list +lisp-object+ +lisp-object-array+)
     
    48244842                            (compiland-closure-register parent))
    48254843                   (emit 'checkcast +lisp-ctf-class+)
    4826                    (emit 'aload (compiland-closure-register parent))
     4844                   (aload (compiland-closure-register parent))
    48274845                   (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    48284846                                      (list +lisp-object+ +lisp-object-array+)
     
    48474865                                  (compiland-closure-register parent))
    48484866                         (emit 'checkcast +lisp-ctf-class+)
    4849                          (emit 'aload (compiland-closure-register parent))
     4867                         (aload (compiland-closure-register parent))
    48504868                         (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    48514869                                            (list +lisp-object+ +lisp-object-array+)
     
    49284946    (cond ((null *closure-variables*)) ; Nothing to do.
    49294947          ((compiland-closure-register *current-compiland*)
    4930            (emit 'aload (compiland-closure-register *current-compiland*))
     4948           (aload (compiland-closure-register *current-compiland*))
    49314949           (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    49324950                              (list +lisp-object+ +lisp-object-array+)
     
    49604978                           (when (compiland-closure-register *current-compiland*)
    49614979                             (emit 'checkcast +lisp-ctf-class+)
    4962                              (emit 'aload (compiland-closure-register *current-compiland*))
     4980                             (aload (compiland-closure-register *current-compiland*))
    49634981                             (emit-invokestatic +lisp-class+ "makeCompiledClosure"
    49644982                                                (list +lisp-object+ +lisp-object-array+)
     
    49814999                  (dformat t "p2-function 1~%")
    49825000                  (when (eq (local-function-compiland local-function) *current-compiland*)
    4983                     (emit 'aload 0) ; this
     5001                    (aload 0) ; this
    49845002                    (emit-move-from-stack target)
    49855003                    (return-from p2-function))
     
    57115729    (when value-register
    57125730      (emit 'dup)
    5713       (emit 'astore value-register))
     5731      (astore value-register))
    57145732    (emit-invokevirtual +lisp-object-class+ "setSlotValue"
    57155733                        (lisp-object-arg-types 2) nil)
    57165734    (when value-register
    5717       (emit 'aload value-register)
     5735      (aload value-register)
    57185736      (fix-boxing representation nil)
    57195737      (emit-move-from-stack target representation))))
     
    66846702                      (compile-form arg1 'stack nil)
    66856703                      (emit 'dup)
    6686                       (emit 'astore reg1)
     6704                      (astore reg1)
    66876705                      (compile-form arg2 'stack nil)
    66886706                      (emit 'dup)
    6689                       (emit 'astore reg2)
     6707                      (astore reg2)
    66906708                      (emit-invokevirtual +lisp-object-class+
    66916709                                          (if (eq op 'min)
     
    66966714                            (LABEL2 (gensym)))
    66976715                        (emit 'ifeq LABEL1)
    6698                         (emit 'aload reg1)
     6716                        (aload reg1)
    66996717                        (emit 'goto LABEL2)
    67006718                        (label LABEL1)
    6701                         (emit 'aload reg2)
     6719                        (aload reg2)
    67026720                        (label LABEL2)))
    67036721                    (fix-boxing representation nil)
     
    70297047           (emit-invokevirtual +lisp-object-class+ "svset" (list "I" +lisp-object+) nil)
    70307048           (when value-register
    7031              (emit 'aload value-register)
     7049             (aload value-register)
    70327050             (emit-move-from-stack target nil))))
    70337051        (t
     
    71797197                       (emit-invokespecial-init +lisp-fixnum-class+ '("I")))))
    71807198                   (t
    7181                     (emit 'aload value-register)
     7199                    (aload value-register)
    71827200                    (fix-boxing representation type3)))
    71837201             (emit-move-from-stack target representation))))
     
    72577275            (when value-register
    72587276              (emit 'dup)
    7259               (emit 'astore value-register))
     7277              (astore value-register))
    72607278            (emit-invokevirtual +lisp-object-class+
    72617279                                (format nil "setSlotValue_~D" arg2)
    72627280                                (lisp-object-arg-types 1) nil)
    72637281            (when value-register
    7264               (emit 'aload value-register)
     7282              (aload value-register)
    72657283              (fix-boxing representation nil)
    72667284              (emit-move-from-stack target representation))))
     
    72747292            (when value-register
    72757293              (emit 'dup)
    7276               (emit 'astore value-register))
     7294              (astore value-register))
    72777295            (emit-invokevirtual +lisp-object-class+ "setSlotValue"
    72787296                                (list "I" +lisp-object+) nil)
    72797297            (when value-register
    7280               (emit 'aload value-register)
     7298              (aload value-register)
    72817299              (fix-boxing representation nil)
    72827300              (emit-move-from-stack target representation))))
     
    75507568                 (emit-move-from-stack target representation))
    75517569                ((variable-register variable)
    7552                  (emit 'aload (variable-register variable))
     7570                 (aload (variable-register variable))
    75537571                 (fix-boxing representation (variable-derived-type variable))
    75547572                 (emit-move-from-stack target representation))
    75557573                ((variable-closure-index variable)
    75567574                 (aver (not (null (compiland-closure-register *current-compiland*))))
    7557                  (emit 'aload (compiland-closure-register *current-compiland*))
     7575                 (aload (compiland-closure-register *current-compiland*))
    75587576                 (emit-push-constant-int (variable-closure-index variable))
    75597577                 (emit 'aaload)
     
    75627580                ((variable-index variable)
    75637581                 (aver (not (null (compiland-argument-register *current-compiland*))))
    7564                  (emit 'aload (compiland-argument-register *current-compiland*))
     7582                 (aload (compiland-argument-register *current-compiland*))
    75657583                 (emit-push-constant-int (variable-index variable))
    75667584                 (emit 'aaload)
     
    80248042      (compile-form (second form) tag-register nil) ; Tag.
    80258043      (emit-push-current-thread)
    8026       (emit 'aload tag-register)
     8044      (aload tag-register)
    80278045      (emit-invokevirtual +lisp-thread-class+ "pushCatchTag"
    80288046                          (lisp-object-arg-types 1) nil)
     
    80368054      (emit 'dup) ; Stack depth is 2.
    80378055      (emit 'getfield +lisp-throw-class+ "tag" +lisp-object+) ; Still 2.
    8038       (emit 'aload tag-register) ; Stack depth is 3.
     8056      (aload tag-register) ; Stack depth is 3.
    80398057      ;; If it's not the tag we're looking for, we branch to the start of the
    80408058      ;; catch-all handler, which will do a re-throw.
    80418059      (emit 'if_acmpne DEFAULT-HANDLER) ; Stack depth is 1.
    8042       (emit 'aload *thread*)
     8060      (aload *thread*)
    80438061      (emit-invokevirtual +lisp-throw-class+ "getResult"
    80448062                          (list +lisp-thread+) +lisp-object+)
     
    80478065      (label DEFAULT-HANDLER) ; Start of handler for all other Throwables.
    80488066      ;; A Throwable object is on the runtime stack here. Stack depth is 1.
    8049       (emit 'aload *thread*)
     8067      (aload *thread*)
    80508068      (emit-invokevirtual +lisp-thread-class+ "popCatchTag" nil nil)
    80518069      (emit 'athrow) ; Re-throw.
    80528070      (label EXIT)
    80538071      ;; Finally...
    8054       (emit 'aload *thread*)
     8072      (aload *thread*)
    80558073      (emit-invokevirtual +lisp-thread-class+ "popCatchTag" nil nil)
    80568074      (let ((handler1 (make-handler :from BEGIN-PROTECTED-RANGE
     
    81058123        (emit-push-current-thread)
    81068124        (emit 'getfield +lisp-thread-class+ "_values" "[Lorg/armedbear/lisp/LispObject;")
    8107         (emit 'astore values-register)
     8125        (astore values-register)
    81088126        (label END-PROTECTED-RANGE))
    81098127      (emit 'jsr CLEANUP)
     
    81118129      (label HANDLER) ; Start of exception handler.
    81128130      ;; The Throwable object is on the runtime stack. Stack depth is 1.
    8113       (emit 'astore exception-register)
     8131      (astore exception-register)
    81148132      (emit 'jsr CLEANUP) ; Call cleanup forms.
    81158133      (emit-clear-values)
    8116       (emit 'aload exception-register)
     8134      (aload exception-register)
    81178135      (emit 'athrow) ; Re-throw exception.
    81188136      (label CLEANUP) ; Cleanup forms.
    81198137      ;; Return address is on stack here.
    8120       (emit 'astore return-address-register)
     8138      (astore return-address-register)
    81218139      (dolist (subform cleanup-forms)
    81228140        (compile-form subform nil nil))
     
    81258143      ;; Restore multiple values returned by protected form.
    81268144      (emit-push-current-thread)
    8127       (emit 'aload values-register)
     8145      (aload values-register)
    81288146      (emit 'putfield +lisp-thread-class+ "_values" "[Lorg/armedbear/lisp/LispObject;")
    81298147      ;; Result.
    8130       (emit 'aload result-register)
     8148      (aload result-register)
    81318149      (emit-move-from-stack target)
    81328150      (let ((handler (make-handler :from BEGIN-PROTECTED-RANGE
     
    83578375(defun p2-%call-internal (form target representation)
    83588376  (dformat t "p2-%call-internal~%")
    8359   (emit 'aload_0) ; this
     8377  (aload 0) ; this
    83608378  (let ((args (cdr form))
    83618379        (must-clear-values nil))
     
    84078425      (let ((type (variable-declared-type variable)))
    84088426        (cond ((fixnum-type-p type)
    8409                (emit 'aload register)
     8427               (aload register)
    84108428               (emit-unbox-fixnum)
    84118429               (emit 'istore register)
     
    84138431              ((java-long-type-p type)
    84148432               (let ((new-register (allocate-register-pair)))
    8415                  (emit 'aload register)
     8433                 (aload register)
    84168434                 (emit-invokevirtual +lisp-object-class+ "longValue" nil "J")
    84178435                 (emit 'lstore new-register)
     
    84198437                 (setf (variable-representation variable) :long)))
    84208438              ((eq type 'CHARACTER)
    8421                (emit 'aload register)
     8439               (aload register)
    84228440               (emit-unbox-character)
    84238441               (emit 'istore register)
     
    85818599             (aver (eql (compiland-closure-register compiland) 1))
    85828600             (when (some #'variable-closure-index parameters)
    8583                (emit 'aload (compiland-closure-register compiland))))
     8601               (aload (compiland-closure-register compiland))))
    85848602            (t
    85858603             (emit-push-constant-int (length *closure-variables*))
     
    85998617                 (emit 'dup) ; array
    86008618                 (emit-push-constant-int (variable-closure-index variable))
    8601                  (emit 'aload (variable-register variable))
     8619                 (aload (variable-register variable))
    86028620                 (emit 'aastore)
    86038621                 (setf (variable-register variable) nil)) ; The variable has moved.
     
    86058623                 (emit 'dup) ; array
    86068624                 (emit-push-constant-int (variable-closure-index variable))
    8607                  (emit 'aload (compiland-argument-register compiland))
     8625                 (aload (compiland-argument-register compiland))
    86088626                 (emit-push-constant-int (variable-index variable))
    86098627                 (emit 'aaload)
     
    86158633               (emit 'pop)))
    86168634            (t
    8617              (emit 'astore (compiland-closure-register compiland))))
     8635             (astore (compiland-closure-register compiland))))
    86188636      (dformat t "~S done moving arguments to closure array~%"
    86198637               (compiland-name compiland)))
     
    86258643          (when (variable-reserved-register variable)
    86268644            (aver (not (variable-special-p variable)))
    8627             (emit 'aload (compiland-argument-register compiland))
     8645            (aload (compiland-argument-register compiland))
    86288646            (emit-push-constant-int (variable-index variable))
    86298647            (emit 'aaload)
    8630             (emit 'astore (variable-reserved-register variable))
     8648            (astore (variable-reserved-register variable))
    86318649            (setf (variable-register variable) (variable-reserved-register variable))
    86328650            (setf (variable-index variable) nil)))))
     
    86448662               (emit-push-current-thread)
    86458663               (emit-push-variable-name variable)
    8646                (emit 'aload (variable-register variable))
     8664               (aload (variable-register variable))
    86478665               (emit-invokevirtual +lisp-thread-class+ "bindSpecial"
    86488666                                   (list +lisp-symbol+ +lisp-object+) nil)
     
    86518669               (emit-push-current-thread)
    86528670               (emit-push-variable-name variable)
    8653                (emit 'aload (compiland-argument-register compiland))
     8671               (aload (compiland-argument-register compiland))
    86548672               (emit-push-constant-int (variable-index variable))
    86558673               (emit 'aaload)
     
    86788696
    86798697      (when *hairy-arglist-p*
    8680         (emit 'aload_0) ; this
     8698        (aload 0) ; this
    86818699        (aver (not (null (compiland-argument-register compiland))))
    8682         (emit 'aload (compiland-argument-register compiland)) ; arg vector
     8700        (aload (compiland-argument-register compiland)) ; arg vector
    86838701        (cond ((or (memq '&OPTIONAL args) (memq '&KEY args))
    86848702               (ensure-thread-var-initialized)
    86858703               (maybe-initialize-thread-var)
    8686                (emit 'aload *thread*)
     8704               (aload *thread*)
    86878705               (emit-invokevirtual *this-class* "processArgs"
    86888706                                   (list +lisp-object-array+ +lisp-thread+)
     
    86928710                                   (list +lisp-object-array+)
    86938711                                   +lisp-object-array+)))
    8694         (emit 'astore (compiland-argument-register compiland)))
     8712        (astore (compiland-argument-register compiland)))
    86958713
    86968714      (maybe-initialize-thread-var)
Note: See TracChangeset for help on using the changeset viewer.