changeset 2694:da6a29fb0da5

7054211: No loop unrolling done in jdk7b144 for a test update() while loop Summary: restore unrolling code for CaffeineMark. Reviewed-by: never
author kvn
date Wed, 07 Sep 2011 12:58:42 -0700
parents c2d3caa64b3e
children 5432047c7db7
files src/share/vm/opto/loopTransform.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/loopTransform.cpp	Wed Sep 07 09:35:52 2011 +0200
+++ b/src/share/vm/opto/loopTransform.cpp	Wed Sep 07 12:58:42 2011 -0700
@@ -709,10 +709,13 @@
 
   // Adjust body_size to determine if we unroll or not
   uint body_size = _body.size();
+  // Key test to unroll loop in CRC32 java code
+  int xors_in_loop = 0;
   // Also count ModL, DivL and MulL which expand mightly
   for (uint k = 0; k < _body.size(); k++) {
     Node* n = _body.at(k);
     switch (n->Opcode()) {
+      case Op_XorI: xors_in_loop++; break; // CRC32 java code
       case Op_ModL: body_size += 30; break;
       case Op_DivL: body_size += 30; break;
       case Op_MulL: body_size += 10; break;
@@ -729,7 +732,8 @@
 
   // Check for being too big
   if (body_size > (uint)LoopUnrollLimit) {
-     // Normal case: loop too big
+    if (xors_in_loop >= 4 && body_size < (uint)LoopUnrollLimit*4) return true;
+    // Normal case: loop too big
     return false;
   }