From c6187dc679a536686afbdeb0999346699df625ce Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Tue, 30 Aug 2022 01:54:45 -0700 Subject: Use `LETT` less often (#22) This patch has the Lisp backend use less often the `LETT` opcode. In fact, it is no longer used by the Spad compiler codegen. However, a few cases in the interpreter continues to use it. --- src/interp/lisp-backend.boot | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 8894db4f..722fa9b0 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -842,11 +842,14 @@ massageBackendCode x == atomic? x => nil -- temporarily have TRACELET report MAKEPROPs. if (u := first x) = "MAKEPROP" and $TRACELETFLAG then - x.first := "MAKEPROP-SAY" + x.op := "MAKEPROP-SAY" u in '(DCQ SPADLET SETQ %LET) => if u in '(SPADLET %LET) then - append!(x,$FUNNAME__TAIL) - x.first := "LETT" + if x.args is [y,.] and ident? y then + x.op := "SETQ" + else + x.op := "LETT" + append!(x,$FUNNAME__TAIL) massageBackendCode CDDR x if u ~= "SETQ" then ident? second x => pushLocalVariable second x -- cgit v1.2.3