File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -9590,7 +9590,19 @@ GenTree* Compiler::fgMorphConst(GenTree* tree)
95909590    // guarantee slow performance for that block. Instead cache the return value
95919591    // of CORINFO_HELP_STRCNS and go to cache first giving reasonable perf.
95929592
9593+     bool useLazyStrCns = false;
95939594    if (compCurBB->bbJumpKind == BBJ_THROW)
9595+     {
9596+         useLazyStrCns = true;
9597+     }
9598+     else if (fgGlobalMorph && compCurStmt->GetRootNode()->IsCall())
9599+     {
9600+         // Quick check: if the root node of the current statement happens to be a noreturn call.
9601+         GenTreeCall* call = compCurStmt->GetRootNode()->AsCall();
9602+         useLazyStrCns     = call->IsNoReturn() || fgIsThrow(call);
9603+     }
9604+ 
9605+     if (useLazyStrCns)
95949606    {
95959607        CorInfoHelpFunc helper = info.compCompHnd->getLazyStringLiteralHelper(tree->AsStrCon()->gtScpHnd);
95969608        if (helper != CORINFO_HELP_UNDEF)
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments