hotspot/src/share/vm/classfile/javaClasses.cpp
changeset 9133 1c8d07466fdb
parent 9116 9bc44be338d6
parent 9132 59f29856d4b2
child 9321 c29711c6ae35
equal deleted inserted replaced
9124:f60dee480d49 9133:1c8d07466fdb
  1429           continue;
  1429           continue;
  1430         }
  1430         }
  1431       }
  1431       }
  1432     }
  1432     }
  1433 #ifdef ASSERT
  1433 #ifdef ASSERT
  1434   assert(st_method() == method && st.bci() == bci,
  1434     assert(st_method() == method && st.bci() == bci,
  1435          "Wrong stack trace");
  1435            "Wrong stack trace");
  1436   st.next();
  1436     st.next();
  1437   // vframeStream::method isn't GC-safe so store off a copy
  1437     // vframeStream::method isn't GC-safe so store off a copy
  1438   // of the methodOop in case we GC.
  1438     // of the methodOop in case we GC.
  1439   if (!st.at_end()) {
  1439     if (!st.at_end()) {
  1440     st_method = st.method();
  1440       st_method = st.method();
  1441   }
  1441     }
  1442 #endif
  1442 #endif
       
  1443 
       
  1444     // the format of the stacktrace will be:
       
  1445     // - 1 or more fillInStackTrace frames for the exception class (skipped)
       
  1446     // - 0 or more <init> methods for the exception class (skipped)
       
  1447     // - rest of the stack
       
  1448 
  1443     if (!skip_fillInStackTrace_check) {
  1449     if (!skip_fillInStackTrace_check) {
  1444       // check "fillInStackTrace" only once, so we negate the flag
  1450       if ((method->name() == vmSymbols::fillInStackTrace_name() ||
  1445       // after the first time check.
  1451            method->name() == vmSymbols::fillInStackTrace0_name()) &&
  1446       skip_fillInStackTrace_check = true;
  1452           throwable->is_a(method->method_holder())) {
  1447       if (method->name() == vmSymbols::fillInStackTrace_name()) {
       
  1448         continue;
  1453         continue;
  1449       }
  1454       }
       
  1455       else {
       
  1456         skip_fillInStackTrace_check = true; // gone past them all
       
  1457       }
  1450     }
  1458     }
  1451     // skip <init> methods of the exceptions klass. If there is <init> methods
       
  1452     // that belongs to a superclass of the exception  we are going to skipping
       
  1453     // them in stack trace. This is simlar to classic VM.
       
  1454     if (!skip_throwableInit_check) {
  1459     if (!skip_throwableInit_check) {
       
  1460       assert(skip_fillInStackTrace_check, "logic error in backtrace filtering");
       
  1461 
       
  1462       // skip <init> methods of the exception class and superclasses
       
  1463       // This is simlar to classic VM.
  1455       if (method->name() == vmSymbols::object_initializer_name() &&
  1464       if (method->name() == vmSymbols::object_initializer_name() &&
  1456           throwable->is_a(method->method_holder())) {
  1465           throwable->is_a(method->method_holder())) {
  1457         continue;
  1466         continue;
  1458       } else {
  1467       } else {
  1459         // if no "Throwable.init()" method found, we stop checking it next time.
  1468         // there are none or we've seen them all - either way stop checking
  1460         skip_throwableInit_check = true;
  1469         skip_throwableInit_check = true;
  1461       }
  1470       }
  1462     }
  1471     }
  1463     bt.push(method, bci, CHECK);
  1472     bt.push(method, bci, CHECK);
  1464     total_count++;
  1473     total_count++;