src/share/vm/oops/constMethodKlass.cpp

changeset 3917
8150fa46d2ed
parent 3826
2fe087c3e814
     1.1 --- a/src/share/vm/oops/constMethodKlass.cpp	Mon Jun 25 15:34:06 2012 -0400
     1.2 +++ b/src/share/vm/oops/constMethodKlass.cpp	Tue Jun 26 19:08:44 2012 -0400
     1.3 @@ -65,6 +65,7 @@
     1.4  constMethodOop constMethodKlass::allocate(int byte_code_size,
     1.5                                            int compressed_line_number_size,
     1.6                                            int localvariable_table_length,
     1.7 +                                          int exception_table_length,
     1.8                                            int checked_exceptions_length,
     1.9                                            bool is_conc_safe,
    1.10                                            TRAPS) {
    1.11 @@ -72,6 +73,7 @@
    1.12    int size = constMethodOopDesc::object_size(byte_code_size,
    1.13                                               compressed_line_number_size,
    1.14                                               localvariable_table_length,
    1.15 +                                             exception_table_length,
    1.16                                               checked_exceptions_length);
    1.17    KlassHandle h_k(THREAD, as_klassOop());
    1.18    constMethodOop cm = (constMethodOop)
    1.19 @@ -82,12 +84,12 @@
    1.20    cm->init_fingerprint();
    1.21    cm->set_constants(NULL);
    1.22    cm->set_stackmap_data(NULL);
    1.23 -  cm->set_exception_table(NULL);
    1.24    cm->set_code_size(byte_code_size);
    1.25    cm->set_constMethod_size(size);
    1.26    cm->set_inlined_tables_length(checked_exceptions_length,
    1.27                                  compressed_line_number_size,
    1.28 -                                localvariable_table_length);
    1.29 +                                localvariable_table_length,
    1.30 +                                exception_table_length);
    1.31    assert(cm->size() == size, "wrong size for object");
    1.32    cm->set_is_conc_safe(is_conc_safe);
    1.33    cm->set_partially_loaded();
    1.34 @@ -100,7 +102,6 @@
    1.35    constMethodOop cm = constMethodOop(obj);
    1.36    MarkSweep::mark_and_push(cm->adr_constants());
    1.37    MarkSweep::mark_and_push(cm->adr_stackmap_data());
    1.38 -  MarkSweep::mark_and_push(cm->adr_exception_table());
    1.39    // Performance tweak: We skip iterating over the klass pointer since we
    1.40    // know that Universe::constMethodKlassObj never moves.
    1.41  }
    1.42 @@ -112,7 +113,6 @@
    1.43    constMethodOop cm_oop = constMethodOop(obj);
    1.44    PSParallelCompact::mark_and_push(cm, cm_oop->adr_constants());
    1.45    PSParallelCompact::mark_and_push(cm, cm_oop->adr_stackmap_data());
    1.46 -  PSParallelCompact::mark_and_push(cm, cm_oop->adr_exception_table());
    1.47    // Performance tweak: We skip iterating over the klass pointer since we
    1.48    // know that Universe::constMethodKlassObj never moves.
    1.49  }
    1.50 @@ -123,7 +123,6 @@
    1.51    constMethodOop cm = constMethodOop(obj);
    1.52    blk->do_oop(cm->adr_constants());
    1.53    blk->do_oop(cm->adr_stackmap_data());
    1.54 -  blk->do_oop(cm->adr_exception_table());
    1.55    // Get size before changing pointers.
    1.56    // Don't call size() or oop_size() since that is a virtual call.
    1.57    int size = cm->object_size();
    1.58 @@ -139,8 +138,6 @@
    1.59    if (mr.contains(adr)) blk->do_oop(adr);
    1.60    adr = cm->adr_stackmap_data();
    1.61    if (mr.contains(adr)) blk->do_oop(adr);
    1.62 -  adr = cm->adr_exception_table();
    1.63 -  if (mr.contains(adr)) blk->do_oop(adr);
    1.64    // Get size before changing pointers.
    1.65    // Don't call size() or oop_size() since that is a virtual call.
    1.66    int size = cm->object_size();
    1.67 @@ -155,7 +152,6 @@
    1.68    constMethodOop cm = constMethodOop(obj);
    1.69    MarkSweep::adjust_pointer(cm->adr_constants());
    1.70    MarkSweep::adjust_pointer(cm->adr_stackmap_data());
    1.71 -  MarkSweep::adjust_pointer(cm->adr_exception_table());
    1.72    // Get size before changing pointers.
    1.73    // Don't call size() or oop_size() since that is a virtual call.
    1.74    int size = cm->object_size();
    1.75 @@ -190,7 +186,6 @@
    1.76    constMethodOop m = constMethodOop(obj);
    1.77    st->print(" - constants:       " INTPTR_FORMAT " ", (address)m->constants());
    1.78    m->constants()->print_value_on(st); st->cr();
    1.79 -  st->print(" - exceptions:   " INTPTR_FORMAT "\n", (address)m->exception_table());
    1.80    if (m->has_stackmap_table()) {
    1.81      st->print(" - stackmap data:       ");
    1.82      m->stackmap_data()->print_value_on(st);
    1.83 @@ -228,8 +223,6 @@
    1.84      typeArrayOop stackmap_data = m->stackmap_data();
    1.85      guarantee(stackmap_data == NULL ||
    1.86                stackmap_data->is_perm(),  "should be in permspace");
    1.87 -    guarantee(m->exception_table()->is_perm(), "should be in permspace");
    1.88 -    guarantee(m->exception_table()->is_typeArray(), "should be type array");
    1.89  
    1.90      address m_end = (address)((oop*) m + m->size());
    1.91      address compressed_table_start = m->code_end();
    1.92 @@ -244,11 +237,15 @@
    1.93        compressed_table_end += stream.position();
    1.94      }
    1.95      guarantee(compressed_table_end <= m_end, "invalid method layout");
    1.96 -    // Verify checked exceptions and local variable tables
    1.97 +    // Verify checked exceptions, exception table and local variable tables
    1.98      if (m->has_checked_exceptions()) {
    1.99        u2* addr = m->checked_exceptions_length_addr();
   1.100        guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout");
   1.101      }
   1.102 +    if (m->has_exception_handler()) {
   1.103 +      u2* addr = m->exception_table_length_addr();
   1.104 +      guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout");
   1.105 +    }
   1.106      if (m->has_localvariable_table()) {
   1.107        u2* addr = m->localvariable_table_length_addr();
   1.108        guarantee(*addr > 0 && (address) addr >= compressed_table_end && (address) addr < m_end, "invalid method layout");
   1.109 @@ -257,12 +254,12 @@
   1.110      u2* uncompressed_table_start;
   1.111      if (m->has_localvariable_table()) {
   1.112        uncompressed_table_start = (u2*) m->localvariable_table_start();
   1.113 +    } else if (m->has_exception_handler()) {
   1.114 +      uncompressed_table_start = (u2*) m->exception_table_start();
   1.115 +    } else if (m->has_checked_exceptions()) {
   1.116 +        uncompressed_table_start = (u2*) m->checked_exceptions_start();
   1.117      } else {
   1.118 -      if (m->has_checked_exceptions()) {
   1.119 -        uncompressed_table_start = (u2*) m->checked_exceptions_start();
   1.120 -      } else {
   1.121          uncompressed_table_start = (u2*) m_end;
   1.122 -      }
   1.123      }
   1.124      int gap = (intptr_t) uncompressed_table_start - (intptr_t) compressed_table_end;
   1.125      int max_gap = align_object_size(1)*BytesPerWord;
   1.126 @@ -273,8 +270,8 @@
   1.127  bool constMethodKlass::oop_partially_loaded(oop obj) const {
   1.128    assert(obj->is_constMethod(), "object must be klass");
   1.129    constMethodOop m = constMethodOop(obj);
   1.130 -  // check whether exception_table points to self (flag for partially loaded)
   1.131 -  return m->exception_table() == (typeArrayOop)obj;
   1.132 +  // check whether stackmap_data points to self (flag for partially loaded)
   1.133 +  return m->stackmap_data() == (typeArrayOop)obj;
   1.134  }
   1.135  
   1.136  
   1.137 @@ -282,6 +279,6 @@
   1.138  void constMethodKlass::oop_set_partially_loaded(oop obj) {
   1.139    assert(obj->is_constMethod(), "object must be klass");
   1.140    constMethodOop m = constMethodOop(obj);
   1.141 -  // Temporarily set exception_table to point to self
   1.142 -  m->set_exception_table((typeArrayOop)obj);
   1.143 +  // Temporarily set stackmap_data to point to self
   1.144 +  m->set_stackmap_data((typeArrayOop)obj);
   1.145  }

mercurial