Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/hotspot/share/ci/ciMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@ bool ciMethod::has_jsrs () const { FETCH_FLAG_FROM_VM(has_jsrs);
bool ciMethod::is_getter () const { FETCH_FLAG_FROM_VM(is_getter); }
bool ciMethod::is_setter () const { FETCH_FLAG_FROM_VM(is_setter); }
bool ciMethod::is_accessor () const { FETCH_FLAG_FROM_VM(is_accessor); }
bool ciMethod::is_initializer () const { FETCH_FLAG_FROM_VM(is_initializer); }
bool ciMethod::is_empty () const { FETCH_FLAG_FROM_VM(is_empty_method); }

bool ciMethod::is_boxing_method() const {
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/ci/ciMethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ class ciMethod : public ciMetadata {
bool is_getter () const;
bool is_setter () const;
bool is_accessor () const;
bool is_initializer () const;
bool is_empty () const;
bool can_be_statically_bound() const { return _can_be_statically_bound; }
bool has_reserved_stack_access() const { return _has_reserved_stack_access; }
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/jvmci/jvmciCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void JVMCICompiler::bootstrap(TRAPS) {
int len = objectMethods->length();
for (int i = 0; i < len; i++) {
methodHandle mh(THREAD, objectMethods->at(i));
if (!mh->is_native() && !mh->is_static() && !mh->is_initializer()) {
if (!mh->is_native() && !mh->is_static() && !mh->is_object_initializer() && !mh->is_static_initializer()) {
ResourceMark rm;
int hot_count = 10; // TODO: what's the appropriate value?
CompileBroker::compile_method(mh, InvocationEntryBci, CompLevel_full_optimization, mh, hot_count, CompileTask::Reason_Bootstrap, CHECK);
Expand Down
13 changes: 6 additions & 7 deletions src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,7 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredConstructors, (JNIEnv* env, jobject, A
GrowableArray<Method*> constructors_array;
for (int i = 0; i < iklass->methods()->length(); i++) {
Method* m = iklass->methods()->at(i);
if (m->is_initializer() && !m->is_static()) {
if (m->is_object_initializer()) {
constructors_array.append(m);
}
}
Expand All @@ -2205,7 +2205,7 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredMethods, (JNIEnv* env, jobject, ARGUME
GrowableArray<Method*> methods_array;
for (int i = 0; i < iklass->methods()->length(); i++) {
Method* m = iklass->methods()->at(i);
if (!m->is_initializer() && !m->is_overpass()) {
if (!m->is_object_initializer() && !m->is_static_initializer() && !m->is_overpass()) {
methods_array.append(m);
}
}
Expand Down Expand Up @@ -2921,12 +2921,11 @@ C2V_VMENTRY_NULL(jobject, asReflectionExecutable, (JNIEnv* env, jobject, ARGUMEN
requireInHotSpot("asReflectionExecutable", JVMCI_CHECK_NULL);
methodHandle m(THREAD, UNPACK_PAIR(Method, method));
oop executable;
if (m->is_initializer()) {
if (m->is_static_initializer()) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException,
"Cannot create java.lang.reflect.Method for class initializer");
}
if (m->is_object_initializer()) {
executable = Reflection::new_constructor(m, CHECK_NULL);
} else if (m->is_static_initializer()) {
JVMCI_THROW_MSG_NULL(IllegalArgumentException,
"Cannot create java.lang.reflect.Method for class initializer");
} else {
executable = Reflection::new_method(m, false, CHECK_NULL);
}
Expand Down
7 changes: 4 additions & 3 deletions src/hotspot/share/oops/klassVtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,9 +1230,10 @@ void klassItable::initialize_itable_and_check_constraints(TRAPS) {
}

inline bool interface_method_needs_itable_index(Method* m) {
if (m->is_static()) return false; // e.g., Stream.empty
if (m->is_initializer()) return false; // <init> or <clinit>
if (m->is_private()) return false; // uses direct call
if (m->is_static()) return false; // e.g., Stream.empty
if (m->is_object_initializer()) return false; // <init>
if (m->is_static_initializer()) return false; // <clinit>
if (m->is_private()) return false; // uses direct call
// If an interface redeclares a method from java.lang.Object,
// it should already have a vtable index, don't touch it.
// e.g., CharSequence.toString (from initialize_vtable)
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/oops/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,6 @@ bool Method::is_constant_getter() const {
Bytecodes::is_return(java_code_at(last_index)));
}

bool Method::is_initializer() const {
return is_object_initializer() || is_static_initializer();
}

bool Method::has_valid_initializer_flags() const {
return (is_static() ||
method_holder()->major_version() < 51);
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/oops/method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,6 @@ class Method : public Metadata {
// returns true if the method does nothing but return a constant of primitive type
bool is_constant_getter() const;

// returns true if the method is an initializer (<init> or <clinit>).
bool is_initializer() const;

// returns true if the method is static OR if the classfile version < 51
bool has_valid_initializer_flags() const;

Expand Down