< prev index next >

src/share/vm/code/debugInfoRec.cpp

Print this page

        

*** 31,48 **** // 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; int _offset; // location in the stream of this scope int _length; // number of bytes in the stream int _hash; // hash of stream bytes (for quicker reuse) #if INCLUDE_JVMCI DebugInformationRecorder* _DIR; #endif void* operator new(size_t ignore, DebugInformationRecorder* dir) throw() { assert(ignore == sizeof(DIR_Chunk), ""); if (dir->_next_chunk >= dir->_next_chunk_limit) { const int CHUNK = 100; dir->_next_chunk = NEW_RESOURCE_ARRAY(DIR_Chunk, CHUNK); --- 31,51 ---- // 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 { ! private: int _offset; // location in the stream of this scope int _length; // number of bytes in the stream int _hash; // hash of stream bytes (for quicker reuse) #if INCLUDE_JVMCI DebugInformationRecorder* _DIR; #endif + public: + int offset() { return _offset; } + void* operator new(size_t ignore, DebugInformationRecorder* dir) throw() { assert(ignore == sizeof(DIR_Chunk), ""); if (dir->_next_chunk >= dir->_next_chunk_limit) { const int CHUNK = 100; dir->_next_chunk = NEW_RESOURCE_ARRAY(DIR_Chunk, CHUNK);
*** 282,292 **** if (match != ns) { // Found an existing chunk NOT_PRODUCT(++dir_stats.chunks_shared); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return match->_offset; } else { // Inserted this chunk, so nothing to do return serialized_null; } #else // INCLUDE_JVMCI --- 285,295 ---- if (match != ns) { // Found an existing chunk NOT_PRODUCT(++dir_stats.chunks_shared); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return match->offset(); } else { // Inserted this chunk, so nothing to do return serialized_null; } #else // INCLUDE_JVMCI
*** 294,304 **** DIR_Chunk* ms = ns->find_match(_shared_chunks, 0, this); if (ms != NULL) { NOT_PRODUCT(++dir_stats.chunks_reshared); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return ms->_offset; } // Look in recently encountered scopes next: const int MAX_RECENT = 50; int start_index = _all_chunks->length() - MAX_RECENT; --- 297,307 ---- DIR_Chunk* ms = ns->find_match(_shared_chunks, 0, this); if (ms != NULL) { NOT_PRODUCT(++dir_stats.chunks_reshared); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return ms->offset(); } // Look in recently encountered scopes next: const int MAX_RECENT = 50; int start_index = _all_chunks->length() - MAX_RECENT;
*** 309,319 **** // Searching in _all_chunks is limited to a window, // but searching in _shared_chunks is unlimited. _shared_chunks->append(ms); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return ms->_offset; } // No match. Add this guy to the list, in hopes of future shares. _all_chunks->append(ns); return serialized_null; --- 312,322 ---- // Searching in _all_chunks is limited to a window, // but searching in _shared_chunks is unlimited. _shared_chunks->append(ms); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; ! return ms->offset(); } // No match. Add this guy to the list, in hopes of future shares. _all_chunks->append(ns); return serialized_null;
< prev index next >