< prev index next > src/hotspot/share/ci/ciMethod.cpp
Print this page
#include "oops/method.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/handles.inline.hpp"
+ #include "runtime/sharedRuntime.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/xmlstream.hpp"
#ifdef COMPILER2
#include "ci/bcEscapeAnalyzer.hpp"
#include "ci/ciTypeFlow.hpp"
}
}
return false;
}
+ bool ciMethod::array_access_profiled_type(int bci, ciKlass*& array_type, ciKlass*& element_type, ProfilePtrKind& element_ptr, bool &flat_array, bool &null_free_array) {
+ if (method_data() != nullptr && method_data()->is_mature()) {
+ ciProfileData* data = method_data()->bci_to_data(bci);
+ if (data != nullptr) {
+ if (data->is_ArrayLoadData()) {
+ ciArrayLoadData* array_access = (ciArrayLoadData*) data->as_ArrayLoadData();
+ array_type = array_access->array()->valid_type();
+ element_type = array_access->element()->valid_type();
+ element_ptr = array_access->element()->ptr_kind();
+ flat_array = array_access->flat_array();
+ null_free_array = array_access->null_free_array();
+ return true;
+ } else if (data->is_ArrayStoreData()) {
+ ciArrayStoreData* array_access = (ciArrayStoreData*) data->as_ArrayStoreData();
+ array_type = array_access->array()->valid_type();
+ flat_array = array_access->flat_array();
+ null_free_array = array_access->null_free_array();
+ ciCallProfile call_profile = call_profile_at_bci(bci);
+ if (call_profile.morphism() == 1) {
+ element_type = call_profile.receiver(0);
+ } else {
+ element_type = nullptr;
+ }
+ if (!array_access->null_seen()) {
+ element_ptr = ProfileNeverNull;
+ } else if (call_profile.count() == 0) {
+ element_ptr = ProfileAlwaysNull;
+ } else {
+ element_ptr = ProfileMaybeNull;
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ bool ciMethod::acmp_profiled_type(int bci, ciKlass*& left_type, ciKlass*& right_type, ProfilePtrKind& left_ptr, ProfilePtrKind& right_ptr, bool &left_inline_type, bool &right_inline_type) {
+ if (method_data() != nullptr && method_data()->is_mature()) {
+ ciProfileData* data = method_data()->bci_to_data(bci);
+ if (data != nullptr && data->is_ACmpData()) {
+ ciACmpData* acmp = (ciACmpData*)data->as_ACmpData();
+ left_type = acmp->left()->valid_type();
+ right_type = acmp->right()->valid_type();
+ left_ptr = acmp->left()->ptr_kind();
+ right_ptr = acmp->right()->ptr_kind();
+ left_inline_type = acmp->left_inline_type();
+ right_inline_type = acmp->right_inline_type();
+ return true;
+ }
+ }
+ return false;
+ }
+
// ------------------------------------------------------------------
// ciMethod::find_monomorphic_target
//
// Given a certain calling environment, find the monomorphic target
vmIntrinsics::ID iid = _intrinsic_id; // do not check if loaded
return iid == vmIntrinsics::_compiledLambdaForm;
}
// ------------------------------------------------------------------
- // ciMethod::is_object_initializer
+ // ciMethod::is_object_constructor
//
- bool ciMethod::is_object_initializer() const {
- return name() == ciSymbols::object_initializer_name();
+ bool ciMethod::is_object_constructor() const {
+ return (name() == ciSymbols::object_initializer_name()
+ && signature()->return_type()->is_void());
+ // Note: We can't test is_static, because that would
+ // require the method to be loaded. Sometimes it isn't.
}
// ------------------------------------------------------------------
// ciMethod::has_member_arg
//
bool ciMethod::has_loops () const { FETCH_FLAG_FROM_VM(has_loops); }
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 {
if (intrinsic_id() != vmIntrinsics::_none && holder()->is_box_klass()) {
switch (intrinsic_id()) {
}
return true; // no mismatch found
}
// ------------------------------------------------------------------
+
+ bool ciMethod::is_scalarized_arg(int idx) const {
+ VM_ENTRY_MARK;
+ return get_Method()->is_scalarized_arg(idx);
+ }
+
+ bool ciMethod::has_scalarized_args() const {
+ VM_ENTRY_MARK;
+ return get_Method()->has_scalarized_args();
+ }
+
+ const GrowableArray<SigEntry>* ciMethod::get_sig_cc() const {
+ VM_ENTRY_MARK;
+ if (get_Method()->adapter() == nullptr) {
+ return nullptr;
+ }
+ return get_Method()->adapter()->get_sig_cc();
+ }
< prev index next >