Kaynağa Gözat

- get rid of treference.islocal. Instead, use checks whether treference.base
is equal to NR_LOCAL_STACK_POINTER_REG

git-svn-id: branches/wasm@47779 -

nickysn 4 yıl önce
ebeveyn
işleme
bfb13fb848
3 değiştirilmiş dosya ile 2 ekleme ve 16 silme
  1. 0 3
      compiler/cgutils.pas
  2. 2 12
      compiler/wasm32/hlcgcpu.pas
  3. 0 1
      compiler/wasm32/tgcpu.pas

+ 0 - 3
compiler/cgutils.pas

@@ -106,9 +106,6 @@ unit cgutils;
          indexoffset: aint;
          checkcast: boolean;
 {$endif jvm}
-{$ifdef wasm}
-        islocal: boolean;  // true (local variable), false (memory offset)
-{$endif wasm}
          volatility: tvolatilityset;
          alignment : byte;
       end;

+ 2 - 12
compiler/wasm32/hlcgcpu.pas

@@ -243,8 +243,6 @@ uses
       procedure concatcopy_record(list: TAsmList; size: tdef; const source, dest: treference);
       procedure concatcopy_set(list: TAsmList; size: tdef; const source, dest: treference);
       procedure concatcopy_shortstring(list: TAsmList; size: tdef; const source, dest: treference);
-
-      procedure paravarsym_set_initialloc_to_paraloc(vs: tparavarsym); override;
     end;
 
 implementation
@@ -1017,7 +1015,7 @@ implementation
     begin
       result:=0;
       { fake location that indicates the value is already on the stack? }
-      if (ref.base=NR_EVAL_STACK_BASE) or (ref.islocal) then
+      if (ref.base=NR_EVAL_STACK_BASE) or (ref.base=NR_LOCAL_STACK_POINTER_REG) then
         exit;
 
       // setting up memory offset
@@ -1582,14 +1580,6 @@ implementation
         decstack(list,2);
       end;
 
-    procedure thlcgwasm.paravarsym_set_initialloc_to_paraloc(vs: tparavarsym);
-      begin
-        // mark all callee side parameters AS local!
-        inherited paravarsym_set_initialloc_to_paraloc(vs);
-        if (vs.initialloc.loc = LOC_REFERENCE) then
-          vs.initialloc.reference.islocal := true;
-      end;
-
   procedure thlcgwasm.g_concatcopy(list: TAsmList; size: tdef; const source, dest: treference);
     var
       handled: boolean;
@@ -2187,7 +2177,7 @@ implementation
       getputmemf32 : array [boolean] of TAsmOp = (a_f32_store, a_f32_load);
       getputmemf64 : array [boolean] of TAsmOp = (a_f64_store, a_f64_load);
     begin
-      if (not ref.islocal) or assigned(ref.symbol) then
+      if (ref.base<>NR_LOCAL_STACK_POINTER_REG) or assigned(ref.symbol) then
         begin
           { -> either a global (static) field, or a regular field. If a regular
             field, then ref.base contains the self pointer, otherwise

+ 0 - 1
compiler/wasm32/tgcpu.pas

@@ -398,7 +398,6 @@ unit tgcpu;
     procedure ttgwasm.localVarToRef(idx: integer; size: integer; out ref: treference);
       begin
         reference_reset_base(ref,NR_LOCAL_STACK_POINTER_REG,idx,ctempposinvalid,size,[]);
-        ref.islocal := true;
         updateFirstTemp;
       end;