< prev index next >

src/hotspot/share/ci/ciMethod.cpp

Print this page
@@ -46,10 +46,11 @@
  #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"

@@ -652,10 +653,43 @@
      }
    }
    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() != NULL && method_data()->is_mature()) {
+     ciProfileData* data = method_data()->bci_to_data(bci);
+     if (data != NULL && data->is_ArrayLoadStoreData()) {
+       ciArrayLoadStoreData* array_access = (ciArrayLoadStoreData*)data->as_ArrayLoadStoreData();
+       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;
+     }
+   }
+   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() != NULL && method_data()->is_mature()) {
+     ciProfileData* data = method_data()->bci_to_data(bci);
+     if (data != NULL && 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

@@ -950,14 +984,27 @@
    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::is_static_vnew_factory
+ //
+ bool ciMethod::is_static_vnew_factory() const {
+    return (name() == ciSymbols::inline_factory_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
  //

@@ -1218,11 +1265,11 @@
  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_object_constructor_or_class_initializer() const { FETCH_FLAG_FROM_VM(is_object_constructor_or_class_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()) {

@@ -1378,10 +1425,11 @@
  // ------------------------------------------------------------------
  
  static BasicType erase_to_word_type(BasicType bt) {
    if (is_subword_type(bt))   return T_INT;
    if (is_reference_type(bt)) return T_OBJECT;
+   if (bt == T_PRIMITIVE_OBJECT)   return T_OBJECT;
    return bt;
  }
  
  static bool basic_types_match(ciType* t1, ciType* t2) {
    if (t1 == t2)  return true;

@@ -1465,5 +1513,23 @@
    }
    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() == NULL) {
+     return NULL;
+   }
+   return get_Method()->adapter()->get_sig_cc();
+ }
< prev index next >