src/hotspot/share/prims/methodHandles.hpp
changeset 53547 9d1a788dea3d
parent 53244 9807daeb47c4
equal deleted inserted replaced
53546:63eb7e38ce84 53547:9d1a788dea3d
    65                                    bool speculative_resolve, TRAPS); // compute vmtarget/vmindex from name/type
    65                                    bool speculative_resolve, TRAPS); // compute vmtarget/vmindex from name/type
    66   static void expand_MemberName(Handle mname, int suppress, TRAPS);  // expand defc/name/type if missing
    66   static void expand_MemberName(Handle mname, int suppress, TRAPS);  // expand defc/name/type if missing
    67   static oop init_MemberName(Handle mname_h, Handle target_h, TRAPS); // compute vmtarget/vmindex from target
    67   static oop init_MemberName(Handle mname_h, Handle target_h, TRAPS); // compute vmtarget/vmindex from target
    68   static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
    68   static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false);
    69   static oop init_method_MemberName(Handle mname_h, CallInfo& info);
    69   static oop init_method_MemberName(Handle mname_h, CallInfo& info);
    70   static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true);
       
    71   static int find_MemberNames(Klass* k, Symbol* name, Symbol* sig,
    70   static int find_MemberNames(Klass* k, Symbol* name, Symbol* sig,
    72                               int mflags, Klass* caller,
    71                               int mflags, Klass* caller,
    73                               int skip, objArrayHandle results, TRAPS);
    72                               int skip, objArrayHandle results, TRAPS);
    74   static Handle resolve_MemberName_type(Handle mname, Klass* caller, TRAPS);
    73   static Handle resolve_MemberName_type(Handle mname, Klass* caller, TRAPS);
    75 
    74 
   146   }
   145   }
   147   static bool is_signature_polymorphic_public_name(Klass* klass, Symbol* name);
   146   static bool is_signature_polymorphic_public_name(Klass* klass, Symbol* name);
   148 
   147 
   149   static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id);
   148   static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id);
   150 
   149 
   151   static int get_named_constant(int which, Handle name_box, TRAPS);
       
   152 
       
   153 public:
   150 public:
   154   static Symbol* lookup_signature(oop type_str, bool polymorphic, TRAPS);  // use TempNewSymbol
   151   static Symbol* lookup_signature(oop type_str, bool polymorphic, TRAPS);  // use TempNewSymbol
   155   static Symbol* lookup_basic_type_signature(Symbol* sig, bool keep_last_arg, TRAPS);  // use TempNewSymbol
   152   static Symbol* lookup_basic_type_signature(Symbol* sig, bool keep_last_arg, TRAPS);  // use TempNewSymbol
   156   static Symbol* lookup_basic_type_signature(Symbol* sig, TRAPS) {
   153   static Symbol* lookup_basic_type_signature(Symbol* sig, TRAPS) {
   157     return lookup_basic_type_signature(sig, false, THREAD);
   154     return lookup_basic_type_signature(sig, false, THREAD);
   158   }
   155   }
   159   static bool is_basic_type_signature(Symbol* sig);
   156   static bool is_basic_type_signature(Symbol* sig);
   160 
   157 
   161   static Symbol* lookup_method_type(Symbol* msig, Handle mtype, TRAPS);
       
   162 
       
   163   static void print_as_method_type_on(outputStream* st, Symbol* sig) {
       
   164     print_as_basic_type_signature_on(st, sig, true, true);
       
   165   }
       
   166   static void print_as_basic_type_signature_on(outputStream* st, Symbol* sig, bool keep_arrays = false, bool keep_basic_names = false);
   158   static void print_as_basic_type_signature_on(outputStream* st, Symbol* sig, bool keep_arrays = false, bool keep_basic_names = false);
   167 
   159 
   168   // decoding CONSTANT_MethodHandle constants
   160   // decoding CONSTANT_MethodHandle constants
   169   enum { JVM_REF_MIN = JVM_REF_getField, JVM_REF_MAX = JVM_REF_invokeInterface };
   161   enum { JVM_REF_MIN = JVM_REF_getField, JVM_REF_MAX = JVM_REF_invokeInterface };
   170   static bool ref_kind_is_valid(int ref_kind) {
   162   static bool ref_kind_is_valid(int ref_kind) {
   185     return !ref_kind_is_field(ref_kind) && (ref_kind != JVM_REF_newInvokeSpecial);
   177     return !ref_kind_is_field(ref_kind) && (ref_kind != JVM_REF_newInvokeSpecial);
   186   }
   178   }
   187   static bool ref_kind_has_receiver(int ref_kind) {
   179   static bool ref_kind_has_receiver(int ref_kind) {
   188     assert(ref_kind_is_valid(ref_kind), "");
   180     assert(ref_kind_is_valid(ref_kind), "");
   189     return (ref_kind & 1) != 0;
   181     return (ref_kind & 1) != 0;
   190   }
       
   191   static bool ref_kind_is_static(int ref_kind) {
       
   192     return !ref_kind_has_receiver(ref_kind) && (ref_kind != JVM_REF_newInvokeSpecial);
       
   193   }
       
   194   static bool ref_kind_does_dispatch(int ref_kind) {
       
   195     return (ref_kind == JVM_REF_invokeVirtual ||
       
   196             ref_kind == JVM_REF_invokeInterface);
       
   197   }
   182   }
   198 
   183 
   199   static int ref_kind_to_flags(int ref_kind);
   184   static int ref_kind_to_flags(int ref_kind);
   200 
   185 
   201 #include CPU_HEADER(methodHandles)
   186 #include CPU_HEADER(methodHandles)