The comment for the method says:
// returns true if the method is an accessor function (setter/getter).
bool is_accessor() const;
...but the implementation only accepts non-(long|double|float) getters:
bool Method::is_accessor() const {
if (code_size() != 5) return false;
if (size_of_parameters() != 1) return false;
if (java_code_at(0) != Bytecodes::_aload_0 ) return false;
if (java_code_at(1) != Bytecodes::_getfield) return false;
if (java_code_at(4) != Bytecodes::_areturn &&
java_code_at(4) != Bytecodes::_ireturn ) return false;
return true;
}
Method::is_accessor is used in compilers to exempt trivial methods from the usual inlining limits, profiling, and C2 compiles in tiered. There seems to be no reason to skip any setters and/or any types.
Proof-of-concept change:
http://cr.openjdk.java.net/~shade/8140650/webrev.00/
// returns true if the method is an accessor function (setter/getter).
bool is_accessor() const;
...but the implementation only accepts non-(long|double|float) getters:
bool Method::is_accessor() const {
if (code_size() != 5) return false;
if (size_of_parameters() != 1) return false;
if (java_code_at(0) != Bytecodes::_aload_0 ) return false;
if (java_code_at(1) != Bytecodes::_getfield) return false;
if (java_code_at(4) != Bytecodes::_areturn &&
java_code_at(4) != Bytecodes::_ireturn ) return false;
return true;
}
Method::is_accessor is used in compilers to exempt trivial methods from the usual inlining limits, profiling, and C2 compiles in tiered. There seems to be no reason to skip any setters and/or any types.
Proof-of-concept change:
http://cr.openjdk.java.net/~shade/8140650/webrev.00/
- relates to
-
JDK-8142984 Zero: fast accessors should handle both getters and setters
-
- Resolved
-