< prev index next >

src/share/vm/oops/generateOopMap.cpp

Print this page

        

@@ -235,10 +235,12 @@
         add_jsr(i.next_bci(), i.dest());
         break;
       case Bytecodes::_jsr_w:
         add_jsr(i.next_bci(), i.dest_w());
         break;
+      default:
+        break;
     }
   }
 }
 
 void RetTable::add_jsr(int return_bci, int target_bci) {

@@ -428,10 +430,12 @@
         break;
       case Bytecodes::_jsr_w:
         assert(!fellThrough, "should not happen");
         bb_mark_fct(this, bci + Bytecodes::length_for(bytecode), NULL);
         break;
+      default:
+        break;
     }
 
     if (possible_gc_point(&bcs))
       _gc_points++;
   }

@@ -487,10 +491,12 @@
           case Bytecodes::_jsr:
           case Bytecodes::_jsr_w:
             assert(!fell_through, "should not happen");
             reachable_basicblock(this, bci + Bytecodes::length_for(bytecode), &change);
             break;
+          default:
+            break;
         }
         if (fell_through) {
           // Mark successor as alive
           if (bb[1].is_dead()) {
             bb[1].mark_as_alive();

@@ -1185,10 +1191,13 @@
       // could throw an exception.
       if (_monitor_top != bad_monitors && _monitor_top != 0) {
         return;
       }
       break;
+
+    default:
+      break;
   }
 
   if (_has_exceptions) {
     int bci = itr->bci();
     ExceptionTable exct(method());

@@ -1270,62 +1279,55 @@
 
 // Print the state values at the current bytecode.
 void GenerateOopMap::print_current_state(outputStream   *os,
                                          BytecodeStream *currentBC,
                                          bool            detailed) {
-
   if (detailed) {
     os->print("     %4d vars     = ", currentBC->bci());
     print_states(os, vars(), _max_locals);
     os->print("    %s", Bytecodes::name(currentBC->code()));
+  } else {
+    os->print("    %4d  vars = '%s' ", currentBC->bci(),  state_vec_to_string(vars(), _max_locals));
+    os->print("     stack = '%s' ", state_vec_to_string(stack(), _stack_top));
+    if (_monitor_top != bad_monitors) {
+      os->print("  monitors = '%s'  \t%s", state_vec_to_string(monitors(), _monitor_top), Bytecodes::name(currentBC->code()));
+    } else {
+      os->print("  [bad monitor stack]");
+    }
+  }
+
     switch(currentBC->code()) {
       case Bytecodes::_invokevirtual:
       case Bytecodes::_invokespecial:
       case Bytecodes::_invokestatic:
       case Bytecodes::_invokedynamic:
-      case Bytecodes::_invokeinterface:
+    case Bytecodes::_invokeinterface: {
         int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache();
         ConstantPool* cp      = method()->constants();
         int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
         int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
         Symbol* signature     = cp->symbol_at(signatureIdx);
         os->print("%s", signature->as_C_string());
     }
+    default:
+      break;
+  }
+
+  if (detailed) {
     os->cr();
     os->print("          stack    = ");
     print_states(os, stack(), _stack_top);
     os->cr();
     if (_monitor_top != bad_monitors) {
       os->print("          monitors = ");
       print_states(os, monitors(), _monitor_top);
     } else {
       os->print("          [bad monitor stack]");
     }
-    os->cr();
-  } else {
-    os->print("    %4d  vars = '%s' ", currentBC->bci(),  state_vec_to_string(vars(), _max_locals));
-    os->print("     stack = '%s' ", state_vec_to_string(stack(), _stack_top));
-    if (_monitor_top != bad_monitors) {
-      os->print("  monitors = '%s'  \t%s", state_vec_to_string(monitors(), _monitor_top), Bytecodes::name(currentBC->code()));
-    } else {
-      os->print("  [bad monitor stack]");
-    }
-    switch(currentBC->code()) {
-      case Bytecodes::_invokevirtual:
-      case Bytecodes::_invokespecial:
-      case Bytecodes::_invokestatic:
-      case Bytecodes::_invokedynamic:
-      case Bytecodes::_invokeinterface:
-        int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache();
-        ConstantPool* cp      = method()->constants();
-        int nameAndTypeIdx    = cp->name_and_type_ref_index_at(idx);
-        int signatureIdx      = cp->signature_ref_index_at(nameAndTypeIdx);
-        Symbol* signature     = cp->symbol_at(signatureIdx);
-        os->print("%s", signature->as_C_string());
     }
+  
     os->cr();
-  }
 }
 
 // Sets the current state to be the state after executing the
 // current instruction, starting in the current state.
 void GenerateOopMap::interp1(BytecodeStream *itr) {

@@ -2474,12 +2476,13 @@
       *index = bc - Bytecodes::_astore_0;
       return true;
     case Bytecodes::_astore:
       *index = itr->get_index();
       return true;
-  }
+    default:
   return false;
+  }
 }
 
 bool GenerateOopMap::is_aload(BytecodeStream *itr, int *index) {
   Bytecodes::Code bc = itr->code();
   switch(bc) {

@@ -2491,12 +2494,14 @@
       return true;
 
     case Bytecodes::_aload:
       *index = itr->get_index();
       return true;
-  }
+
+    default:
   return false;
+  }
 }
 
 
 // Return true iff the top of the operand stack holds a return address at
 // the current instruction
< prev index next >