placeholders.cpp revision 1879
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/placeholders.hpp"
#include "classfile/systemDictionary.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fieldType.hpp"
#include "utilities/hashtable.inline.hpp"
// Placeholder methods
return entry;
}
// Placeholder objects represent classes currently being loaded.
// All threads examining the placeholder table must hold the
// SystemDictionary_lock, so we don't need special precautions
// on store ordering here.
// Both readers and writers are locked so it's safe to just
// create the placeholder and insert it in the list without a membar.
PlaceholderEntry* entry = new_entry(hash, class_name(), class_loader(), havesupername, supername());
}
// Remove a placeholder object.
while (*p) {
PlaceholderEntry *probe = *p;
// Delete entry
return;
}
}
}
place_probe != NULL;
return place_probe;
}
}
return NULL;
}
}
// find_and_add returns probe pointer - old or new
// If no entry exists, add a placeholder entry
// If entry exists, reuse entry
// For both, push SeenThread for classloadAction
// if havesupername: this is used for circularity for instanceklass loading
PlaceholderEntry* PlaceholderTable::find_and_add(int index, unsigned int hash, symbolHandle name, Handle loader, classloadAction action, symbolHandle supername, Thread* thread) {
// Nothing found, add place holder
} else {
if (action == LOAD_SUPER) {
probe->set_havesupername(true);
}
}
return probe;
}
// placeholder used to track class loading internal states
// placeholder existence now for loading superclass/superinterface
// superthreadQ tracks class circularity, while loading superclass/superinterface
// loadInstanceThreadQ tracks load_instance_class calls
// definer() tracks the single thread that owns define token
// defineThreadQ tracks waiters on defining thread's results
// 1st claimant creates placeholder
// find_and_add adds SeenThread entry for appropriate queue
// All claimants remove SeenThread after completing action
// On removal: if definer and all queues empty, remove entry
// Note: you can be in both placeholders and systemDictionary
// see parse_stream for redefine classes
// Therefore - must always check SD first
// Ignores the case where entry is not found
// No other threads using this entry
}
}
}
}
}
}
}
}
if (_supername != NULL) {
}
if (_instanceKlass != NULL) {
}
}
// do all entries in the placeholder table
}
}
}
#ifndef PRODUCT
// Note, doesn't append a cr
void PlaceholderEntry::print() const {
klass()->print_value();
loader()->print_value();
}
supername()->print_value();
}
definer()->print_value();
}
if (instanceKlass() != NULL) {
instanceKlass()->print_value();
}
superThreadQ()->printActionQ();
defineThreadQ()->printActionQ();
}
#endif
void PlaceholderEntry::verify() const {
"checking type of _loader");
"checking type of instanceKlass result");
}
void PlaceholderTable::verify() {
int element_count = 0;
element_count++; // both klasses and place holders count
}
}
"Verify of system dictionary failed");
}
#ifndef PRODUCT
void PlaceholderTable::print() {
}
}
}
#endif