/*
* 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 "code/debugInfoRec.hpp"
#include "code/scopeDesc.hpp"
#include "prims/jvmtiExport.hpp"
// Private definition.
// There is one DIR_Chunk for each scope and values array.
// A chunk can potentially be used more than once.
// We keep track of these chunks in order to detect
// repetition and enable sharing.
class DIR_Chunk {
friend class DebugInformationRecorder;
}
return dir->_next_chunk++;
}
unsigned int hash = 0;
for (int i = 0; i < length; i++) {
if (i == 6) break;
hash *= 127;
hash += p[i];
}
}
int start_index,
for (int i = end_index; --i >= start_index; ) {
return that;
}
}
return NULL;
}
};
static inline bool compute_recording_non_safepoints() {
// The default value of this flag is taken to be true,
// if JVMTI is looking at nmethod codes.
// We anticipate that JVMTI may wish to participate in profiling.
return true;
}
// If the flag is set manually, use it, whether true or false.
// Otherwise, if JVMTI is not in the picture, use the default setting.
// (This is true in debug, just for the exercise, false in product mode.)
return DebugNonSafepoints;
}
{
_pcs_size = 100;
_pcs_length = 0;
// make sure that there is no stream_decode_offset that is zero
// make sure that we can distinguish the value "serialized_null" from offsets
}
// !!!!! Preserve old style handling of oopmaps for now
}
// Store the new safepoint
// Add the oop map
}
}
"must specify a new, larger pc offset");
// add the pcdesc
if (_pcs_length == _pcs_size) {
// Expand
}
}
}
}
// (See comment below on DebugInformationRecorder::describe_scope.)
if (shared_result != serialized_null) {
}
return result;
}
}
// (See comment below on DebugInformationRecorder::describe_scope.)
if (shared_result != serialized_null) {
}
return result;
}
#ifndef PRODUCT
// These variables are put into one block to reduce relocations
// and make it simpler to print from the debugger.
static
struct dir_stats_struct {
int chunks_queried;
int chunks_shared;
int chunks_reshared;
int chunks_elided;
void print() {
}
} dir_stats;
#endif //PRODUCT
// Only pull this trick if non-safepoint recording
// is enabled, for now.
if (!recording_non_safepoints())
return serialized_null;
// Look in previously shared scopes first:
_next_chunk = ns;
}
// Look in recently encountered scopes next:
if (start_index < 0) start_index = 0;
// Searching in _all_chunks is limited to a window,
// but searching in _shared_chunks is unlimited.
_next_chunk = ns;
}
// No match. Add this guy to the list, in hopes of future shares.
return serialized_null;
}
// must call add_safepoint before: it sets PcDesc and this routine uses
// the last PcDesc set
int bci,
bool reexecute,
bool is_method_handle_invoke,
bool return_oop,
DebugToken* monitors) {
// update the stream offset of current pc desc
// Record flags into pcDesc.
// serialize sender stream offest
// serialize scope
// serialize the locals/expressions/monitors
// Here's a tricky bit. We just wrote some bytes.
// Wouldn't it be nice to find that we had already
// written those same bytes somewhere else?
// If we get lucky this way, reset the stream
// and reuse the old bytes. By the way, this
// trick not only shares parent scopes, but also
// compresses equivalent non-safepoint PcDescs.
if (shared_stream_offset != serialized_null) {
}
}
}
}
}
"nesting of recording calls");
// Try to compress away an equivalent non-safepoint predecessor.
// (This only works because we have previously recognized redundant
// scope trees and made them use a common scope_decode_offset.)
// If prev is (a) not a safepoint and (b) has the same
// stream pointer, then it can be coalesced into the last.
// This is valid because non-safepoints are only sought
// with pc_desc_near, which (when it misses prev) will
// search forward until it finds last.
// In addition, it does not matter if the last PcDesc
// is for a safepoint or not.
_pcs_length -= 1;
}
}
// We have just recorded this safepoint.
// Remember it in case the previous paragraph needs to know.
if (is_safepoint) {
}
}
}
DebugToken* DebugInformationRecorder::create_monitor_values(GrowableArray<MonitorValue*>* monitors) {
}
}
return _pcs_length * sizeof(PcDesc);
}
}
}
#ifndef PRODUCT
}
#endif //PRODUCT