2027N/A * Copyright (c) 2000, 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 0N/A * published by the Free Software Foundation. 0N/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. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// ================================================================== 0N/A// Overlay for generic profiling data. 0N/A// Some types of data layouts need a length field. 0N/A// Perform generic initialization of the data. More specific 0N/A// initialization occurs in overrides of ProfileData::post_initialize. 0N/A// ================================================================== 0N/A// A ProfileData object is created to refer to a section of profiling 0N/A// data in a structured way. 0N/A// Constructor for invalid ProfileData. 0N/A// ================================================================== 0N/A// A BitData corresponds to a one-bit flag. This is used to indicate 0N/A// whether a checkcast bytecode has seen a null value. 0N/A// ================================================================== 0N/A// A CounterData corresponds to a simple counter. 0N/A// ================================================================== 0N/A// A JumpData is used to access profiling information for a direct 0N/A// branch. It is a counter, used for counting the number of branches, 0N/A// plus a data displacement, used for realigning the data pointer to 0N/A// the corresponding target bci. 0N/A// ================================================================== 0N/A// A ReceiverTypeData is used to access profiling information about a 0N/A// dynamic type check. It consists of a counter which counts the total times 0N/A// that the check is reached, and a series of (klassOop, count) pairs 0N/A// which are used to store a type profile for the receiver of the check. 941N/A // This is a set of weak references that need 941N/A // to be followed at the end of the strong marking 941N/A // phase. Memoize this object so it can be visited 941N/A // in the weak roots processing phase. 941N/A // This is a set of weak references that need 941N/A // to be followed at the end of the strong marking 941N/A // phase. Memoize this object so it can be visited 941N/A // in the weak roots processing phase. 941N/A // This is a set of weak references that need 941N/A // to be followed at the end of the strong marking 941N/A // phase. Memoize this object so it can be visited 941N/A // in the weak roots processing phase. 941N/A }
else {
// normal scan 941N/A // Currently, this interface is called only during card-scanning for 941N/A // a young gen gc, in which case this object cannot contribute anything, 941N/A // since it does not contain any references that cross out of 941N/A // the perm gen. However, for future more general use we allow 941N/A // the possibility of calling for instance from more general 941N/A // iterators (for example, a future regionalized perm gen for G1, 941N/A // or the possibility of moving some references out of perm in 941N/A // the case of other collectors). In that case, you will need 941N/A // to relax or remove some of the assertions below. 941N/A // Verify that none of the embedded oop references cross out of 941N/A return;
// Nothing to do, see comment above 941N/A // This is a set of weak references that need 941N/A // to be followed at the end of the strong marking 941N/A // phase. Memoize this object so it can be visited 941N/A // in the weak roots processing phase. 941N/A }
else {
// normal scan 941N/A // Test that the current cursor and the two ends of the range 941N/A // that we may have skipped iterating over are monotonically ordered; 941N/A // this is just a paranoid assertion, just in case represetations 941N/A // should change in the future rendering the short-circuit return 941N/A break;
// remaining should be outside this mr too 0N/A// ================================================================== 0N/A// A RetData is used to access profiling information for a ret bytecode. 0N/A// It is composed of a count of the number of times that the ret has 0N/A// been executed, followed by a series of triples of the form 0N/A// (bci, count, di) which count the number of times that some bci was the 0N/A// target of the ret and cache a corresponding displacement. 0N/A // release so other threads see a consistent state. bci is used as 0N/A // a valid flag for bci_displacement. 0N/A// This routine needs to atomically update the RetData structure, so the 0N/A// caller needs to hold the RetData_lock before it gets here. Since taking 0N/A// the lock can block (and allow GC) and since RetData is a ProfileData is a 0N/A// wrapper around a derived oop, taking the lock in _this_ method will 0N/A// basically cause the 'this' pointer's _data field to contain junk after the 0N/A// lock. We require the caller to take the lock before making the ProfileData 0N/A// structure. Currently the only caller is InterpreterRuntime::update_mdp_for_ret 0N/A // First find the mdp which corresponds to the return bci. 0N/A // Now check to see if any of the cache slots are open. 0N/A // Barrier to ensure displacement is written before the bci; allows 0N/A // the interpreter to read displacement without fear of race condition. 0N/A// ================================================================== 0N/A// A BranchData is used to access profiling data for a two-way branch. 0N/A// It consists of taken and not_taken counts as well as a data displacement 0N/A// for the taken case. 0N/A// ================================================================== 0N/A// A MultiBranchData is used to access profiling information for 0N/A// a multi-way branch (*switch bytecodes). It consists of a series 0N/A// of (count, displacement) pairs, which count the number of times each 0N/A// case was taken and specify the data displacment for each branch target. 0N/A// ================================================================== 0N/A// A methodDataOop holds information which has been collected about 0N/A// Compute the size of the profiling information corresponding to 0N/A// the current bytecode. 0N/A // Note: cell_count might be zero, meaning that there is just 0N/A // a DataLayout header, with no extra cells. 0N/A // Assume that up to 3% of BCIs with no MDP will need to allocate one. 0N/A // If the method is large, let the extra BCIs grow numerous (to ~1%). 0N/A// Compute the size of the methodDataOop necessary to store 0N/A// profiling information about a given method. Size is in bytes. 0N/A // Add some extra DataLayout cells (at least one) to track stray traps. 45N/A // Add a cell to record information about modified arguments. 0N/A// Compute the size of the methodDataOop necessary to store 0N/A// profiling information about a given method. Size is in words 0N/A// Initialize an individual data segment. Returns the size of 0N/A// the segment in bytes. 726N/A // %%% should make a type profile for any invokedynamic that takes a ref argument 0N/A// Get the data at an arbitrary (sort of) data index. 0N/A// Iteration over data. 0N/A// Give each of the data entries a chance to perform specific 0N/A// data initialization. 0N/A// Initialize the methodDataOop corresponding to a given method. 0N/A // Set the method back-pointer. 0N/A // Initialize flags and trap history. 0N/A // Go through the bytecodes and allocate and initialize the 0N/A // corresponding data cells. 0N/A // Add some extra DataLayout cells (at least one) to track stray traps. 45N/A // Add a cell to record information about modified arguments. 45N/A // Set up _args_modified array after traps cells so that 45N/A // the code for traps cells works. 0N/A // Set an initial hint. Don't use set_hint_di() because 0N/A // first_di() may be out of bounds if data_size is 0. 0N/A // In that situation, _hint_di is never used, but at 0N/A // least well-defined. 0N/A// Get a measure of how much mileage the method has on it. 0N/A// Translate a bci to its corresponding data index (di). 0N/A// Translate a bci to its corresponding data, or NULL. 0N/A// Translate a bci to its corresponding extra data, or NULL. 0N/A // No need for "OrderAccess::load_acquire" ops, 0N/A // since the data structure is monotonic. 45N/A dp =
end;
// ArgInfoData is at the end of extra data section. 0N/A // Allocate this one. There is no mutual exclusion, 0N/A // so two threads could allocate different BCIs to the 0N/A // same data layout. This means these extra data 0N/A // records, like most other MDO contents, must not be 0N/A // trusted too much. 0N/A //NO: assert(dp->bci() == bci, "no concurrent allocation"); 0N/A // No need for "OrderAccess::load_acquire" ops, 0N/A // since the data structure is monotonic. 45N/A dp =
end;
// ArgInfoData is at the end of extra data section. 0N/A // not yet implemented.