8197608: MacroAssembler::unimplemented calls global operator new[]

Removed C heap allocation of string buffers.

Reviewed-by: kvn, shade
This commit is contained in:
Tobias Hartmann 2018-02-14 08:23:53 +01:00
parent 51ab999e0e
commit 2c5a0835a9
3 changed files with 24 additions and 9 deletions

View File

@ -2056,9 +2056,14 @@ void MacroAssembler::stop(const char* msg) {
}
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
const char* buf = NULL;
{
ResourceMark rm;
stringStream ss;
ss.print("unimplemented: %s", what);
buf = code_string(ss.as_string());
}
stop(buf);
}
// If a constant does not fit in an immediate field, generate some

View File

@ -1411,9 +1411,14 @@ void MacroAssembler::untested(const char* what) {
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
const char* buf = NULL;
{
ResourceMark rm;
stringStream ss;
ss.print("unimplemented: %s", what);
buf = code_string(ss.as_string());
}
stop(buf);
}

View File

@ -3660,9 +3660,14 @@ void MacroAssembler::os_breakpoint() {
}
void MacroAssembler::unimplemented(const char* what) {
char* b = new char[1024];
jio_snprintf(b, 1024, "unimplemented: %s", what);
stop(b);
const char* buf = NULL;
{
ResourceMark rm;
stringStream ss;
ss.print("unimplemented: %s", what);
buf = code_string(ss.as_string());
}
stop(buf);
}
#ifdef _LP64