Mercurial > hg > truffle
comparison src/share/vm/oops/methodOop.cpp @ 2334:dbad0519a1c4
6845426: non-static <clinit> method with no args is called during the class initialization process
Summary: Only call <clinit> with ACC_STATIC for classfiles with version > 50
Reviewed-by: acorn, dholmes, coleenp
author | kamg |
---|---|
date | Fri, 04 Mar 2011 14:40:46 -0500 |
parents | a97fd181b813 |
children | 72dee110246f |
comparison
equal
deleted
inserted
replaced
2333:f767174aac14 | 2334:dbad0519a1c4 |
---|---|
464 return true; | 464 return true; |
465 } | 465 } |
466 | 466 |
467 | 467 |
468 bool methodOopDesc::is_initializer() const { | 468 bool methodOopDesc::is_initializer() const { |
469 return name() == vmSymbols::object_initializer_name() || name() == vmSymbols::class_initializer_name(); | 469 return name() == vmSymbols::object_initializer_name() || is_static_initializer(); |
470 } | |
471 | |
472 bool methodOopDesc::has_valid_initializer_flags() const { | |
473 return (is_static() || | |
474 instanceKlass::cast(method_holder())->major_version() < 51); | |
475 } | |
476 | |
477 bool methodOopDesc::is_static_initializer() const { | |
478 // For classfiles version 51 or greater, ensure that the clinit method is | |
479 // static. Non-static methods with the name "<clinit>" are not static | |
480 // initializers. (older classfiles exempted for backward compatibility) | |
481 return name() == vmSymbols::class_initializer_name() && | |
482 has_valid_initializer_flags(); | |
470 } | 483 } |
471 | 484 |
472 | 485 |
473 objArrayHandle methodOopDesc::resolved_checked_exceptions_impl(methodOop this_oop, TRAPS) { | 486 objArrayHandle methodOopDesc::resolved_checked_exceptions_impl(methodOop this_oop, TRAPS) { |
474 int length = this_oop->checked_exceptions_length(); | 487 int length = this_oop->checked_exceptions_length(); |