فهرست منبع

* The label which is generated by traisenode is not a jump target. Mark
this label as nf_internal, which means the label does not impact the
code flow. This leads to a much better register allocation.

(cherry picked from commit e04df465efe7fdbdc8ebe6b812789daa0bea0e25)

Yuriy Sydorov 3 سال پیش
والد
کامیت
41c9661d6d
2فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 2 2
      compiler/ncgflw.pas
  2. 3 1
      compiler/nflw.pas

+ 2 - 2
compiler/ncgflw.pas

@@ -512,8 +512,8 @@ implementation
     procedure tcglabelnode.pass_generate_code;
     procedure tcglabelnode.pass_generate_code;
       begin
       begin
          location_reset(location,LOC_VOID,OS_NO);
          location_reset(location,LOC_VOID,OS_NO);
-
-         include(flowcontrol,fc_gotolabel);
+         if not (nf_internal in flags) then
+           include(flowcontrol,fc_gotolabel);
 {$ifdef OLDREGVARS}
 {$ifdef OLDREGVARS}
          load_all_regvars(current_asmdata.CurrAsmList);
          load_all_regvars(current_asmdata.CurrAsmList);
 {$endif OLDREGVARS}
 {$endif OLDREGVARS}

+ 3 - 1
compiler/nflw.pas

@@ -2118,7 +2118,8 @@ implementation
         result:=nil;
         result:=nil;
         expectloc:=LOC_VOID;
         expectloc:=LOC_VOID;
 
 
-        include(current_procinfo.flags,pi_has_label);
+        if not (nf_internal in flags) then
+          include(current_procinfo.flags,pi_has_label);
 
 
         if assigned(labsym) and labsym.nonlocal then
         if assigned(labsym) and labsym.nonlocal then
           begin
           begin
@@ -2223,6 +2224,7 @@ implementation
               begin
               begin
                 third:=cinlinenode.create(in_get_frame,false,nil);
                 third:=cinlinenode.create(in_get_frame,false,nil);
                 current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
                 current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
+                current_addr.toggleflag(nf_internal);
                 addstatement(statements,current_addr);
                 addstatement(statements,current_addr);
                 right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
                 right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
               end;
               end;