hotspot/src/share/vm/oops/klassVtable.cpp
Print this page
rev 611 : Merge
*** 1,10 ****
#ifdef USE_PRAGMA_IDENT_SRC
#pragma ident "@(#)klassVtable.cpp 1.146 07/07/19 12:19:09 JVM"
#endif
/*
! * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,10 ----
#ifdef USE_PRAGMA_IDENT_SRC
#pragma ident "@(#)klassVtable.cpp 1.146 07/07/19 12:19:09 JVM"
#endif
/*
! * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 993,1002 ****
--- 993,1006 ----
for (int j = 0; j < methods_length; j++) {
methodOop old_method = old_methods[j];
methodOop new_method = new_methods[j];
itableMethodEntry* ime = method_entry(0);
+ // The itable can describe more than one interface and the same
+ // method signature can be specified by more than one interface.
+ // This means we have to do an exhaustive search to find all the
+ // old_method references.
for (int i = 0; i < _size_method_table; i++) {
if (ime->method() == old_method) {
ime->initialize(new_method);
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
*** 1009,1019 ****
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00200000, ("itable method update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
- break;
}
ime++;
}
}
}
--- 1013,1022 ----
*** 1119,1129 ****
// Fill-out offset table
itableOffsetEntry* ioe = (itableOffsetEntry*)klass->start_of_itable();
itableMethodEntry* ime = (itableMethodEntry*)(ioe + nof_interfaces);
intptr_t* end = klass->end_of_itable();
! assert((oop*)(ime + nof_methods) <= klass->start_of_static_fields(), "wrong offset calculation (1)");
assert((oop*)(end) == (oop*)(ime + nof_methods), "wrong offset calculation (2)");
// Visit all interfaces and initialize itable offset table
SetupItableClosure sic((address)klass->as_klassOop(), ioe, ime);
visit_all_interfaces(klass->transitive_interfaces(), &sic);
--- 1122,1132 ----
// Fill-out offset table
itableOffsetEntry* ioe = (itableOffsetEntry*)klass->start_of_itable();
itableMethodEntry* ime = (itableMethodEntry*)(ioe + nof_interfaces);
intptr_t* end = klass->end_of_itable();
! assert((oop*)(ime + nof_methods) <= (oop*)klass->start_of_static_fields(), "wrong offset calculation (1)");
assert((oop*)(end) == (oop*)(ime + nof_methods), "wrong offset calculation (2)");
// Visit all interfaces and initialize itable offset table
SetupItableClosure sic((address)klass->as_klassOop(), ioe, ime);
visit_all_interfaces(klass->transitive_interfaces(), &sic);