40
40
#include " interpreter/bootstrapInfo.hpp"
41
41
#include " jfr/jfrEvents.hpp"
42
42
#include " logging/log.hpp"
43
+ #include " logging/logStream.hpp"
43
44
#include " memory/allocation.hpp"
44
45
#include " memory/archiveUtils.hpp"
45
46
#include " memory/dynamicArchive.hpp"
@@ -1924,26 +1925,28 @@ bool SystemDictionaryShared::check_linking_constraints(InstanceKlass* klass, TRA
1924
1925
}
1925
1926
1926
1927
bool SystemDictionaryShared::is_supported_invokedynamic (BootstrapInfo* bsi) {
1928
+ LogTarget (Debug, cds, lambda) log;
1927
1929
if (bsi->arg_values () == NULL || !bsi->arg_values ()->is_objArray ()) {
1928
- DEBUG_ONLY (
1929
- tty->print_cr (" bsi check failed" );
1930
- tty->print_cr (" bsi->arg_values().not_null() %d" , bsi->arg_values ().not_null ());
1930
+ if (log.is_enabled ()) {
1931
+ LogStream log_stream (log);
1932
+ log.print (" bsi check failed" );
1933
+ log.print (" bsi->arg_values().not_null() %d" , bsi->arg_values ().not_null ());
1931
1934
if (bsi->arg_values ().not_null ()) {
1932
- tty-> print_cr (" bsi->arg_values()->is_objArray() %d" , bsi->arg_values ()->is_objArray ());
1933
- bsi->print ( );
1935
+ log. print (" bsi->arg_values()->is_objArray() %d" , bsi->arg_values ()->is_objArray ());
1936
+ bsi->print_msg_on (&log_stream );
1934
1937
}
1935
- )
1938
+ }
1936
1939
return false ;
1937
1940
}
1938
1941
1939
1942
Handle bsm = bsi->bsm ();
1940
1943
if (bsm.is_null () || !java_lang_invoke_DirectMethodHandle::is_instance (bsm ())) {
1941
- DEBUG_ONLY (
1942
- tty-> print_cr (" bsm check failed" );
1943
- tty-> print_cr (" bsm.is_null() %d" , bsm.is_null ());
1944
- tty-> print_cr (" java_lang_invoke_DirectMethodHandle::is_instance(bsm()) %d" ,
1944
+ if (log. is_enabled ()) {
1945
+ log. print (" bsm check failed" );
1946
+ log. print (" bsm.is_null() %d" , bsm.is_null ());
1947
+ log. print (" java_lang_invoke_DirectMethodHandle::is_instance(bsm()) %d" ,
1945
1948
java_lang_invoke_DirectMethodHandle::is_instance (bsm ()));
1946
- )
1949
+ }
1947
1950
return false ;
1948
1951
}
1949
1952
@@ -1954,13 +1957,13 @@ bool SystemDictionaryShared::is_supported_invokedynamic(BootstrapInfo* bsi) {
1954
1957
method->signature ()->equals (" (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" )) {
1955
1958
return true ;
1956
1959
} else {
1957
- DEBUG_ONLY (
1960
+ if (log. is_enabled ()) {
1958
1961
ResourceMark rm;
1959
- tty-> print_cr (" method check failed" );
1960
- tty-> print_cr (" klass_name() %s" , method->klass_name ()->as_C_string ());
1961
- tty-> print_cr (" name() %s" , method->name ()->as_C_string ());
1962
- tty-> print_cr (" signature() %s" , method->signature ()->as_C_string ());
1963
- )
1962
+ log. print (" method check failed" );
1963
+ log. print (" klass_name() %s" , method->klass_name ()->as_C_string ());
1964
+ log. print (" name() %s" , method->name ()->as_C_string ());
1965
+ log. print (" signature() %s" , method->signature ()->as_C_string ());
1966
+ }
1964
1967
}
1965
1968
1966
1969
return false ;
0 commit comments