@@ -134,17 +134,17 @@ void Verifier::trace_class_resolution(Klass* resolve_class, InstanceKlass* verif
134134}
135135
136136// Prints the end-verification message to the appropriate output.
137- void Verifier::log_end_verification (outputStream* st, const char * klassName, Symbol* exception_name, TRAPS ) {
138- if (HAS_PENDING_EXCEPTION ) {
137+ void Verifier::log_end_verification (outputStream* st, const char * klassName, Symbol* exception_name, oop pending_exception ) {
138+ if (pending_exception != NULL ) {
139139 st->print (" Verification for %s has" , klassName);
140- oop message = java_lang_Throwable::message (PENDING_EXCEPTION );
140+ oop message = java_lang_Throwable::message (pending_exception );
141141 if (message != NULL ) {
142142 char * ex_msg = java_lang_String::as_utf8_string (message);
143143 st->print_cr (" exception pending '%s %s'" ,
144- PENDING_EXCEPTION ->klass ()->external_name (), ex_msg);
144+ pending_exception ->klass ()->external_name (), ex_msg);
145145 } else {
146146 st->print_cr (" exception pending %s " ,
147- PENDING_EXCEPTION ->klass ()->external_name ());
147+ pending_exception ->klass ()->external_name ());
148148 }
149149 } else if (exception_name != NULL ) {
150150 st->print_cr (" Verification for %s failed" , klassName);
@@ -193,7 +193,8 @@ bool Verifier::verify(InstanceKlass* klass, bool should_verify_class, TRAPS) {
193193
194194 log_info (class , init)(" Start class verification for: %s" , klass->external_name ());
195195 if (klass->major_version () >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
196- ClassVerifier split_verifier (klass, THREAD);
196+ ClassVerifier split_verifier (jt, klass);
197+ // We don't use CHECK here, or on inference_verify below, so that we can log any exception.
197198 split_verifier.verify_class (THREAD);
198199 exception_name = split_verifier.result ();
199200
@@ -228,12 +229,12 @@ bool Verifier::verify(InstanceKlass* klass, bool should_verify_class, TRAPS) {
228229 LogTarget (Info, class , init) lt1;
229230 if (lt1.is_enabled ()) {
230231 LogStream ls (lt1);
231- log_end_verification (&ls, klass->external_name (), exception_name, THREAD );
232+ log_end_verification (&ls, klass->external_name (), exception_name, PENDING_EXCEPTION );
232233 }
233234 LogTarget (Info, verification) lt2;
234235 if (lt2.is_enabled ()) {
235236 LogStream ls (lt2);
236- log_end_verification (&ls, klass->external_name (), exception_name, THREAD );
237+ log_end_verification (&ls, klass->external_name (), exception_name, PENDING_EXCEPTION );
237238 }
238239
239240 if (HAS_PENDING_EXCEPTION) {
@@ -589,9 +590,8 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
589590
590591// Methods in ClassVerifier
591592
592- ClassVerifier::ClassVerifier (
593- InstanceKlass* klass, TRAPS)
594- : _thread(THREAD), _previous_symbol(NULL ), _symbols(NULL ), _exception_type(NULL ),
593+ ClassVerifier::ClassVerifier (JavaThread* current, InstanceKlass* klass)
594+ : _thread(current), _previous_symbol(NULL ), _symbols(NULL ), _exception_type(NULL ),
595595 _message(NULL ), _method_signatures_table(NULL ), _klass(klass) {
596596 _this_type = VerificationType::reference_type (klass->name ());
597597}
@@ -616,6 +616,7 @@ TypeOrigin ClassVerifier::ref_ctx(const char* sig) {
616616 return TypeOrigin::implicit (vt);
617617}
618618
619+
619620void ClassVerifier::verify_class (TRAPS) {
620621 log_info (verification)(" Verifying class %s with new format" , _klass->external_name ());
621622
@@ -653,8 +654,7 @@ void ClassVerifier::verify_class(TRAPS) {
653654// Translate the signature entries into verification types and save them in
654655// the growable array. Also, save the count of arguments.
655656void ClassVerifier::translate_signature (Symbol* const method_sig,
656- sig_as_verification_types* sig_verif_types,
657- TRAPS) {
657+ sig_as_verification_types* sig_verif_types) {
658658 SignatureStream sig_stream (method_sig);
659659 VerificationType sig_type[2 ];
660660 int sig_i = 0 ;
@@ -688,11 +688,11 @@ void ClassVerifier::translate_signature(Symbol* const method_sig,
688688}
689689
690690void ClassVerifier::create_method_sig_entry (sig_as_verification_types* sig_verif_types,
691- int sig_index, TRAPS ) {
691+ int sig_index) {
692692 // Translate the signature into verification types.
693693 ConstantPool* cp = _klass->constants ();
694694 Symbol* const method_sig = cp->symbol_at (sig_index);
695- translate_signature (method_sig, sig_verif_types, CHECK_VERIFY ( this ) );
695+ translate_signature (method_sig, sig_verif_types);
696696
697697 // Add the list of this signature's verification types to the table.
698698 bool is_unique = method_signatures_table ()->put (sig_index, sig_verif_types);
@@ -718,8 +718,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
718718 // Initial stack map frame: offset is 0, stack is initially empty.
719719 StackMapFrame current_frame (max_locals, max_stack, this );
720720 // Set initial locals
721- VerificationType return_type = current_frame.set_locals_from_arg (
722- m, current_type (), CHECK_VERIFY (this ));
721+ VerificationType return_type = current_frame.set_locals_from_arg ( m, current_type ());
723722
724723 int32_t stackmap_index = 0 ; // index to the stackmap array
725724
@@ -1049,8 +1048,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
10491048 current_frame.push_stack (
10501049 VerificationType::null_type (), CHECK_VERIFY (this ));
10511050 } else {
1052- VerificationType component =
1053- atype.get_component (this , CHECK_VERIFY (this ));
1051+ VerificationType component = atype.get_component (this );
10541052 current_frame.push_stack (component, CHECK_VERIFY (this ));
10551053 }
10561054 no_control_flow = false ; break ;
@@ -2827,7 +2825,7 @@ void ClassVerifier::verify_invoke_instructions(
28272825 // Not found, add the entry to the table.
28282826 GrowableArray<VerificationType>* verif_types = new GrowableArray<VerificationType>(10 );
28292827 mth_sig_verif_types = new sig_as_verification_types (verif_types);
2830- create_method_sig_entry (mth_sig_verif_types, sig_index, CHECK_VERIFY ( this ) );
2828+ create_method_sig_entry (mth_sig_verif_types, sig_index);
28312829 }
28322830
28332831 // Get the number of arguments for this signature.
0 commit comments