src/share/vm/prims/methodHandles.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7052219 Sdiff src/share/vm/prims

src/share/vm/prims/methodHandles.hpp

Print this page




 564   static int argument_slot_to_argnum(oop method_type, int argslot);
 565 
 566   // Runtime support
 567   enum {                        // bit-encoded flags from decode_method or decode_vmref
 568     _dmf_has_receiver   = 0x01, // target method has leading reference argument
 569     _dmf_does_dispatch  = 0x02, // method handle performs virtual or interface dispatch
 570     _dmf_from_interface = 0x04, // peforms interface dispatch
 571     _DMF_DIRECT_MASK    = (_dmf_from_interface*2 - _dmf_has_receiver),
 572     _dmf_binds_method   = 0x08,
 573     _dmf_binds_argument = 0x10,
 574     _DMF_BOUND_MASK     = (_dmf_binds_argument*2 - _dmf_binds_method),
 575     _dmf_adapter_lsb    = 0x20,
 576     _DMF_ADAPTER_MASK   = (_dmf_adapter_lsb << CONV_OP_LIMIT) - _dmf_adapter_lsb
 577   };
 578   static methodHandle decode_method(oop x, KlassHandle& receiver_limit_result, int& decode_flags_result);
 579   enum {
 580     // format of query to getConstant:
 581     GC_JVM_PUSH_LIMIT = 0,
 582     GC_JVM_STACK_MOVE_UNIT = 1,
 583     GC_CONV_OP_IMPLEMENTED_MASK = 2,

 584 
 585     // format of result from getTarget / encode_target:
 586     ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
 587     ETF_DIRECT_HANDLE         = 1, // ultimate method handle (will be a DMH, may be self)
 588     ETF_METHOD_NAME           = 2, // ultimate method as MemberName
 589     ETF_REFLECT_METHOD        = 3  // ultimate method as java.lang.reflect object (sans refClass)



 590   };
 591   static int get_named_constant(int which, Handle name_box, TRAPS);
 592   static oop encode_target(Handle mh, int format, TRAPS); // report vmtarget (to Java code)
 593   static bool class_cast_needed(klassOop src, klassOop dst);
 594 
 595   static instanceKlassHandle resolve_instance_klass(oop    java_mirror_oop, TRAPS);
 596   static instanceKlassHandle resolve_instance_klass(jclass java_mirror_jh,  TRAPS) {
 597     return resolve_instance_klass(JNIHandles::resolve(java_mirror_jh), THREAD);
 598   }
 599 
 600  private:
 601   // These checkers operate on a pair of whole MethodTypes:
 602   static const char* check_method_type_change(oop src_mtype, int src_beg, int src_end,
 603                                               int insert_argnum, oop insert_type,
 604                                               int change_argnum, oop change_type,
 605                                               int delete_argnum,
 606                                               oop dst_mtype, int dst_beg, int dst_end,
 607                                               bool raw = false);
 608   static const char* check_method_type_insertion(oop src_mtype,
 609                                                  int insert_argnum, oop insert_type,


 811     return (int)( offset_of(Data, _from_interpreted_entry) - sizeof(Data) );
 812   }
 813   static int type_checking_entry_offset_in_bytes() {
 814     return (int)( offset_of(Data, _from_interpreted_entry) - sizeof(Data) );
 815   }
 816 
 817   static address            start_compiled_entry(MacroAssembler* _masm,
 818                                                  address interpreted_entry = NULL);
 819   static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr);
 820 };
 821 
 822 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); }
 823 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); }
 824 
 825 
 826 //------------------------------------------------------------------------------
 827 // MethodHandlesAdapterGenerator
 828 //
 829 class MethodHandlesAdapterGenerator : public StubCodeGenerator {
 830 public:
 831   MethodHandlesAdapterGenerator(CodeBuffer* code) : StubCodeGenerator(code) {}
 832 
 833   void generate();
 834 };
 835 
 836 #endif // SHARE_VM_PRIMS_METHODHANDLES_HPP


 564   static int argument_slot_to_argnum(oop method_type, int argslot);
 565 
 566   // Runtime support
 567   enum {                        // bit-encoded flags from decode_method or decode_vmref
 568     _dmf_has_receiver   = 0x01, // target method has leading reference argument
 569     _dmf_does_dispatch  = 0x02, // method handle performs virtual or interface dispatch
 570     _dmf_from_interface = 0x04, // peforms interface dispatch
 571     _DMF_DIRECT_MASK    = (_dmf_from_interface*2 - _dmf_has_receiver),
 572     _dmf_binds_method   = 0x08,
 573     _dmf_binds_argument = 0x10,
 574     _DMF_BOUND_MASK     = (_dmf_binds_argument*2 - _dmf_binds_method),
 575     _dmf_adapter_lsb    = 0x20,
 576     _DMF_ADAPTER_MASK   = (_dmf_adapter_lsb << CONV_OP_LIMIT) - _dmf_adapter_lsb
 577   };
 578   static methodHandle decode_method(oop x, KlassHandle& receiver_limit_result, int& decode_flags_result);
 579   enum {
 580     // format of query to getConstant:
 581     GC_JVM_PUSH_LIMIT = 0,
 582     GC_JVM_STACK_MOVE_UNIT = 1,
 583     GC_CONV_OP_IMPLEMENTED_MASK = 2,
 584     GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3,
 585 
 586     // format of result from getTarget / encode_target:
 587     ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
 588     ETF_DIRECT_HANDLE         = 1, // ultimate method handle (will be a DMH, may be self)
 589     ETF_METHOD_NAME           = 2, // ultimate method as MemberName
 590     ETF_REFLECT_METHOD        = 3, // ultimate method as java.lang.reflect object (sans refClass)
 591 
 592     // ad hoc constants
 593     OP_ROT_ARGS_DOWN_LIMIT_BIAS = -1
 594   };
 595   static int get_named_constant(int which, Handle name_box, TRAPS);
 596   static oop encode_target(Handle mh, int format, TRAPS); // report vmtarget (to Java code)
 597   static bool class_cast_needed(klassOop src, klassOop dst);
 598 
 599   static instanceKlassHandle resolve_instance_klass(oop    java_mirror_oop, TRAPS);
 600   static instanceKlassHandle resolve_instance_klass(jclass java_mirror_jh,  TRAPS) {
 601     return resolve_instance_klass(JNIHandles::resolve(java_mirror_jh), THREAD);
 602   }
 603 
 604  private:
 605   // These checkers operate on a pair of whole MethodTypes:
 606   static const char* check_method_type_change(oop src_mtype, int src_beg, int src_end,
 607                                               int insert_argnum, oop insert_type,
 608                                               int change_argnum, oop change_type,
 609                                               int delete_argnum,
 610                                               oop dst_mtype, int dst_beg, int dst_end,
 611                                               bool raw = false);
 612   static const char* check_method_type_insertion(oop src_mtype,
 613                                                  int insert_argnum, oop insert_type,


 815     return (int)( offset_of(Data, _from_interpreted_entry) - sizeof(Data) );
 816   }
 817   static int type_checking_entry_offset_in_bytes() {
 818     return (int)( offset_of(Data, _from_interpreted_entry) - sizeof(Data) );
 819   }
 820 
 821   static address            start_compiled_entry(MacroAssembler* _masm,
 822                                                  address interpreted_entry = NULL);
 823   static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr);
 824 };
 825 
 826 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); }
 827 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); }
 828 
 829 
 830 //------------------------------------------------------------------------------
 831 // MethodHandlesAdapterGenerator
 832 //
 833 class MethodHandlesAdapterGenerator : public StubCodeGenerator {
 834 public:
 835   MethodHandlesAdapterGenerator(CodeBuffer* code) : StubCodeGenerator(code, PrintMethodHandleStubs) {}
 836 
 837   void generate();
 838 };
 839 
 840 #endif // SHARE_VM_PRIMS_METHODHANDLES_HPP
src/share/vm/prims/methodHandles.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File