(defun comp-jump-table-optimizable (jmp-table)
"Return t if JMP-TABLE can be optimized out."
+ ;; Identify LAP sequences like:
+ ;; (byte-constant #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (created 126 deleted 126 changed 126)) . 24)
+ ;; (byte-switch)
+ ;; (TAG 126 . 10)
(cl-loop
with labels = (cl-loop for target-label being each hash-value of jmp-table
collect target-label)
for l in (cdr-safe labels)
unless (= l x)
return nil
- finally return t))
+ finally return (pcase (nth (1+ (comp-limplify-pc comp-pass))
+ (comp-func-lap comp-func))
+ (`(TAG ,label . ,_label-sp)
+ (= label l)))))
(defun comp-emit-switch (var last-insn)
"Emit a Limple for a lap jump table given VAR and LAST-INSN."
(defun comp-test-48029-nonascii-žžž-f (arg)
(when arg t))
+(defun comp-test-62537-1-f ())
+
+(defun comp-test-62537-2-f ()
+ (when (let ((val (comp-test-62537-1-f)))
+ (cond
+ ((eq val 'x)
+ t)
+ ((eq val 'y)
+ 'y)))
+ (comp-test-62537-1-f))
+ t)
+
+
\f
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;