< prev index next >

src/hotspot/share/ci/ciMethodType.cpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciInstance.hpp"
  27 #include "ci/ciMethodType.hpp"
  28 #include "ci/ciUtilities.inline.hpp"
  29 #include "classfile/javaClasses.inline.hpp"
  30 
  31 ciType* ciMethodType::class_to_citype(oop klass_oop) const {
  32   if (java_lang_Class::is_primitive(klass_oop)) {
  33     BasicType bt = java_lang_Class::primitive_type(klass_oop);
  34     return ciType::make(bt);
  35   } else {
  36     Klass* k = java_lang_Class::as_Klass(klass_oop);
  37     return CURRENT_ENV->get_klass(k);
  38   }
  39 }
  40 
  41 ciType* ciMethodType::rtype() const {
  42   GUARDED_VM_ENTRY(
  43     oop rtype = java_lang_invoke_MethodType::rtype(get_oop());

  44     return class_to_citype(rtype);
  45   )
  46 }
  47 
  48 int ciMethodType::ptype_count() const {
  49   GUARDED_VM_ENTRY(return java_lang_invoke_MethodType::ptype_count(get_oop());)
  50 }
  51 
  52 int ciMethodType::ptype_slot_count() const {
  53   GUARDED_VM_ENTRY(return java_lang_invoke_MethodType::ptype_slot_count(get_oop());)
  54 }
  55 
  56 ciType* ciMethodType::ptype_at(int index) const {
  57   GUARDED_VM_ENTRY(
  58     oop ptype = java_lang_invoke_MethodType::ptype(get_oop(), index);

  59     return class_to_citype(ptype);
  60   )
  61 }


  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciInstance.hpp"
  27 #include "ci/ciMethodType.hpp"
  28 #include "ci/ciUtilities.inline.hpp"
  29 #include "classfile/javaClasses.inline.hpp"
  30 
  31 ciType* ciMethodType::class_to_citype(oop klass_oop) const {
  32   if (java_lang_Class::is_primitive(klass_oop)) {
  33     BasicType bt = java_lang_Class::primitive_type(klass_oop);
  34     return ciType::make(bt);
  35   } else {
  36     Klass* k = java_lang_Class::as_Klass(klass_oop);
  37     return CURRENT_ENV->get_klass(k);
  38   }
  39 }
  40 
  41 ciType* ciMethodType::rtype(bool& never_null) const {
  42   GUARDED_VM_ENTRY(
  43     oop rtype = java_lang_invoke_MethodType::rtype(get_oop());
  44     never_null = (java_lang_Class::value_mirror(rtype) == rtype);
  45     return class_to_citype(rtype);
  46   )
  47 }
  48 
  49 int ciMethodType::ptype_count() const {
  50   GUARDED_VM_ENTRY(return java_lang_invoke_MethodType::ptype_count(get_oop());)
  51 }
  52 
  53 int ciMethodType::ptype_slot_count() const {
  54   GUARDED_VM_ENTRY(return java_lang_invoke_MethodType::ptype_slot_count(get_oop());)
  55 }
  56 
  57 ciType* ciMethodType::ptype_at(int index, bool& never_null) const {
  58   GUARDED_VM_ENTRY(
  59     oop ptype = java_lang_invoke_MethodType::ptype(get_oop(), index);
  60     never_null = (java_lang_Class::value_mirror(ptype) == ptype);
  61     return class_to_citype(ptype);
  62   )
  63 }
< prev index next >