Address CR feedback
authorMike Danes <onemihaid@hotmail.com>
Thu, 2 Jun 2016 04:38:46 +0000 (07:38 +0300)
committerMike Danes <onemihaid@hotmail.com>
Wed, 8 Jun 2016 18:30:44 +0000 (21:30 +0300)
Commit migrated from https://github.com/dotnet/coreclr/commit/e59999540b13544f6cc829cb2973bffbd3ff10a9

src/coreclr/src/jit/importer.cpp

index 3e67afd..d8bd87e 100644 (file)
@@ -2674,7 +2674,7 @@ BOOL            Compiler::impLocAllocOnStack()
 //    sig - The InitializeArray signature.
 //
 // Return Value:
-//    A pointer to the newly create GT_COPYBLK node if the replacement succeeds or
+//    A pointer to the newly created GT_COPYBLK node if the replacement succeeds or
 //    nullptr otherwise.
 //
 // Notes:
@@ -2848,7 +2848,7 @@ GenTreePtr      Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO * sig)
 
         if ((beginArgs == nullptr) ||
             (numArgsArg == nullptr) ||
-            (numArgsArg->Current()->OperGet() != GT_CNS_INT) ||
+            (!numArgsArg->Current()->IsCnsIntOrI()) ||
             (numArgsArg->Current()->AsIntCon()->IconValue() < 1) ||
             (numArgsArg->Current()->AsIntCon()->IconValue() > 64))
         {
@@ -2902,10 +2902,7 @@ GenTreePtr      Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO * sig)
                 {
                     GenTree* lowerBoundNode = arg->Current();
 
-                    if (lowerBoundNode->OperGet() != GT_CNS_INT)
-                        return nullptr;
-
-                    if (lowerBoundNode->AsIntCon()->IconValue() == 0)
+                    if (lowerBoundNode->IsIntegralConst(0))
                         isMDArray = false;
                 }
 
@@ -2914,7 +2911,7 @@ GenTreePtr      Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO * sig)
 
             GenTree* lengthNode = arg->Current();
 
-            if (lengthNode->OperGet() != GT_CNS_INT)
+            if (!lengthNode->IsCnsIntOrI())
                 return nullptr;
 
             numElements *= S_SIZE_T(lengthNode->AsIntCon()->IconValue());
@@ -4972,6 +4969,7 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken,
     }
 
     node->gtFlags |= args->gtFlags & GTF_GLOB_EFFECT;
+    node->gtCall.compileTimeHelperArgumentHandle = (CORINFO_GENERIC_HANDLE)pResolvedToken->hClass;
 
     // Remember that this basic block contains 'new' of a md array
     compCurBB->bbFlags |= BBF_HAS_NEWARRAY;