diff --git a/make/solaris/makefiles/fastdebug.make b/make/solaris/makefiles/fastdebug.make index 647e87af65f9c21340e22827fa4026ee3e8e4552..08834f03cec7c74b7f1871ad8d5277678ceff3bc 100644 --- a/make/solaris/makefiles/fastdebug.make +++ b/make/solaris/makefiles/fastdebug.make @@ -39,9 +39,6 @@ OPT_CFLAGS/SLOWER = -xO2 ifeq ($(COMPILER_REV_NUMERIC), 510) # CC 5.10 has bug XXXXX with -xO4 OPT_CFLAGS/jvmtiClassFileReconstituter.o = $(OPT_CFLAGS/SLOWER) -# jvm98 crashes on solaris-i586-fastdebug and solaris-sparc-fastdebug with stack overflow -OPT_CFLAGS/escape.o = $(OPT_CFLAGS) -xspace -OPT_CFLAGS/matcher.o = $(OPT_CFLAGS) -xspace endif # COMPILER_REV_NUMERIC == 510 ifeq ($(COMPILER_REV_NUMERIC), 509) diff --git a/src/share/vm/opto/callGenerator.cpp b/src/share/vm/opto/callGenerator.cpp index 41298ee16919d7145f8c6487a6a35c1c3759e908..cb4be976a0b02994258a3f9a9f038505215c0d0e 100644 --- a/src/share/vm/opto/callGenerator.cpp +++ b/src/share/vm/opto/callGenerator.cpp @@ -737,7 +737,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* break; default: - fatal(err_msg("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid))); + fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid))); break; } return NULL; diff --git a/src/share/vm/opto/chaitin.cpp b/src/share/vm/opto/chaitin.cpp index 00cabcf237f278a9feb4593fd39d5f8ba048508f..6ee1393a8ffd967256c2294dfdddabfce5865dd8 100644 --- a/src/share/vm/opto/chaitin.cpp +++ b/src/share/vm/opto/chaitin.cpp @@ -1536,7 +1536,7 @@ Node *PhaseChaitin::find_base_for_derived( Node **derived_base_map, Node *derive // Check for AddP-related opcodes if( !derived->is_Phi() ) { - assert(derived->as_Mach()->ideal_Opcode() == Op_AddP, err_msg("but is: %s", derived->Name())); + assert(derived->as_Mach()->ideal_Opcode() == Op_AddP, err_msg_res("but is: %s", derived->Name())); Node *base = derived->in(AddPNode::Base); derived_base_map[derived->_idx] = base; return base; diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp index 5331d033fe2692e35773cb20cc8ab5c946fb6cbe..0836fc205d614a8c40f827963038ce4d1b4c7c54 100644 --- a/src/share/vm/opto/compile.cpp +++ b/src/share/vm/opto/compile.cpp @@ -3138,7 +3138,7 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) { default: ShouldNotReachHere(); } assert(constant_addr, "consts section too small"); - assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), err_msg("must be: %d == %d", constant_addr - _masm.code()->consts()->start(), con.offset())); + assert((constant_addr - _masm.code()->consts()->start()) == con.offset(), err_msg_res("must be: %d == %d", constant_addr - _masm.code()->consts()->start(), con.offset())); } } @@ -3199,7 +3199,7 @@ void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n if (Compile::current()->in_scratch_emit_size()) return; assert(labels.is_nonempty(), "must be"); - assert((uint) labels.length() == n->outcnt(), err_msg("must be equal: %d == %d", labels.length(), n->outcnt())); + assert((uint) labels.length() == n->outcnt(), err_msg_res("must be equal: %d == %d", labels.length(), n->outcnt())); // Since MachConstantNode::constant_offset() also contains // table_base_offset() we need to subtract the table_base_offset() @@ -3211,7 +3211,7 @@ void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n for (uint i = 0; i < n->outcnt(); i++) { address* constant_addr = &jump_table_base[i]; - assert(*constant_addr == (((address) n) + i), err_msg("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i))); + assert(*constant_addr == (((address) n) + i), err_msg_res("all jump-table entries must contain adjusted node pointer: " INTPTR_FORMAT " == " INTPTR_FORMAT, *constant_addr, (((address) n) + i))); *constant_addr = cb.consts()->target(*labels.at(i), (address) constant_addr); cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type); } diff --git a/src/share/vm/opto/doCall.cpp b/src/share/vm/opto/doCall.cpp index ac668e5aac602abe2171073889e131a837d04c4f..61d8d5e7cdc8822ded52d0f0e47878726db59229 100644 --- a/src/share/vm/opto/doCall.cpp +++ b/src/share/vm/opto/doCall.cpp @@ -523,10 +523,10 @@ void Parse::do_call() { retnode = _gvn.transform( new (C, 3) LShiftINode(retnode, intcon(16)) ); retnode = _gvn.transform( new (C, 3) RShiftINode(retnode, intcon(16)) ); } else { - assert(ct == T_INT, err_msg("rt=%d, ct=%d", rt, ct)); + assert(ct == T_INT, err_msg_res("rt=%d, ct=%d", rt, ct)); } } else if (rt == T_OBJECT) { - assert(ct == T_OBJECT, err_msg("rt=T_OBJECT, ct=%d", ct)); + assert(ct == T_OBJECT, err_msg_res("rt=T_OBJECT, ct=%d", ct)); if (ctype->is_loaded()) { Node* if_fail = top(); retnode = gen_checkcast(retnode, makecon(TypeKlassPtr::make(ctype->as_klass())), &if_fail); @@ -539,7 +539,7 @@ void Parse::do_call() { push(retnode); } } else { - assert(ct == rt, err_msg("unexpected mismatch rt=%d, ct=%d", rt, ct)); + assert(ct == rt, err_msg_res("unexpected mismatch rt=%d, ct=%d", rt, ct)); // push a zero; it's better than getting an oop/int mismatch retnode = pop_node(rt); retnode = zerocon(ct); diff --git a/src/share/vm/opto/escape.cpp b/src/share/vm/opto/escape.cpp index 264e00a0366ac74ecceadbee11731c3873531d3f..49206f7abad77384cb5f72deac67ac418c09bc22 100644 --- a/src/share/vm/opto/escape.cpp +++ b/src/share/vm/opto/escape.cpp @@ -1055,7 +1055,7 @@ bool ConnectionGraph::complete_connection_graph( C->log()->text("%s", (iterations >= CG_BUILD_ITER_LIMIT) ? "iterations" : "time"); C->log()->end_elem(" limit'"); } - assert(false, err_msg("infinite EA connection graph build (%f sec, %d iterations) with %d nodes and worklist size %d", + assert(false, err_msg_res("infinite EA connection graph build (%f sec, %d iterations) with %d nodes and worklist size %d", time.seconds(), iterations, nodes_size(), ptnodes_worklist.length())); // Possible infinite build_connection_graph loop, // bailout (no changes to ideal graph were made). diff --git a/src/share/vm/opto/idealGraphPrinter.cpp b/src/share/vm/opto/idealGraphPrinter.cpp index 3344ce29c8e8d8c429bf5a24897760575e189ae4..b3919a65476c8b8118c8a6fb6f660bee9fd115ab 100644 --- a/src/share/vm/opto/idealGraphPrinter.cpp +++ b/src/share/vm/opto/idealGraphPrinter.cpp @@ -155,8 +155,8 @@ IdealGraphPrinter::IdealGraphPrinter() { } else { // It would be nice if we could shut down cleanly but it should // be an error if we can't connect to the visualizer. - fatal(err_msg("Couldn't connect to visualizer at %s:%d", - PrintIdealGraphAddress, PrintIdealGraphPort)); + fatal(err_msg_res("Couldn't connect to visualizer at %s:%d", + PrintIdealGraphAddress, PrintIdealGraphPort)); } } diff --git a/src/share/vm/opto/node.hpp b/src/share/vm/opto/node.hpp index 9e5fc69cdfe6a195340c588ecb7e110e2d32ca48..759c0bcd6d96f53d1359be3b4311ae1100d5fdc9 100644 --- a/src/share/vm/opto/node.hpp +++ b/src/share/vm/opto/node.hpp @@ -363,7 +363,7 @@ protected: #endif // Reference to the i'th input Node. Error if out of bounds. - Node* in(uint i) const { assert(i < _max, err_msg("oob: i=%d, _max=%d", i, _max)); return _in[i]; } + Node* in(uint i) const { assert(i < _max, err_msg_res("oob: i=%d, _max=%d", i, _max)); return _in[i]; } // Reference to the i'th output Node. Error if out of bounds. // Use this accessor sparingly. We are going trying to use iterators instead. Node* raw_out(uint i) const { assert(i < _outcnt,"oob"); return _out[i]; } @@ -394,7 +394,7 @@ protected: void ins_req( uint i, Node *n ); // Insert a NEW required input void set_req( uint i, Node *n ) { assert( is_not_dead(n), "can not use dead node"); - assert( i < _cnt, err_msg("oob: i=%d, _cnt=%d", i, _cnt)); + assert( i < _cnt, err_msg_res("oob: i=%d, _cnt=%d", i, _cnt)); assert( !VerifyHashTableKeys || _hash_lock == 0, "remove node from hash table before modifying it"); Node** p = &_in[i]; // cache this._in, across the del_out call diff --git a/src/share/vm/opto/parse1.cpp b/src/share/vm/opto/parse1.cpp index cce50afa08345dc102a4f7330629078c4d991500..79fab69c161845beda18b8f90c79e2a0d4e2183a 100644 --- a/src/share/vm/opto/parse1.cpp +++ b/src/share/vm/opto/parse1.cpp @@ -1399,7 +1399,7 @@ void Parse::do_one_block() { int pre_bc_sp = sp(); int inputs, depth; bool have_se = !stopped() && compute_stack_effects(inputs, depth, /*for_parse*/ true); - assert(!have_se || pre_bc_sp >= inputs, err_msg("have enough stack to execute this BC: pre_bc_sp=%d, inputs=%d", pre_bc_sp, inputs)); + assert(!have_se || pre_bc_sp >= inputs, err_msg_res("have enough stack to execute this BC: pre_bc_sp=%d, inputs=%d", pre_bc_sp, inputs)); #endif //ASSERT do_one_bytecode(); diff --git a/src/share/vm/utilities/debug.cpp b/src/share/vm/utilities/debug.cpp index b7e7a27cd67af261e0d752f017c4a888babc6cc8..77e38ea5e8d4cbda5093c4915376ab6d80b05695 100644 --- a/src/share/vm/utilities/debug.cpp +++ b/src/share/vm/utilities/debug.cpp @@ -91,6 +91,13 @@ # endif #endif // PRODUCT +FormatBufferResource::FormatBufferResource(const char * format, ...) + : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) { + va_list argp; + va_start(argp, format); + jio_vsnprintf(_buf, RES_BUFSZ, format, argp); + va_end(argp); +} void warning(const char* format, ...) { if (PrintWarnings) { diff --git a/src/share/vm/utilities/debug.hpp b/src/share/vm/utilities/debug.hpp index 0ba6442491dbef4d9e1f670f6f33946e9032cab9..0c718a2fe2fff08ebb96ac6a1b4809f28538b1f0 100644 --- a/src/share/vm/utilities/debug.hpp +++ b/src/share/vm/utilities/debug.hpp @@ -31,29 +31,43 @@ #include // Simple class to format the ctor arguments into a fixed-sized buffer. +class FormatBufferBase { + protected: + char* _buf; + inline FormatBufferBase(char* buf) : _buf(buf) {} + public: + operator const char *() const { return _buf; } +}; + +// Use resource area for buffer +#define RES_BUFSZ 256 +class FormatBufferResource : public FormatBufferBase { + public: + FormatBufferResource(const char * format, ...); +}; + +// Use stack for buffer template -class FormatBuffer { +class FormatBuffer : public FormatBufferBase { public: inline FormatBuffer(const char * format, ...); inline void append(const char* format, ...); inline void print(const char* format, ...); inline void printv(const char* format, va_list ap); - operator const char *() const { return _buf; } char* buffer() { return _buf; } int size() { return bufsz; } private: FormatBuffer(const FormatBuffer &); // prevent copies + char _buffer[bufsz]; protected: - char _buf[bufsz]; - inline FormatBuffer(); }; template -FormatBuffer::FormatBuffer(const char * format, ...) { +FormatBuffer::FormatBuffer(const char * format, ...) : FormatBufferBase(_buffer) { va_list argp; va_start(argp, format); jio_vsnprintf(_buf, bufsz, format, argp); @@ -61,7 +75,7 @@ FormatBuffer::FormatBuffer(const char * format, ...) { } template -FormatBuffer::FormatBuffer() { +FormatBuffer::FormatBuffer() : FormatBufferBase(_buffer) { _buf[0] = '\0'; } @@ -93,6 +107,7 @@ void FormatBuffer::append(const char* format, ...) { // Used to format messages for assert(), guarantee(), fatal(), etc. typedef FormatBuffer<> err_msg; +typedef FormatBufferResource err_msg_res; // assertions #ifdef ASSERT