やっと BRANCH が動いた - Jit
Fixnum の範囲でしか動かない。Bignum になると SIGTRAP 。
(define (BRANCH_NOT_LT label) (let ([label1 (gensym)] [label2 (gensym)]) `((movq rax ,(vm-register 'sp)) ; rax = sp (leaq rdx (& rax -8)) ; rdx = sp - 8 (movq rdx ,(vm-register 'sp)) ; sp = sp - 8 (movq rdx (& rax -8)) ; rax = *sp (movl eax edx) ; eax = (32bit)(rdx) (andl eax 3) ; n.isFixnum (subb al 1) ; (je ,label1) ; ;; ToDo : not Fixnum case here ,(DEBUGGER) (label ,label2) ; ac or n is not fixnum case ,(DEBUGGER) (label ,label1) (movq rcx ,(vm-register 'ac)) ; rcx = ac (movl eax ecx) ; eax = (32bit)(rcx) (andl eax 3) ; ac.isFixnum (subb al 1) (jne ,label2) (sarq rdx 2) ; rdx.toFixnum() (sarq rcx 2) ; rcx.toFixnum() (movq rax ,(get-c-address 'Object::False)) ; eax = pointer to False (cmpq rdx rcx) ; lt condition? (movq rdx ,(get-c-address 'Object::True)) ; edx = pointer to True (cmovl rax rdx) ; if condition? then rax = rdx (movq rax (& rax)) ; rax = True or False ; ,(DEBUGGER) (movq ,(vm-register 'ac) rax) (cmpq ,(vm-register 'ac) 86) ; ac.isFalse() (je ,label))))