#200: ABCL compiler fails to produce loadable fasl for XPATH -------------------------------------------------------------------+-------- Reporter: mevenson | Owner: ehuelsmann Type: defect | Status: new Priority: blocker | Milestone: 1.2.0 Component: compiler | Version: 1.1.0 Keywords: compiler-macro quicklisp xpath jvm-class-verify-error | -------------------------------------------------------------------+--------
Comment(by ehuelsmann):
I'm using the following transcript to generate a failure and analyze the bytecode:
CL-USER(1): :ld c:/users/erik/quicklisp/setup.lisp CL-USER(2): (ql:quickload :xpath) [1] XPATH(3): 0 ;; aborts the exception handler of non-loadable code ;; Followed by pasting: CL-USER(4): (defun my-evaluate (xpath context &optional unordered-p) (xpath::evaluate-compiled (if (functionp xpath) xpath (xpath::compile-xpath xpath (xpath::make-dynamic-environment xpath::*dynamic-namespaces*))) context unordered-p)) MY-EVALUATE CL-USER(5): (define-compiler-macro my-evaluate (xpath context &optional unordered-p) (xpath::once-only (xpath) `(xpath::evaluate-compiled (if (functionp ,xpath) ,xpath (xpath::with-cache ((,xpath :test equal) (xpath::*dynamic-namespaces* :test xpath ::namespaces-match-p) (xpath::*profiling-enabled-p* :test eql)) (xpath::compile-xpath ,xpath (xpath::make-dynamic-environment xpath::*dynamic-namespaces*)))) ,context ,unordered-p))) MY-EVALUATE CL-USER(6): (SETF JVM::*COMPILER-DEBUG* T) CL-USER(7): (COMPILE NIL '(LAMBDA () (xpath:with-namespaces (("" "")) (my-evaluate "count(html/following::text())" (cxml:parse-rod "<html></html>" (cxml-dom:make-dom-builder))))))
Search the resulting bytecode listing for output along the lines of "ALOAD (20)". The 20 produces consistently on my machine, but only locals 0 to 9 have been allocated by the compiler. (To see that, evaluate "(trace jvm ::allocate-register)" before compilation.)
Next question: where does that 20 come from? So far I found out that the "ALOAD 20" command is being emitted by EMIT-PUSH-VARIABLE for a variable with name "L".