placeholders.cpp revision 3863
3909N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. 2362N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Placeholder methods 0N/A // Hashtable with Symbol* literal must increment and decrement refcount. // decrement Symbol refcount here because Hashtable doesn't. // 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. // Remove a placeholder object. // 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 // Nothing found, add place holder // placeholder used to track class loading internal states // 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 // do all entries in the placeholder table // Note, doesn't append a cr tty->
print(
"loadInstanceThreadQ threads:");
"checking type of _loader");
"checking type of instanceKlass result");
"Verify of system dictionary failed");