提交 d63e791e 编写于 作者: A adlertz

Merge

...@@ -1213,6 +1213,7 @@ public class CommandProcessor { ...@@ -1213,6 +1213,7 @@ public class CommandProcessor {
} }
HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase(); HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
if (t.countTokens() == 1) { if (t.countTokens() == 1) {
String name = t.nextToken();
out.println("intConstant " + name + " " + db.lookupIntConstant(name)); out.println("intConstant " + name + " " + db.lookupIntConstant(name));
} else if (t.countTokens() == 0) { } else if (t.countTokens() == 0) {
Iterator i = db.getIntConstants(); Iterator i = db.getIntConstants();
...@@ -1235,6 +1236,7 @@ public class CommandProcessor { ...@@ -1235,6 +1236,7 @@ public class CommandProcessor {
} }
HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase(); HotSpotTypeDataBase db = (HotSpotTypeDataBase)agent.getTypeDataBase();
if (t.countTokens() == 1) { if (t.countTokens() == 1) {
String name = t.nextToken();
out.println("longConstant " + name + " " + db.lookupLongConstant(name)); out.println("longConstant " + name + " " + db.lookupLongConstant(name));
} else if (t.countTokens() == 0) { } else if (t.countTokens() == 0) {
Iterator i = db.getLongConstants(); Iterator i = db.getLongConstants();
......
...@@ -4,14 +4,14 @@ It's main purpose is to recreate output similar to ...@@ -4,14 +4,14 @@ It's main purpose is to recreate output similar to
requires a 1.5 JDK to build and simply typing make should build it. requires a 1.5 JDK to build and simply typing make should build it.
It produces a jar file, logc.jar, that can be run on the It produces a jar file, logc.jar, that can be run on the
hotspot.log from LogCompilation output like this: HotSpot log (by default, hotspot_pid{pid}.log) from LogCompilation output like this:
java -jar logc.jar hotspot.log java -jar logc.jar hotspot_pid1234.log
This will produce something like the normal PrintCompilation output. This will produce something like the normal PrintCompilation output.
Adding the -i option with also report inlining like PrintInlining. Adding the -i option with also report inlining like PrintInlining.
More information about the LogCompilation output can be found at More information about the LogCompilation output can be found at
https://wikis.oracle.com/display/HotSpotInternals/LogCompilation+overview https://wikis.oracle.com/display/HotSpotInternals/LogCompilation+overview
https://wikis.oracle.com/display/HotSpotInternals/PrintCompilation https://wikis.oracle.com/display/HotSpotInternals/PrintCompilation
......
...@@ -1319,6 +1319,25 @@ static void clear_pending_exception_if_not_oom(TRAPS) { ...@@ -1319,6 +1319,25 @@ static void clear_pending_exception_if_not_oom(TRAPS) {
// The CHECK at the caller will propagate the exception out // The CHECK at the caller will propagate the exception out
} }
/**
* Returns if the given method should be compiled when doing compile-the-world.
*
* TODO: This should be a private method in a CompileTheWorld class.
*/
static bool can_be_compiled(methodHandle m, int comp_level) {
assert(CompileTheWorld, "must be");
// It's not valid to compile a native wrapper for MethodHandle methods
// that take a MemberName appendix since the bytecode signature is not
// correct.
vmIntrinsics::ID iid = m->intrinsic_id();
if (MethodHandles::is_signature_polymorphic(iid) && MethodHandles::has_member_arg(iid)) {
return false;
}
return CompilationPolicy::can_be_compiled(m, comp_level);
}
void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
int len = (int)strlen(name); int len = (int)strlen(name);
if (len > 6 && strcmp(".class", name + len - 6) == 0) { if (len > 6 && strcmp(".class", name + len - 6) == 0) {
...@@ -1362,8 +1381,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { ...@@ -1362,8 +1381,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
int comp_level = CompilationPolicy::policy()->initial_compile_level(); int comp_level = CompilationPolicy::policy()->initial_compile_level();
for (int n = 0; n < k->methods()->length(); n++) { for (int n = 0; n < k->methods()->length(); n++) {
methodHandle m (THREAD, k->methods()->at(n)); methodHandle m (THREAD, k->methods()->at(n));
if (CompilationPolicy::can_be_compiled(m, comp_level)) { if (can_be_compiled(m, comp_level)) {
if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
// Give sweeper a chance to keep up with CTW // Give sweeper a chance to keep up with CTW
VM_ForceSafepoint op; VM_ForceSafepoint op;
...@@ -1375,7 +1393,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { ...@@ -1375,7 +1393,7 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
clear_pending_exception_if_not_oom(CHECK); clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
} else { } else {
_compile_the_world_method_counter++; _compile_the_world_method_counter++;
} }
...@@ -1391,11 +1409,13 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { ...@@ -1391,11 +1409,13 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle(), 0, "CTW", THREAD); methodHandle(), 0, "CTW", THREAD);
if (HAS_PENDING_EXCEPTION) { if (HAS_PENDING_EXCEPTION) {
clear_pending_exception_if_not_oom(CHECK); clear_pending_exception_if_not_oom(CHECK);
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name()->as_C_string()); tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
} else { } else {
_compile_the_world_method_counter++; _compile_the_world_method_counter++;
} }
} }
} else {
tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
} }
nmethod* nm = m->code(); nmethod* nm = m->code();
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
class PtrQueueSet; class PtrQueueSet;
class PtrQueue VALUE_OBJ_CLASS_SPEC { class PtrQueue VALUE_OBJ_CLASS_SPEC {
friend class VMStructs;
protected: protected:
// The ptr queue set to which this queue belongs. // The ptr queue set to which this queue belongs.
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#define VM_STRUCTS_G1(nonstatic_field, static_field) \ #define VM_STRUCTS_G1(nonstatic_field, static_field) \
\ \
static_field(HeapRegion, GrainBytes, size_t) \ static_field(HeapRegion, GrainBytes, size_t) \
static_field(HeapRegion, LogOfHRGrainBytes, int) \
\ \
nonstatic_field(HeapRegionSeq, _regions, HeapRegion**) \ nonstatic_field(HeapRegionSeq, _regions, HeapRegion**) \
nonstatic_field(HeapRegionSeq, _length, uint) \ nonstatic_field(HeapRegionSeq, _length, uint) \
......
...@@ -602,7 +602,7 @@ oop Universe::gen_out_of_memory_error(oop default_err) { ...@@ -602,7 +602,7 @@ oop Universe::gen_out_of_memory_error(oop default_err) {
} }
} }
static intptr_t non_oop_bits = 0; intptr_t Universe::_non_oop_bits = 0;
void* Universe::non_oop_word() { void* Universe::non_oop_word() {
// Neither the high bits nor the low bits of this value is allowed // Neither the high bits nor the low bits of this value is allowed
...@@ -616,11 +616,11 @@ void* Universe::non_oop_word() { ...@@ -616,11 +616,11 @@ void* Universe::non_oop_word() {
// Using the OS-supplied non-memory-address word (usually 0 or -1) // Using the OS-supplied non-memory-address word (usually 0 or -1)
// will take care of the high bits, however many there are. // will take care of the high bits, however many there are.
if (non_oop_bits == 0) { if (_non_oop_bits == 0) {
non_oop_bits = (intptr_t)os::non_memory_address_word() | 1; _non_oop_bits = (intptr_t)os::non_memory_address_word() | 1;
} }
return (void*)non_oop_bits; return (void*)_non_oop_bits;
} }
jint universe_init() { jint universe_init() {
......
...@@ -179,6 +179,8 @@ class Universe: AllStatic { ...@@ -179,6 +179,8 @@ class Universe: AllStatic {
// The particular choice of collected heap. // The particular choice of collected heap.
static CollectedHeap* _collectedHeap; static CollectedHeap* _collectedHeap;
static intptr_t _non_oop_bits;
// For UseCompressedOops. // For UseCompressedOops.
static struct NarrowPtrStruct _narrow_oop; static struct NarrowPtrStruct _narrow_oop;
// For UseCompressedKlassPointers. // For UseCompressedKlassPointers.
......
...@@ -150,6 +150,8 @@ class klassVtable : public ResourceObj { ...@@ -150,6 +150,8 @@ class klassVtable : public ResourceObj {
// from_compiled_code_entry_point -> nmethod entry point // from_compiled_code_entry_point -> nmethod entry point
// from_interpreter_entry_point -> i2cadapter // from_interpreter_entry_point -> i2cadapter
class vtableEntry VALUE_OBJ_CLASS_SPEC { class vtableEntry VALUE_OBJ_CLASS_SPEC {
friend class VMStructs;
public: public:
// size in words // size in words
static int size() { static int size() {
......
...@@ -72,6 +72,8 @@ class ProfileData; ...@@ -72,6 +72,8 @@ class ProfileData;
// //
// Overlay for generic profiling data. // Overlay for generic profiling data.
class DataLayout VALUE_OBJ_CLASS_SPEC { class DataLayout VALUE_OBJ_CLASS_SPEC {
friend class VMStructs;
private: private:
// Every data layout begins with a header. This header // Every data layout begins with a header. This header
// contains a tag, which is used to indicate the size/layout // contains a tag, which is used to indicate the size/layout
......
...@@ -122,40 +122,23 @@ double LRG::score() const { ...@@ -122,40 +122,23 @@ double LRG::score() const {
return score; return score;
} }
LRG_List::LRG_List( uint max ) : _cnt(max), _max(max), _lidxs(NEW_RESOURCE_ARRAY(uint,max)) {
memset( _lidxs, 0, sizeof(uint)*max );
}
void LRG_List::extend( uint nidx, uint lidx ) {
_nesting.check();
if( nidx >= _max ) {
uint size = 16;
while( size <= nidx ) size <<=1;
_lidxs = REALLOC_RESOURCE_ARRAY( uint, _lidxs, _max, size );
_max = size;
}
while( _cnt <= nidx )
_lidxs[_cnt++] = 0;
_lidxs[nidx] = lidx;
}
#define NUMBUCKS 3 #define NUMBUCKS 3
// Straight out of Tarjan's union-find algorithm // Straight out of Tarjan's union-find algorithm
uint LiveRangeMap::find_compress(uint lrg) { uint LiveRangeMap::find_compress(uint lrg) {
uint cur = lrg; uint cur = lrg;
uint next = _uf_map[cur]; uint next = _uf_map.at(cur);
while (next != cur) { // Scan chain of equivalences while (next != cur) { // Scan chain of equivalences
assert( next < cur, "always union smaller"); assert( next < cur, "always union smaller");
cur = next; // until find a fixed-point cur = next; // until find a fixed-point
next = _uf_map[cur]; next = _uf_map.at(cur);
} }
// Core of union-find algorithm: update chain of // Core of union-find algorithm: update chain of
// equivalences to be equal to the root. // equivalences to be equal to the root.
while (lrg != next) { while (lrg != next) {
uint tmp = _uf_map[lrg]; uint tmp = _uf_map.at(lrg);
_uf_map.map(lrg, next); _uf_map.at_put(lrg, next);
lrg = tmp; lrg = tmp;
} }
return lrg; return lrg;
...@@ -165,10 +148,10 @@ uint LiveRangeMap::find_compress(uint lrg) { ...@@ -165,10 +148,10 @@ uint LiveRangeMap::find_compress(uint lrg) {
void LiveRangeMap::reset_uf_map(uint max_lrg_id) { void LiveRangeMap::reset_uf_map(uint max_lrg_id) {
_max_lrg_id= max_lrg_id; _max_lrg_id= max_lrg_id;
// Force the Union-Find mapping to be at least this large // Force the Union-Find mapping to be at least this large
_uf_map.extend(_max_lrg_id, 0); _uf_map.at_put_grow(_max_lrg_id, 0);
// Initialize it to be the ID mapping. // Initialize it to be the ID mapping.
for (uint i = 0; i < _max_lrg_id; ++i) { for (uint i = 0; i < _max_lrg_id; ++i) {
_uf_map.map(i, i); _uf_map.at_put(i, i);
} }
} }
...@@ -176,12 +159,12 @@ void LiveRangeMap::reset_uf_map(uint max_lrg_id) { ...@@ -176,12 +159,12 @@ void LiveRangeMap::reset_uf_map(uint max_lrg_id) {
// the Union-Find mapping after this call. // the Union-Find mapping after this call.
void LiveRangeMap::compress_uf_map_for_nodes() { void LiveRangeMap::compress_uf_map_for_nodes() {
// For all Nodes, compress mapping // For all Nodes, compress mapping
uint unique = _names.Size(); uint unique = _names.length();
for (uint i = 0; i < unique; ++i) { for (uint i = 0; i < unique; ++i) {
uint lrg = _names[i]; uint lrg = _names.at(i);
uint compressed_lrg = find(lrg); uint compressed_lrg = find(lrg);
if (lrg != compressed_lrg) { if (lrg != compressed_lrg) {
_names.map(i, compressed_lrg); _names.at_put(i, compressed_lrg);
} }
} }
} }
...@@ -198,11 +181,11 @@ uint LiveRangeMap::find_const(uint lrg) const { ...@@ -198,11 +181,11 @@ uint LiveRangeMap::find_const(uint lrg) const {
return lrg; return lrg;
} }
uint next = _uf_map[lrg]; uint next = _uf_map.at(lrg);
while (next != lrg) { // Scan chain of equivalences while (next != lrg) { // Scan chain of equivalences
assert(next < lrg, "always union smaller"); assert(next < lrg, "always union smaller");
lrg = next; // until find a fixed-point lrg = next; // until find a fixed-point
next = _uf_map[lrg]; next = _uf_map.at(lrg);
} }
return next; return next;
} }
...@@ -215,7 +198,7 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher) ...@@ -215,7 +198,7 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
NULL NULL
#endif #endif
) )
, _lrg_map(unique) , _lrg_map(Thread::current()->resource_area(), unique)
, _live(0) , _live(0)
, _spilled_once(Thread::current()->resource_area()) , _spilled_once(Thread::current()->resource_area())
, _spilled_twice(Thread::current()->resource_area()) , _spilled_twice(Thread::current()->resource_area())
...@@ -692,6 +675,7 @@ void PhaseChaitin::de_ssa() { ...@@ -692,6 +675,7 @@ void PhaseChaitin::de_ssa() {
_lrg_map.map(n->_idx, rm.is_NotEmpty() ? lr_counter++ : 0); _lrg_map.map(n->_idx, rm.is_NotEmpty() ? lr_counter++ : 0);
} }
} }
// Reset the Union-Find mapping to be identity // Reset the Union-Find mapping to be identity
_lrg_map.reset_uf_map(lr_counter); _lrg_map.reset_uf_map(lr_counter);
} }
......
...@@ -283,8 +283,8 @@ private: ...@@ -283,8 +283,8 @@ private:
// Straight out of Tarjan's union-find algorithm // Straight out of Tarjan's union-find algorithm
uint find_compress(const Node *node) { uint find_compress(const Node *node) {
uint lrg_id = find_compress(_names[node->_idx]); uint lrg_id = find_compress(_names.at(node->_idx));
_names.map(node->_idx, lrg_id); _names.at_put(node->_idx, lrg_id);
return lrg_id; return lrg_id;
} }
...@@ -305,40 +305,40 @@ public: ...@@ -305,40 +305,40 @@ public:
} }
uint size() const { uint size() const {
return _names.Size(); return _names.length();
} }
uint live_range_id(uint idx) const { uint live_range_id(uint idx) const {
return _names[idx]; return _names.at(idx);
} }
uint live_range_id(const Node *node) const { uint live_range_id(const Node *node) const {
return _names[node->_idx]; return _names.at(node->_idx);
} }
uint uf_live_range_id(uint lrg_id) const { uint uf_live_range_id(uint lrg_id) const {
return _uf_map[lrg_id]; return _uf_map.at(lrg_id);
} }
void map(uint idx, uint lrg_id) { void map(uint idx, uint lrg_id) {
_names.map(idx, lrg_id); _names.at_put(idx, lrg_id);
} }
void uf_map(uint dst_lrg_id, uint src_lrg_id) { void uf_map(uint dst_lrg_id, uint src_lrg_id) {
_uf_map.map(dst_lrg_id, src_lrg_id); _uf_map.at_put(dst_lrg_id, src_lrg_id);
} }
void extend(uint idx, uint lrg_id) { void extend(uint idx, uint lrg_id) {
_names.extend(idx, lrg_id); _names.at_put_grow(idx, lrg_id);
} }
void uf_extend(uint dst_lrg_id, uint src_lrg_id) { void uf_extend(uint dst_lrg_id, uint src_lrg_id) {
_uf_map.extend(dst_lrg_id, src_lrg_id); _uf_map.at_put_grow(dst_lrg_id, src_lrg_id);
} }
LiveRangeMap(uint unique) LiveRangeMap(Arena* arena, uint unique)
: _names(unique) : _names(arena, unique, unique, 0)
, _uf_map(unique) , _uf_map(arena, unique, unique, 0)
, _max_lrg_id(0) {} , _max_lrg_id(0) {}
uint find_id( const Node *n ) { uint find_id( const Node *n ) {
...@@ -355,14 +355,14 @@ public: ...@@ -355,14 +355,14 @@ public:
void compress_uf_map_for_nodes(); void compress_uf_map_for_nodes();
uint find(uint lidx) { uint find(uint lidx) {
uint uf_lidx = _uf_map[lidx]; uint uf_lidx = _uf_map.at(lidx);
return (uf_lidx == lidx) ? uf_lidx : find_compress(lidx); return (uf_lidx == lidx) ? uf_lidx : find_compress(lidx);
} }
// Convert a Node into a Live Range Index - a lidx // Convert a Node into a Live Range Index - a lidx
uint find(const Node *node) { uint find(const Node *node) {
uint lidx = live_range_id(node); uint lidx = live_range_id(node);
uint uf_lidx = _uf_map[lidx]; uint uf_lidx = _uf_map.at(lidx);
return (uf_lidx == lidx) ? uf_lidx : find_compress(node); return (uf_lidx == lidx) ? uf_lidx : find_compress(node);
} }
...@@ -371,10 +371,10 @@ public: ...@@ -371,10 +371,10 @@ public:
// Like Find above, but no path compress, so bad asymptotic behavior // Like Find above, but no path compress, so bad asymptotic behavior
uint find_const(const Node *node) const { uint find_const(const Node *node) const {
if(node->_idx >= _names.Size()) { if(node->_idx >= (uint)_names.length()) {
return 0; // not mapped, usual for debug dump return 0; // not mapped, usual for debug dump
} }
return find_const(_names[node->_idx]); return find_const(_names.at(node->_idx));
} }
}; };
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
class LoopTree; class LoopTree;
class LRG; class LRG;
class LRG_List;
class Matcher; class Matcher;
class PhaseIFG; class PhaseIFG;
class PhaseCFG; class PhaseCFG;
......
...@@ -91,7 +91,7 @@ void PhaseLive::compute(uint maxlrg) { ...@@ -91,7 +91,7 @@ void PhaseLive::compute(uint maxlrg) {
break; break;
} }
uint r = _names[n->_idx]; uint r = _names.at(n->_idx);
assert(!def_outside->member(r), "Use of external LRG overlaps the same LRG defined in this block"); assert(!def_outside->member(r), "Use of external LRG overlaps the same LRG defined in this block");
def->insert( r ); def->insert( r );
use->remove( r ); use->remove( r );
...@@ -100,7 +100,7 @@ void PhaseLive::compute(uint maxlrg) { ...@@ -100,7 +100,7 @@ void PhaseLive::compute(uint maxlrg) {
Node *nk = n->in(k); Node *nk = n->in(k);
uint nkidx = nk->_idx; uint nkidx = nk->_idx;
if (_cfg.get_block_for_node(nk) != block) { if (_cfg.get_block_for_node(nk) != block) {
uint u = _names[nkidx]; uint u = _names.at(nkidx);
use->insert(u); use->insert(u);
DEBUG_ONLY(def_outside->insert(u);) DEBUG_ONLY(def_outside->insert(u);)
} }
...@@ -112,7 +112,7 @@ void PhaseLive::compute(uint maxlrg) { ...@@ -112,7 +112,7 @@ void PhaseLive::compute(uint maxlrg) {
#endif #endif
// Remove anything defined by Phis and the block start instruction // Remove anything defined by Phis and the block start instruction
for (uint k = i; k > 0; k--) { for (uint k = i; k > 0; k--) {
uint r = _names[block->get_node(k - 1)->_idx]; uint r = _names.at(block->get_node(k - 1)->_idx);
def->insert(r); def->insert(r);
use->remove(r); use->remove(r);
} }
...@@ -124,7 +124,7 @@ void PhaseLive::compute(uint maxlrg) { ...@@ -124,7 +124,7 @@ void PhaseLive::compute(uint maxlrg) {
// PhiNode uses go in the live-out set of prior blocks. // PhiNode uses go in the live-out set of prior blocks.
for (uint k = i; k > 0; k--) { for (uint k = i; k > 0; k--) {
add_liveout(p, _names[block->get_node(k-1)->in(l)->_idx], first_pass); add_liveout(p, _names.at(block->get_node(k-1)->in(l)->_idx), first_pass);
} }
} }
freeset(block); freeset(block);
...@@ -256,7 +256,7 @@ void PhaseLive::dump( const Block *b ) const { ...@@ -256,7 +256,7 @@ void PhaseLive::dump( const Block *b ) const {
tty->print("LiveOut: "); _live[b->_pre_order-1].dump(); tty->print("LiveOut: "); _live[b->_pre_order-1].dump();
uint cnt = b->number_of_nodes(); uint cnt = b->number_of_nodes();
for( uint i=0; i<cnt; i++ ) { for( uint i=0; i<cnt; i++ ) {
tty->print("L%d/", _names[b->get_node(i)->_idx] ); tty->print("L%d/", _names.at(b->get_node(i)->_idx));
b->get_node(i)->dump(); b->get_node(i)->dump();
} }
tty->print("\n"); tty->print("\n");
......
...@@ -40,27 +40,7 @@ class IndexSet; ...@@ -40,27 +40,7 @@ class IndexSet;
//------------------------------LRG_List--------------------------------------- //------------------------------LRG_List---------------------------------------
// Map Node indices to Live RanGe indices. // Map Node indices to Live RanGe indices.
// Array lookup in the optimized case. // Array lookup in the optimized case.
class LRG_List : public ResourceObj { typedef GrowableArray<uint> LRG_List;
friend class VMStructs;
uint _cnt, _max;
uint* _lidxs;
ReallocMark _nesting; // assertion check for reallocations
public:
LRG_List( uint max );
uint lookup( uint nidx ) const {
return _lidxs[nidx];
}
uint operator[] (uint nidx) const { return lookup(nidx); }
void map( uint nidx, uint lidx ) {
assert( nidx < _cnt, "oob" );
_lidxs[nidx] = lidx;
}
void extend( uint nidx, uint lidx );
uint Size() const { return _cnt; }
};
//------------------------------PhaseLive-------------------------------------- //------------------------------PhaseLive--------------------------------------
// Compute live-in/live-out // Compute live-in/live-out
......
...@@ -3326,6 +3326,33 @@ static char* get_shared_archive_path() { ...@@ -3326,6 +3326,33 @@ static char* get_shared_archive_path() {
return shared_archive_path; return shared_archive_path;
} }
#ifndef PRODUCT
// Determine whether LogVMOutput should be implicitly turned on.
static bool use_vm_log() {
if (LogCompilation || !FLAG_IS_DEFAULT(LogFile) ||
PrintCompilation || PrintInlining || PrintDependencies || PrintNativeNMethods ||
PrintDebugInfo || PrintRelocations || PrintNMethods || PrintExceptionHandlers ||
PrintAssembly || TraceDeoptimization || TraceDependencies ||
(VerifyDependencies && FLAG_IS_CMDLINE(VerifyDependencies))) {
return true;
}
#ifdef COMPILER1
if (PrintC1Statistics) {
return true;
}
#endif // COMPILER1
#ifdef COMPILER2
if (PrintOptoAssembly || PrintOptoStatistics) {
return true;
}
#endif // COMPILER2
return false;
}
#endif // PRODUCT
// Parse entry point called from JNI_CreateJavaVM // Parse entry point called from JNI_CreateJavaVM
jint Arguments::parse(const JavaVMInitArgs* args) { jint Arguments::parse(const JavaVMInitArgs* args) {
...@@ -3617,7 +3644,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ...@@ -3617,7 +3644,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
NmethodSweepFraction = 1; NmethodSweepFraction = 1;
} }
} }
#endif
if (!LogVMOutput && FLAG_IS_DEFAULT(LogVMOutput)) {
if (use_vm_log()) {
LogVMOutput = true;
}
}
#endif // PRODUCT
if (PrintCommandLineFlags) { if (PrintCommandLineFlags) {
CommandLineFlags::printSetFlags(tty); CommandLineFlags::printSetFlags(tty);
......
...@@ -1751,7 +1751,7 @@ int Deoptimization::trap_state_set_recompiled(int trap_state, bool z) { ...@@ -1751,7 +1751,7 @@ int Deoptimization::trap_state_set_recompiled(int trap_state, bool z) {
else return trap_state & ~DS_RECOMPILE_BIT; else return trap_state & ~DS_RECOMPILE_BIT;
} }
//---------------------------format_trap_state--------------------------------- //---------------------------format_trap_state---------------------------------
// This is used for debugging and diagnostics, including hotspot.log output. // This is used for debugging and diagnostics, including LogFile output.
const char* Deoptimization::format_trap_state(char* buf, size_t buflen, const char* Deoptimization::format_trap_state(char* buf, size_t buflen,
int trap_state) { int trap_state) {
DeoptReason reason = trap_state_reason(trap_state); DeoptReason reason = trap_state_reason(trap_state);
...@@ -1828,7 +1828,7 @@ const char* Deoptimization::trap_action_name(int action) { ...@@ -1828,7 +1828,7 @@ const char* Deoptimization::trap_action_name(int action) {
return buf; return buf;
} }
// This is used for debugging and diagnostics, including hotspot.log output. // This is used for debugging and diagnostics, including LogFile output.
const char* Deoptimization::format_trap_request(char* buf, size_t buflen, const char* Deoptimization::format_trap_request(char* buf, size_t buflen,
int trap_request) { int trap_request) {
jint unloaded_class_index = trap_request_index(trap_request); jint unloaded_class_index = trap_request_index(trap_request);
......
...@@ -880,7 +880,7 @@ class CommandLineFlags { ...@@ -880,7 +880,7 @@ class CommandLineFlags {
"stay alive at the expense of JVM performance") \ "stay alive at the expense of JVM performance") \
\ \
diagnostic(bool, LogCompilation, false, \ diagnostic(bool, LogCompilation, false, \
"Log compilation activity in detail to hotspot.log or LogFile") \ "Log compilation activity in detail to LogFile") \
\ \
product(bool, PrintCompilation, false, \ product(bool, PrintCompilation, false, \
"Print compilations") \ "Print compilations") \
...@@ -2498,16 +2498,17 @@ class CommandLineFlags { ...@@ -2498,16 +2498,17 @@ class CommandLineFlags {
"Print all VM flags with default values and descriptions and exit")\ "Print all VM flags with default values and descriptions and exit")\
\ \
diagnostic(bool, SerializeVMOutput, true, \ diagnostic(bool, SerializeVMOutput, true, \
"Use a mutex to serialize output to tty and hotspot.log") \ "Use a mutex to serialize output to tty and LogFile") \
\ \
diagnostic(bool, DisplayVMOutput, true, \ diagnostic(bool, DisplayVMOutput, true, \
"Display all VM output on the tty, independently of LogVMOutput") \ "Display all VM output on the tty, independently of LogVMOutput") \
\ \
diagnostic(bool, LogVMOutput, trueInDebug, \ diagnostic(bool, LogVMOutput, false, \
"Save VM output to hotspot.log, or to LogFile") \ "Save VM output to LogFile") \
\ \
diagnostic(ccstr, LogFile, NULL, \ diagnostic(ccstr, LogFile, NULL, \
"If LogVMOutput is on, save VM output to this file [hotspot.log]") \ "If LogVMOutput or LogCompilation is on, save VM output to " \
"this file [default: ./hotspot_pid%p.log] (%p replaced with pid)") \
\ \
product(ccstr, ErrorFile, NULL, \ product(ccstr, ErrorFile, NULL, \
"If an error occurs, save the error data to this file " \ "If an error occurs, save the error data to this file " \
......
...@@ -91,6 +91,8 @@ const bool ExecMem = true; ...@@ -91,6 +91,8 @@ const bool ExecMem = true;
typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
class os: AllStatic { class os: AllStatic {
friend class VMStructs;
public: public:
enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel)
......
此差异已折叠。
...@@ -592,7 +592,7 @@ static const char* make_log_name(const char* log_name, const char* force_directo ...@@ -592,7 +592,7 @@ static const char* make_log_name(const char* log_name, const char* force_directo
void defaultStream::init_log() { void defaultStream::init_log() {
// %%% Need a MutexLocker? // %%% Need a MutexLocker?
const char* log_name = LogFile != NULL ? LogFile : "hotspot.log"; const char* log_name = LogFile != NULL ? LogFile : "hotspot_pid%p.log";
const char* try_name = make_log_name(log_name, NULL); const char* try_name = make_log_name(log_name, NULL);
fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name);
if (!file->is_open()) { if (!file->is_open()) {
...@@ -603,14 +603,15 @@ void defaultStream::init_log() { ...@@ -603,14 +603,15 @@ void defaultStream::init_log() {
// Note: This feature is for maintainer use only. No need for L10N. // Note: This feature is for maintainer use only. No need for L10N.
jio_print(warnbuf); jio_print(warnbuf);
FREE_C_HEAP_ARRAY(char, try_name, mtInternal); FREE_C_HEAP_ARRAY(char, try_name, mtInternal);
try_name = make_log_name("hs_pid%p.log", os::get_temp_directory()); try_name = make_log_name(log_name, os::get_temp_directory());
jio_snprintf(warnbuf, sizeof(warnbuf), jio_snprintf(warnbuf, sizeof(warnbuf),
"Warning: Forcing option -XX:LogFile=%s\n", try_name); "Warning: Forcing option -XX:LogFile=%s\n", try_name);
jio_print(warnbuf); jio_print(warnbuf);
delete file; delete file;
file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name);
FREE_C_HEAP_ARRAY(char, try_name, mtInternal);
} }
FREE_C_HEAP_ARRAY(char, try_name, mtInternal);
if (file->is_open()) { if (file->is_open()) {
_log_file = file; _log_file = file;
xmlStream* xs = new(ResourceObj::C_HEAP, mtInternal) xmlStream(file); xmlStream* xs = new(ResourceObj::C_HEAP, mtInternal) xmlStream(file);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册