src/share/vm/prims/methodHandleWalk.cpp

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 /*
  26  * JSR 292 reference implementation: method handle structure analysis
  27  */
  28 
  29 #include "incls/_precompiled.incl"
  30 #include "incls/_methodHandleWalk.cpp.incl"
  31 
  32 
  33 // -----------------------------------------------------------------------------
  34 // MethodHandleChain
  35 
  36 void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
  37   if (!java_dyn_MethodHandle::is_instance(mh()))  lose("bad method handle", CHECK);
  38 
  39   // set current method handle and unpack partially
  40   _method_handle = mh;
  41   _is_last       = false;
  42   _is_bound      = false;
  43   _arg_slot      = -1;
  44   _arg_type      = T_VOID;
  45   _conversion    = -1;
  46   _last_invoke   = Bytecodes::_nop;  //arbitrary non-garbage
  47 
  48   if (sun_dyn_DirectMethodHandle::is_instance(mh())) {
  49     set_last_method(mh(), THREAD);
  50     return;
  51   }




   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 #include "precompiled.hpp"
  26 #include "interpreter/rewriter.hpp"
  27 #include "memory/oopFactory.hpp"
  28 #include "prims/methodHandleWalk.hpp"
  29 
  30 /*
  31  * JSR 292 reference implementation: method handle structure analysis
  32  */
  33 



  34 
  35 // -----------------------------------------------------------------------------
  36 // MethodHandleChain
  37 
  38 void MethodHandleChain::set_method_handle(Handle mh, TRAPS) {
  39   if (!java_dyn_MethodHandle::is_instance(mh()))  lose("bad method handle", CHECK);
  40 
  41   // set current method handle and unpack partially
  42   _method_handle = mh;
  43   _is_last       = false;
  44   _is_bound      = false;
  45   _arg_slot      = -1;
  46   _arg_type      = T_VOID;
  47   _conversion    = -1;
  48   _last_invoke   = Bytecodes::_nop;  //arbitrary non-garbage
  49 
  50   if (sun_dyn_DirectMethodHandle::is_instance(mh())) {
  51     set_last_method(mh(), THREAD);
  52     return;
  53   }