Browse Source

* some optimizations in TWasmLocalVars.dealloc(index: integer)

git-svn-id: branches/wasm@47790 -
nickysn 4 years ago
parent
commit
58d361049f
1 changed files with 5 additions and 3 deletions
  1. 5 3
      compiler/wasm32/tgcpu.pas

+ 5 - 3
compiler/wasm32/tgcpu.pas

@@ -454,10 +454,12 @@ unit tgcpu;
 
 
     procedure TWasmLocalVars.dealloc(index: integer);
     procedure TWasmLocalVars.dealloc(index: integer);
       var
       var
-        bt: TWasmBasicType;
+        lc : TWasmLocal;
       begin
       begin
-        for bt in TWasmBasicType do
-          dealloc(bt,index);
+        lc := first;
+        while Assigned(lc) and (lc.index <> index) do
+          lc := lc.nextseq;
+        if Assigned(lc) then lc.inuse := false;
       end;
       end;