src/share/vm/prims/methodHandles.hpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 









  25 class MacroAssembler;
  26 class Label;
  27 class MethodHandleEntry;
  28 
  29 class MethodHandles: AllStatic {
  30   // JVM support for MethodHandle, MethodType, and related types
  31   // in java.dyn and java.dyn.hotspot.
  32   // See also  javaClasses for layouts java_dyn_Method{Handle,Type,Type::Form}.
  33  public:
  34   enum EntryKind {
  35     _raise_exception,           // stub for error generation from other stubs
  36     _invokestatic_mh,           // how a MH emulates invokestatic
  37     _invokespecial_mh,          // ditto for the other invokes...
  38     _invokevirtual_mh,
  39     _invokeinterface_mh,
  40     _bound_ref_mh,              // reference argument is bound
  41     _bound_int_mh,              // int argument is bound (via an Integer or Float)
  42     _bound_long_mh,             // long argument is bound (via a Long or Double)
  43     _bound_ref_direct_mh,       // same as above, with direct linkage to methodOop
  44     _bound_int_direct_mh,


 497   }
 498 
 499   static address            start_compiled_entry(MacroAssembler* _masm,
 500                                                  address interpreted_entry = NULL);
 501   static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr);
 502 };
 503 
 504 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); }
 505 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); }
 506 
 507 
 508 //------------------------------------------------------------------------------
 509 // MethodHandlesAdapterGenerator
 510 //
 511 class MethodHandlesAdapterGenerator : public StubCodeGenerator {
 512 public:
 513   MethodHandlesAdapterGenerator(CodeBuffer* code) : StubCodeGenerator(code) {}
 514 
 515   void generate();
 516 };




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_PRIMS_METHODHANDLES_HPP
  26 #define SHARE_VM_PRIMS_METHODHANDLES_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/vmSymbols.hpp"
  30 #include "runtime/frame.inline.hpp"
  31 #include "runtime/globals.hpp"
  32 #include "runtime/interfaceSupport.hpp"
  33 
  34 class MacroAssembler;
  35 class Label;
  36 class MethodHandleEntry;
  37 
  38 class MethodHandles: AllStatic {
  39   // JVM support for MethodHandle, MethodType, and related types
  40   // in java.dyn and java.dyn.hotspot.
  41   // See also  javaClasses for layouts java_dyn_Method{Handle,Type,Type::Form}.
  42  public:
  43   enum EntryKind {
  44     _raise_exception,           // stub for error generation from other stubs
  45     _invokestatic_mh,           // how a MH emulates invokestatic
  46     _invokespecial_mh,          // ditto for the other invokes...
  47     _invokevirtual_mh,
  48     _invokeinterface_mh,
  49     _bound_ref_mh,              // reference argument is bound
  50     _bound_int_mh,              // int argument is bound (via an Integer or Float)
  51     _bound_long_mh,             // long argument is bound (via a Long or Double)
  52     _bound_ref_direct_mh,       // same as above, with direct linkage to methodOop
  53     _bound_int_direct_mh,


 506   }
 507 
 508   static address            start_compiled_entry(MacroAssembler* _masm,
 509                                                  address interpreted_entry = NULL);
 510   static MethodHandleEntry* finish_compiled_entry(MacroAssembler* masm, address start_addr);
 511 };
 512 
 513 address MethodHandles::from_compiled_entry(EntryKind ek) { return entry(ek)->from_compiled_entry(); }
 514 address MethodHandles::from_interpreted_entry(EntryKind ek) { return entry(ek)->from_interpreted_entry(); }
 515 
 516 
 517 //------------------------------------------------------------------------------
 518 // MethodHandlesAdapterGenerator
 519 //
 520 class MethodHandlesAdapterGenerator : public StubCodeGenerator {
 521 public:
 522   MethodHandlesAdapterGenerator(CodeBuffer* code) : StubCodeGenerator(code) {}
 523 
 524   void generate();
 525 };
 526 
 527 #endif // SHARE_VM_PRIMS_METHODHANDLES_HPP