mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-05 19:25:41 +00:00
8286647: JFR: Build failure when C1 or C2 is disabled after JDK-8282420
Reviewed-by: mgronlun
This commit is contained in:
parent
369611ea34
commit
617ef541bb
@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "c1/c1_GraphBuilder.hpp"
|
||||
#include "ci/ciKlass.hpp"
|
||||
#include "ci/ciMethod.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
@ -31,10 +30,17 @@
|
||||
#include "jfr/instrumentation/jfrResolution.hpp"
|
||||
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "opto/parse.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
#include "runtime/vframe.inline.hpp"
|
||||
|
||||
#ifdef COMPILER1
|
||||
#include "c1/c1_GraphBuilder.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef COMPILER2
|
||||
#include "opto/parse.hpp"
|
||||
#endif
|
||||
|
||||
static const char* const link_error_msg = "illegal access linking method 'jdk.jfr.internal.event.EventWriterFactory.getEventWriter(long)'";
|
||||
|
||||
static const Method* ljf_sender_method(JavaThread* jt) {
|
||||
@ -88,16 +94,20 @@ static inline bool is_compiler_linking_event_writer(const ciKlass * holder, cons
|
||||
return target->name()->get_symbol() == event_writer_method_name;
|
||||
}
|
||||
|
||||
#ifdef COMPILER1
|
||||
// C1
|
||||
void JfrResolution::on_c1_resolution(const GraphBuilder * builder, const ciKlass * holder, const ciMethod * target) {
|
||||
if (is_compiler_linking_event_writer(holder, target) && !IS_METHOD_BLESSED(builder->method()->get_Method())) {
|
||||
builder->bailout(link_error_msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef COMPILER2
|
||||
// C2
|
||||
void JfrResolution::on_c2_resolution(const Parse * parse, const ciKlass * holder, const ciMethod * target) {
|
||||
if (is_compiler_linking_event_writer(holder, target) && !IS_METHOD_BLESSED(parse->method()->get_Method())) {
|
||||
parse->C->record_failure(link_error_msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -104,13 +104,17 @@ void Jfr::on_resolution(const CallInfo& info, TRAPS) {
|
||||
JfrResolution::on_runtime_resolution(info, THREAD);
|
||||
}
|
||||
|
||||
#ifdef COMPILER1
|
||||
void Jfr::on_resolution(const GraphBuilder* builder, const ciKlass* holder, const ciMethod* target) {
|
||||
JfrResolution::on_c1_resolution(builder, holder, target);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef COMPILER2
|
||||
void Jfr::on_resolution(const Parse* parse, const ciKlass* holder, const ciMethod* target) {
|
||||
JfrResolution::on_c2_resolution(parse, holder, target);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Jfr::on_vm_shutdown(bool exception_handler) {
|
||||
if (JfrRecorder::is_recording()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user