< prev index next >

src/share/vm/code/exceptionHandlerTable.cpp

Print this page




 208 void ImplicitExceptionTable::copy_to( nmethod* nm ) {
 209   assert(size_in_bytes() <= nm->nul_chk_table_size(), "size of space allocated in nmethod incorrect");
 210   if (len() != 0) {
 211     implicit_null_entry* nmdata = (implicit_null_entry*)nm->nul_chk_table_begin();
 212     // store the length in the first uint
 213     nmdata[0] = _len;
 214     nmdata++;
 215     // copy the table after the length
 216     memmove( nmdata, _data, 2 * len() * sizeof(implicit_null_entry));
 217   } else {
 218     // zero length table takes zero bytes
 219     assert(size_in_bytes() == 0, "bad size");
 220     assert(nm->nul_chk_table_size() == 0, "bad size");
 221   }
 222 }
 223 
 224 void ImplicitExceptionTable::verify(nmethod *nm) const {
 225   for (uint i = 0; i < len(); i++) {
 226      if ((*adr(i) > (unsigned int)nm->insts_size()) ||
 227          (*(adr(i)+1) > (unsigned int)nm->insts_size()))
 228        fatal(err_msg("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data));
 229   }
 230 }


 208 void ImplicitExceptionTable::copy_to( nmethod* nm ) {
 209   assert(size_in_bytes() <= nm->nul_chk_table_size(), "size of space allocated in nmethod incorrect");
 210   if (len() != 0) {
 211     implicit_null_entry* nmdata = (implicit_null_entry*)nm->nul_chk_table_begin();
 212     // store the length in the first uint
 213     nmdata[0] = _len;
 214     nmdata++;
 215     // copy the table after the length
 216     memmove( nmdata, _data, 2 * len() * sizeof(implicit_null_entry));
 217   } else {
 218     // zero length table takes zero bytes
 219     assert(size_in_bytes() == 0, "bad size");
 220     assert(nm->nul_chk_table_size() == 0, "bad size");
 221   }
 222 }
 223 
 224 void ImplicitExceptionTable::verify(nmethod *nm) const {
 225   for (uint i = 0; i < len(); i++) {
 226      if ((*adr(i) > (unsigned int)nm->insts_size()) ||
 227          (*(adr(i)+1) > (unsigned int)nm->insts_size()))
 228        fatal("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data);
 229   }
 230 }
< prev index next >