mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8312597: Convert TraceTypeProfile to UL
Reviewed-by: shade, phh
This commit is contained in:
parent
1f1c5c6f8d
commit
0074b48ad7
3 changed files with 93 additions and 7 deletions
|
@ -30,6 +30,10 @@
|
|||
#include "compiler/compileBroker.hpp"
|
||||
#include "compiler/compileLog.hpp"
|
||||
#include "interpreter/linkResolver.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "logging/logLevel.hpp"
|
||||
#include "logging/logMessage.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
#include "opto/addnode.hpp"
|
||||
#include "opto/callGenerator.hpp"
|
||||
#include "opto/castnode.hpp"
|
||||
|
@ -46,7 +50,15 @@
|
|||
#include "jfr/jfr.hpp"
|
||||
#endif
|
||||
|
||||
void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
|
||||
void print_trace_type_profile(outputStream* out, int depth, ciKlass* prof_klass, int site_count, int receiver_count) {
|
||||
CompileTask::print_inline_indent(depth, out);
|
||||
out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
|
||||
prof_klass->name()->print_symbol_on(out);
|
||||
out->cr();
|
||||
}
|
||||
|
||||
void trace_type_profile(Compile* C, ciMethod* method, int depth, int bci, ciMethod* prof_method,
|
||||
ciKlass* prof_klass, int site_count, int receiver_count) {
|
||||
if (TraceTypeProfile || C->print_inlining()) {
|
||||
outputStream* out = tty;
|
||||
if (!C->print_inlining()) {
|
||||
|
@ -58,12 +70,13 @@ void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMeth
|
|||
} else {
|
||||
out = C->print_inlining_stream();
|
||||
}
|
||||
CompileTask::print_inline_indent(depth, out);
|
||||
out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
|
||||
stringStream ss;
|
||||
prof_klass->name()->print_symbol_on(&ss);
|
||||
out->print("%s", ss.freeze());
|
||||
out->cr();
|
||||
print_trace_type_profile(out, depth, prof_klass, site_count, receiver_count);
|
||||
}
|
||||
|
||||
LogTarget(Debug, jit, inlining) lt;
|
||||
if (lt.is_enabled()) {
|
||||
LogStream ls(lt);
|
||||
print_trace_type_profile(&ls, depth, prof_klass, site_count, receiver_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
36
test/hotspot/jtreg/compiler/arguments/TestLogJIT.java
Normal file
36
test/hotspot/jtreg/compiler/arguments/TestLogJIT.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Amazon designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test running with log:jit*=debug enabled.
|
||||
* @run main/othervm -Xlog:jit*=debug compiler.arguments.TestTraceTypeProfile
|
||||
*/
|
||||
|
||||
package compiler.arguments;
|
||||
|
||||
public class TestLogJIT {
|
||||
|
||||
static public void main(String[] args) {
|
||||
System.out.println("Passed");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Amazon designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Test running TraceTypeProfile enabled.
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
|
||||
* -XX:+TraceTypeProfile compiler.arguments.TestTraceTypeProfile
|
||||
*/
|
||||
|
||||
package compiler.arguments;
|
||||
|
||||
public class TestTraceTypeProfile {
|
||||
|
||||
static public void main(String[] args) {
|
||||
System.out.println("Passed");
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue