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 handles 27 */ 28 29 #include "incls/_precompiled.incl" 30 #include "incls/_methodHandles.cpp.incl" 31 32 bool MethodHandles::_enabled = false; // set true after successful native linkage 33 34 MethodHandleEntry* MethodHandles::_entries[MethodHandles::_EK_LIMIT] = {NULL}; 35 const char* MethodHandles::_entry_names[_EK_LIMIT+1] = { 36 "raise_exception", 37 "invokestatic", // how a MH emulates invokestatic 38 "invokespecial", // ditto for the other invokes... 39 "invokevirtual", 40 "invokeinterface", 41 "bound_ref", // these are for BMH... 42 "bound_int", 43 "bound_long", 44 "bound_ref_direct", // (direct versions have a direct methodOop) 45 "bound_int_direct", 46 "bound_long_direct", 47 48 // starting at _adapter_mh_first: 49 "adapter_retype_only", // these are for AMH... 50 "adapter_retype_raw", 51 "adapter_check_cast", | 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 "classfile/symbolTable.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "memory/allocation.inline.hpp" 29 #include "memory/oopFactory.hpp" 30 #include "prims/methodHandles.hpp" 31 #include "runtime/javaCalls.hpp" 32 #include "runtime/reflection.hpp" 33 #include "runtime/signature.hpp" 34 #include "runtime/stubRoutines.hpp" 35 36 /* 37 * JSR 292 reference implementation: method handles 38 */ 39 40 bool MethodHandles::_enabled = false; // set true after successful native linkage 41 42 MethodHandleEntry* MethodHandles::_entries[MethodHandles::_EK_LIMIT] = {NULL}; 43 const char* MethodHandles::_entry_names[_EK_LIMIT+1] = { 44 "raise_exception", 45 "invokestatic", // how a MH emulates invokestatic 46 "invokespecial", // ditto for the other invokes... 47 "invokevirtual", 48 "invokeinterface", 49 "bound_ref", // these are for BMH... 50 "bound_int", 51 "bound_long", 52 "bound_ref_direct", // (direct versions have a direct methodOop) 53 "bound_int_direct", 54 "bound_long_direct", 55 56 // starting at _adapter_mh_first: 57 "adapter_retype_only", // these are for AMH... 58 "adapter_retype_raw", 59 "adapter_check_cast", |