src/share/vm/oops/cpCacheOop.cpp

Tue, 21 Apr 2009 23:21:04 -0700

author
jrose
date
Tue, 21 Apr 2009 23:21:04 -0700
changeset 1161
be93aad57795
parent 631
d1605aabd0a1
child 1279
bd02caa94611
permissions
-rw-r--r--

6655646: dynamic languages need dynamically linked call sites
Summary: invokedynamic instruction (JSR 292 RI)
Reviewed-by: twisti, never

duke@435 1 /*
xdono@631 2 * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 #include "incls/_precompiled.incl"
duke@435 26 #include "incls/_cpCacheOop.cpp.incl"
duke@435 27
duke@435 28
duke@435 29 // Implememtation of ConstantPoolCacheEntry
duke@435 30
duke@435 31 void ConstantPoolCacheEntry::set_initial_state(int index) {
jrose@1161 32 if (constantPoolCacheOopDesc::is_secondary_index(index)) {
jrose@1161 33 // Hack: The rewriter is trying to say that this entry itself
jrose@1161 34 // will be a secondary entry.
jrose@1161 35 int main_index = constantPoolCacheOopDesc::decode_secondary_index(index);
jrose@1161 36 assert(0 <= main_index && main_index < 0x10000, "sanity check");
jrose@1161 37 _indices = (main_index << 16);
jrose@1161 38 assert(main_entry_index() == main_index, "");
jrose@1161 39 return;
jrose@1161 40 }
jrose@1161 41 assert(0 < index && index < 0x10000, "sanity check");
duke@435 42 _indices = index;
jrose@1161 43 assert(constant_pool_index() == index, "");
duke@435 44 }
duke@435 45
duke@435 46
duke@435 47 int ConstantPoolCacheEntry::as_flags(TosState state, bool is_final,
duke@435 48 bool is_vfinal, bool is_volatile,
duke@435 49 bool is_method_interface, bool is_method) {
duke@435 50 int f = state;
duke@435 51
duke@435 52 assert( state < number_of_states, "Invalid state in as_flags");
duke@435 53
duke@435 54 f <<= 1;
duke@435 55 if (is_final) f |= 1;
duke@435 56 f <<= 1;
duke@435 57 if (is_vfinal) f |= 1;
duke@435 58 f <<= 1;
duke@435 59 if (is_volatile) f |= 1;
duke@435 60 f <<= 1;
duke@435 61 if (is_method_interface) f |= 1;
duke@435 62 f <<= 1;
duke@435 63 if (is_method) f |= 1;
duke@435 64 f <<= ConstantPoolCacheEntry::hotSwapBit;
duke@435 65 // Preserve existing flag bit values
duke@435 66 #ifdef ASSERT
duke@435 67 int old_state = ((_flags >> tosBits) & 0x0F);
duke@435 68 assert(old_state == 0 || old_state == state,
duke@435 69 "inconsistent cpCache flags state");
duke@435 70 #endif
duke@435 71 return (_flags | f) ;
duke@435 72 }
duke@435 73
duke@435 74 void ConstantPoolCacheEntry::set_bytecode_1(Bytecodes::Code code) {
duke@435 75 #ifdef ASSERT
duke@435 76 // Read once.
duke@435 77 volatile Bytecodes::Code c = bytecode_1();
duke@435 78 assert(c == 0 || c == code || code == 0, "update must be consistent");
duke@435 79 #endif
duke@435 80 // Need to flush pending stores here before bytecode is written.
duke@435 81 OrderAccess::release_store_ptr(&_indices, _indices | ((u_char)code << 16));
duke@435 82 }
duke@435 83
duke@435 84 void ConstantPoolCacheEntry::set_bytecode_2(Bytecodes::Code code) {
duke@435 85 #ifdef ASSERT
duke@435 86 // Read once.
duke@435 87 volatile Bytecodes::Code c = bytecode_2();
duke@435 88 assert(c == 0 || c == code || code == 0, "update must be consistent");
duke@435 89 #endif
duke@435 90 // Need to flush pending stores here before bytecode is written.
duke@435 91 OrderAccess::release_store_ptr(&_indices, _indices | ((u_char)code << 24));
duke@435 92 }
duke@435 93
duke@435 94 #ifdef ASSERT
duke@435 95 // It is possible to have two different dummy methodOops created
duke@435 96 // when the resolve code for invoke interface executes concurrently
duke@435 97 // Hence the assertion below is weakened a bit for the invokeinterface
duke@435 98 // case.
duke@435 99 bool ConstantPoolCacheEntry::same_methodOop(oop cur_f1, oop f1) {
duke@435 100 return (cur_f1 == f1 || ((methodOop)cur_f1)->name() ==
duke@435 101 ((methodOop)f1)->name() || ((methodOop)cur_f1)->signature() ==
duke@435 102 ((methodOop)f1)->signature());
duke@435 103 }
duke@435 104 #endif
duke@435 105
duke@435 106 // Note that concurrent update of both bytecodes can leave one of them
duke@435 107 // reset to zero. This is harmless; the interpreter will simply re-resolve
duke@435 108 // the damaged entry. More seriously, the memory synchronization is needed
duke@435 109 // to flush other fields (f1, f2) completely to memory before the bytecodes
duke@435 110 // are updated, lest other processors see a non-zero bytecode but zero f1/f2.
duke@435 111 void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
duke@435 112 Bytecodes::Code put_code,
duke@435 113 KlassHandle field_holder,
duke@435 114 int orig_field_index,
duke@435 115 int field_offset,
duke@435 116 TosState field_type,
duke@435 117 bool is_final,
duke@435 118 bool is_volatile) {
duke@435 119 set_f1(field_holder());
duke@435 120 set_f2(field_offset);
duke@435 121 // The field index is used by jvm/ti and is the index into fields() array
duke@435 122 // in holder instanceKlass. This is scaled by instanceKlass::next_offset.
duke@435 123 assert((orig_field_index % instanceKlass::next_offset) == 0, "wierd index");
duke@435 124 const int field_index = orig_field_index / instanceKlass::next_offset;
duke@435 125 assert(field_index <= field_index_mask,
duke@435 126 "field index does not fit in low flag bits");
duke@435 127 set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) |
duke@435 128 (field_index & field_index_mask));
duke@435 129 set_bytecode_1(get_code);
duke@435 130 set_bytecode_2(put_code);
duke@435 131 NOT_PRODUCT(verify(tty));
duke@435 132 }
duke@435 133
duke@435 134 int ConstantPoolCacheEntry::field_index() const {
duke@435 135 return (_flags & field_index_mask) * instanceKlass::next_offset;
duke@435 136 }
duke@435 137
duke@435 138 void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
duke@435 139 methodHandle method,
duke@435 140 int vtable_index) {
duke@435 141
duke@435 142 assert(method->interpreter_entry() != NULL, "should have been set at this point");
duke@435 143 assert(!method->is_obsolete(), "attempt to write obsolete method to cpCache");
duke@435 144 bool change_to_virtual = (invoke_code == Bytecodes::_invokeinterface);
duke@435 145
duke@435 146 int byte_no = -1;
duke@435 147 bool needs_vfinal_flag = false;
duke@435 148 switch (invoke_code) {
jrose@1161 149 case Bytecodes::_invokedynamic:
duke@435 150 case Bytecodes::_invokevirtual:
duke@435 151 case Bytecodes::_invokeinterface: {
duke@435 152 if (method->can_be_statically_bound()) {
duke@435 153 set_f2((intptr_t)method());
duke@435 154 needs_vfinal_flag = true;
duke@435 155 } else {
duke@435 156 assert(vtable_index >= 0, "valid index");
duke@435 157 set_f2(vtable_index);
duke@435 158 }
duke@435 159 byte_no = 2;
duke@435 160 break;
duke@435 161 }
duke@435 162 case Bytecodes::_invokespecial:
duke@435 163 // Preserve the value of the vfinal flag on invokevirtual bytecode
duke@435 164 // which may be shared with this constant pool cache entry.
duke@435 165 needs_vfinal_flag = is_resolved(Bytecodes::_invokevirtual) && is_vfinal();
duke@435 166 // fall through
duke@435 167 case Bytecodes::_invokestatic:
duke@435 168 set_f1(method());
duke@435 169 byte_no = 1;
duke@435 170 break;
duke@435 171 default:
duke@435 172 ShouldNotReachHere();
duke@435 173 break;
duke@435 174 }
duke@435 175
duke@435 176 set_flags(as_flags(as_TosState(method->result_type()),
duke@435 177 method->is_final_method(),
duke@435 178 needs_vfinal_flag,
duke@435 179 false,
duke@435 180 change_to_virtual,
duke@435 181 true)|
duke@435 182 method()->size_of_parameters());
duke@435 183
duke@435 184 // Note: byte_no also appears in TemplateTable::resolve.
duke@435 185 if (byte_no == 1) {
duke@435 186 set_bytecode_1(invoke_code);
duke@435 187 } else if (byte_no == 2) {
duke@435 188 if (change_to_virtual) {
duke@435 189 // NOTE: THIS IS A HACK - BE VERY CAREFUL!!!
duke@435 190 //
duke@435 191 // Workaround for the case where we encounter an invokeinterface, but we
duke@435 192 // should really have an _invokevirtual since the resolved method is a
duke@435 193 // virtual method in java.lang.Object. This is a corner case in the spec
duke@435 194 // but is presumably legal. javac does not generate this code.
duke@435 195 //
duke@435 196 // We set bytecode_1() to _invokeinterface, because that is the
duke@435 197 // bytecode # used by the interpreter to see if it is resolved.
duke@435 198 // We set bytecode_2() to _invokevirtual.
duke@435 199 // See also interpreterRuntime.cpp. (8/25/2000)
duke@435 200 // Only set resolved for the invokeinterface case if method is public.
duke@435 201 // Otherwise, the method needs to be reresolved with caller for each
duke@435 202 // interface call.
duke@435 203 if (method->is_public()) set_bytecode_1(invoke_code);
duke@435 204 set_bytecode_2(Bytecodes::_invokevirtual);
duke@435 205 } else {
duke@435 206 set_bytecode_2(invoke_code);
duke@435 207 }
duke@435 208 } else {
duke@435 209 ShouldNotReachHere();
duke@435 210 }
duke@435 211 NOT_PRODUCT(verify(tty));
duke@435 212 }
duke@435 213
duke@435 214
duke@435 215 void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
duke@435 216 klassOop interf = method->method_holder();
duke@435 217 assert(instanceKlass::cast(interf)->is_interface(), "must be an interface");
duke@435 218 set_f1(interf);
duke@435 219 set_f2(index);
duke@435 220 set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | method()->size_of_parameters());
duke@435 221 set_bytecode_1(Bytecodes::_invokeinterface);
duke@435 222 }
duke@435 223
duke@435 224
jrose@1161 225 void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, int extra_data) {
jrose@1161 226 methodOop method = (methodOop) sun_dyn_CallSiteImpl::vmmethod(call_site());
jrose@1161 227 assert(method->is_method(), "must be initialized properly");
jrose@1161 228 int param_size = method->size_of_parameters();
jrose@1161 229 assert(param_size > 1, "method argument size must include MH.this & initial dynamic receiver");
jrose@1161 230 param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic
jrose@1161 231 if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) {
jrose@1161 232 // racing threads might be trying to install their own favorites
jrose@1161 233 set_f1(call_site());
jrose@1161 234 }
jrose@1161 235 set_f2(extra_data);
jrose@1161 236 set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | param_size);
jrose@1161 237 // do not do set_bytecode on a secondary CP cache entry
jrose@1161 238 //set_bytecode_1(Bytecodes::_invokedynamic);
jrose@1161 239 }
jrose@1161 240
jrose@1161 241
duke@435 242 class LocalOopClosure: public OopClosure {
duke@435 243 private:
duke@435 244 void (*_f)(oop*);
duke@435 245
duke@435 246 public:
duke@435 247 LocalOopClosure(void f(oop*)) { _f = f; }
duke@435 248 virtual void do_oop(oop* o) { _f(o); }
coleenp@548 249 virtual void do_oop(narrowOop *o) { ShouldNotReachHere(); }
duke@435 250 };
duke@435 251
duke@435 252
duke@435 253 void ConstantPoolCacheEntry::oops_do(void f(oop*)) {
duke@435 254 LocalOopClosure blk(f);
duke@435 255 oop_iterate(&blk);
duke@435 256 }
duke@435 257
duke@435 258
duke@435 259 void ConstantPoolCacheEntry::oop_iterate(OopClosure* blk) {
duke@435 260 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 261 // field[1] is always oop or NULL
duke@435 262 blk->do_oop((oop*)&_f1);
duke@435 263 if (is_vfinal()) {
duke@435 264 blk->do_oop((oop*)&_f2);
duke@435 265 }
duke@435 266 }
duke@435 267
duke@435 268
duke@435 269 void ConstantPoolCacheEntry::oop_iterate_m(OopClosure* blk, MemRegion mr) {
duke@435 270 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 271 // field[1] is always oop or NULL
duke@435 272 if (mr.contains((oop *)&_f1)) blk->do_oop((oop*)&_f1);
duke@435 273 if (is_vfinal()) {
duke@435 274 if (mr.contains((oop *)&_f2)) blk->do_oop((oop*)&_f2);
duke@435 275 }
duke@435 276 }
duke@435 277
duke@435 278
duke@435 279 void ConstantPoolCacheEntry::follow_contents() {
duke@435 280 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 281 // field[1] is always oop or NULL
duke@435 282 MarkSweep::mark_and_push((oop*)&_f1);
duke@435 283 if (is_vfinal()) {
duke@435 284 MarkSweep::mark_and_push((oop*)&_f2);
duke@435 285 }
duke@435 286 }
duke@435 287
duke@435 288 #ifndef SERIALGC
duke@435 289 void ConstantPoolCacheEntry::follow_contents(ParCompactionManager* cm) {
duke@435 290 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 291 // field[1] is always oop or NULL
duke@435 292 PSParallelCompact::mark_and_push(cm, (oop*)&_f1);
duke@435 293 if (is_vfinal()) {
duke@435 294 PSParallelCompact::mark_and_push(cm, (oop*)&_f2);
duke@435 295 }
duke@435 296 }
duke@435 297 #endif // SERIALGC
duke@435 298
duke@435 299 void ConstantPoolCacheEntry::adjust_pointers() {
duke@435 300 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 301 // field[1] is always oop or NULL
duke@435 302 MarkSweep::adjust_pointer((oop*)&_f1);
duke@435 303 if (is_vfinal()) {
duke@435 304 MarkSweep::adjust_pointer((oop*)&_f2);
duke@435 305 }
duke@435 306 }
duke@435 307
duke@435 308 #ifndef SERIALGC
duke@435 309 void ConstantPoolCacheEntry::update_pointers() {
duke@435 310 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 311 // field[1] is always oop or NULL
duke@435 312 PSParallelCompact::adjust_pointer((oop*)&_f1);
duke@435 313 if (is_vfinal()) {
duke@435 314 PSParallelCompact::adjust_pointer((oop*)&_f2);
duke@435 315 }
duke@435 316 }
duke@435 317
duke@435 318 void ConstantPoolCacheEntry::update_pointers(HeapWord* beg_addr,
duke@435 319 HeapWord* end_addr) {
duke@435 320 assert(in_words(size()) == 4, "check code below - may need adjustment");
duke@435 321 // field[1] is always oop or NULL
duke@435 322 PSParallelCompact::adjust_pointer((oop*)&_f1, beg_addr, end_addr);
duke@435 323 if (is_vfinal()) {
duke@435 324 PSParallelCompact::adjust_pointer((oop*)&_f2, beg_addr, end_addr);
duke@435 325 }
duke@435 326 }
duke@435 327 #endif // SERIALGC
duke@435 328
duke@435 329 // RedefineClasses() API support:
duke@435 330 // If this constantPoolCacheEntry refers to old_method then update it
duke@435 331 // to refer to new_method.
duke@435 332 bool ConstantPoolCacheEntry::adjust_method_entry(methodOop old_method,
duke@435 333 methodOop new_method, bool * trace_name_printed) {
duke@435 334
duke@435 335 if (is_vfinal()) {
duke@435 336 // virtual and final so f2() contains method ptr instead of vtable index
duke@435 337 if (f2() == (intptr_t)old_method) {
duke@435 338 // match old_method so need an update
duke@435 339 _f2 = (intptr_t)new_method;
duke@435 340 if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
duke@435 341 if (!(*trace_name_printed)) {
duke@435 342 // RC_TRACE_MESG macro has an embedded ResourceMark
duke@435 343 RC_TRACE_MESG(("adjust: name=%s",
duke@435 344 Klass::cast(old_method->method_holder())->external_name()));
duke@435 345 *trace_name_printed = true;
duke@435 346 }
duke@435 347 // RC_TRACE macro has an embedded ResourceMark
duke@435 348 RC_TRACE(0x00400000, ("cpc vf-entry update: %s(%s)",
duke@435 349 new_method->name()->as_C_string(),
duke@435 350 new_method->signature()->as_C_string()));
duke@435 351 }
duke@435 352
duke@435 353 return true;
duke@435 354 }
duke@435 355
duke@435 356 // f1() is not used with virtual entries so bail out
duke@435 357 return false;
duke@435 358 }
duke@435 359
duke@435 360 if ((oop)_f1 == NULL) {
duke@435 361 // NULL f1() means this is a virtual entry so bail out
duke@435 362 // We are assuming that the vtable index does not need change.
duke@435 363 return false;
duke@435 364 }
duke@435 365
duke@435 366 if ((oop)_f1 == old_method) {
duke@435 367 _f1 = new_method;
duke@435 368 if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
duke@435 369 if (!(*trace_name_printed)) {
duke@435 370 // RC_TRACE_MESG macro has an embedded ResourceMark
duke@435 371 RC_TRACE_MESG(("adjust: name=%s",
duke@435 372 Klass::cast(old_method->method_holder())->external_name()));
duke@435 373 *trace_name_printed = true;
duke@435 374 }
duke@435 375 // RC_TRACE macro has an embedded ResourceMark
duke@435 376 RC_TRACE(0x00400000, ("cpc entry update: %s(%s)",
duke@435 377 new_method->name()->as_C_string(),
duke@435 378 new_method->signature()->as_C_string()));
duke@435 379 }
duke@435 380
duke@435 381 return true;
duke@435 382 }
duke@435 383
duke@435 384 return false;
duke@435 385 }
duke@435 386
duke@435 387 bool ConstantPoolCacheEntry::is_interesting_method_entry(klassOop k) {
duke@435 388 if (!is_method_entry()) {
duke@435 389 // not a method entry so not interesting by default
duke@435 390 return false;
duke@435 391 }
duke@435 392
duke@435 393 methodOop m = NULL;
duke@435 394 if (is_vfinal()) {
duke@435 395 // virtual and final so _f2 contains method ptr instead of vtable index
duke@435 396 m = (methodOop)_f2;
duke@435 397 } else if ((oop)_f1 == NULL) {
duke@435 398 // NULL _f1 means this is a virtual entry so also not interesting
duke@435 399 return false;
duke@435 400 } else {
duke@435 401 if (!((oop)_f1)->is_method()) {
duke@435 402 // _f1 can also contain a klassOop for an interface
duke@435 403 return false;
duke@435 404 }
duke@435 405 m = (methodOop)_f1;
duke@435 406 }
duke@435 407
duke@435 408 assert(m != NULL && m->is_method(), "sanity check");
duke@435 409 if (m == NULL || !m->is_method() || m->method_holder() != k) {
duke@435 410 // robustness for above sanity checks or method is not in
duke@435 411 // the interesting class
duke@435 412 return false;
duke@435 413 }
duke@435 414
duke@435 415 // the method is in the interesting class so the entry is interesting
duke@435 416 return true;
duke@435 417 }
duke@435 418
duke@435 419 void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
duke@435 420 // print separator
duke@435 421 if (index == 0) tty->print_cr(" -------------");
duke@435 422 // print entry
jrose@1161 423 tty->print_cr("%3d (%08x) ", index, this);
jrose@1161 424 if (is_secondary_entry())
jrose@1161 425 tty->print_cr("[%5d|secondary]", main_entry_index());
jrose@1161 426 else
jrose@1161 427 tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
duke@435 428 tty->print_cr(" [ %08x]", (address)(oop)_f1);
duke@435 429 tty->print_cr(" [ %08x]", _f2);
duke@435 430 tty->print_cr(" [ %08x]", _flags);
duke@435 431 tty->print_cr(" -------------");
duke@435 432 }
duke@435 433
duke@435 434 void ConstantPoolCacheEntry::verify(outputStream* st) const {
duke@435 435 // not implemented yet
duke@435 436 }
duke@435 437
duke@435 438 // Implementation of ConstantPoolCache
duke@435 439
duke@435 440 void constantPoolCacheOopDesc::initialize(intArray& inverse_index_map) {
duke@435 441 assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
duke@435 442 for (int i = 0; i < length(); i++) entry_at(i)->set_initial_state(inverse_index_map[i]);
duke@435 443 }
duke@435 444
duke@435 445 // RedefineClasses() API support:
duke@435 446 // If any entry of this constantPoolCache points to any of
duke@435 447 // old_methods, replace it with the corresponding new_method.
duke@435 448 void constantPoolCacheOopDesc::adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
duke@435 449 int methods_length, bool * trace_name_printed) {
duke@435 450
duke@435 451 if (methods_length == 0) {
duke@435 452 // nothing to do if there are no methods
duke@435 453 return;
duke@435 454 }
duke@435 455
duke@435 456 // get shorthand for the interesting class
duke@435 457 klassOop old_holder = old_methods[0]->method_holder();
duke@435 458
duke@435 459 for (int i = 0; i < length(); i++) {
duke@435 460 if (!entry_at(i)->is_interesting_method_entry(old_holder)) {
duke@435 461 // skip uninteresting methods
duke@435 462 continue;
duke@435 463 }
duke@435 464
duke@435 465 // The constantPoolCache contains entries for several different
duke@435 466 // things, but we only care about methods. In fact, we only care
duke@435 467 // about methods in the same class as the one that contains the
duke@435 468 // old_methods. At this point, we have an interesting entry.
duke@435 469
duke@435 470 for (int j = 0; j < methods_length; j++) {
duke@435 471 methodOop old_method = old_methods[j];
duke@435 472 methodOop new_method = new_methods[j];
duke@435 473
duke@435 474 if (entry_at(i)->adjust_method_entry(old_method, new_method,
duke@435 475 trace_name_printed)) {
duke@435 476 // current old_method matched this entry and we updated it so
duke@435 477 // break out and get to the next interesting entry if there one
duke@435 478 break;
duke@435 479 }
duke@435 480 }
duke@435 481 }
duke@435 482 }

mercurial