Weekend off, pretty much#
Mon Dec 2 16:30:43 2002
Weekend off, pretty much. Weekend spent preparing for, co-ordinating and recovering from my friend Simon's stag night.
write diary and plan the next bit, he said on Thursday. Said plans have not yet reached the enemy, because still wrestling with bugs in the current bit. Most of them fairly silly bugs once found : what's wrong with this code?
(define-vop (bind) (:args (val :scs (any-reg descriptor-reg)) (symbol :scs (descriptor-reg))) (:temporary (:sc unsigned-reg) tls-index temp bsp) (:generator 5 (let ((tls-index-valid (gen-label))) (load-tl-symbol-value bsp *binding-stack-pointer*) (loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag) (inst add bsp (* binding-size n-word-bytes)) (store-tl-symbol-value bsp *binding-stack-pointer* temp) (inst jmp :ne tls-index-valid) ;; allocate a new tls-index [...]
That's right. There's no test before we do the conditional jump. Let's try
(define-vop (bind) (:args (val :scs (any-reg descriptor-reg)) (symbol :scs (descriptor-reg))) (:temporary (:sc unsigned-reg) tls-index temp bsp) (:generator 5 (let ((tls-index-valid (gen-label))) (load-tl-symbol-value bsp *binding-stack-pointer*) (loadw tls-index symbol symbol-tls-index-slot other-pointer-lowtag) (inst add bsp (* binding-size n-word-bytes)) (store-tl-symbol-value bsp *binding-stack-pointer* temp) (or tls-index tls-index) (inst jmp :ne tls-index-valid) ;; allocate a new tls-index
(inst or tls-index tls-index)
and things are substantially rosier. Now we make it all the way through cold initialization to the toplevel, but break with what looks like random memory corruption shortly afterwards.