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 "asm/macroAssembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterGenerator.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "interpreter/interp_masm.hpp" 32 #include "interpreter/templateTable.hpp" 33 #include "oops/arrayOop.hpp" 34 #include "oops/methodData.hpp" 35 #include "oops/method.hpp" 36 #include "oops/oop.inline.hpp" 37 #include "prims/jvmtiExport.hpp" 38 #include "prims/jvmtiThreadState.hpp" 39 #include "prims/methodHandles.hpp" 40 #include "runtime/arguments.hpp" 41 #include "runtime/frame.inline.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "runtime/stubRoutines.hpp" 44 #include "runtime/synchronizer.hpp" 45 #include "runtime/timer.hpp" 46 #include "runtime/vframeArray.hpp" 47 #include "utilities/debug.hpp" 48 #ifdef COMPILER1 49 #include "c1/c1_Runtime1.hpp" 50 #endif 51 52 #define __ _masm-> 53 54 //------------------------------------------------------------------------------------------------------------------------ 55 56 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 57 address entry = __ pc(); 58 // rbx,: method 59 // rcx: temporary 60 // rdi: pointer to locals 61 // rsp: end of copied parameters area 62 __ mov(rcx, rsp); 63 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); 64 __ ret(0); 65 return entry; 66 } 67 68 69 address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { 70 71 // rbx,: Method* 72 // rcx: scratrch 73 // rsi: sender sp 74 75 if (!InlineIntrinsics) return NULL; // Generate a vanilla entry 76 77 address entry_point = __ pc(); 78 79 // These don't need a safepoint check because they aren't virtually 80 // callable. We won't enter these intrinsics from compiled code. 81 // If in the future we added an intrinsic which was virtually callable 82 // we'd have to worry about how to safepoint so that this code is used. 83 84 // mathematical functions inlined by compiler 85 // (interpreter must provide identical implementation 86 // in order to avoid monotonicity bugs when switching 87 // from interpreter to compiler in the middle of some 88 // computation) 89 // | 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 "asm/macroAssembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterRuntime.hpp" 30 #include "interpreter/interp_masm.hpp" 31 #include "interpreter/templateInterpreterGenerator.hpp" 32 #include "interpreter/templateTable.hpp" 33 #include "oops/arrayOop.hpp" 34 #include "oops/methodData.hpp" 35 #include "oops/method.hpp" 36 #include "oops/oop.inline.hpp" 37 #include "prims/jvmtiExport.hpp" 38 #include "prims/jvmtiThreadState.hpp" 39 #include "prims/methodHandles.hpp" 40 #include "runtime/arguments.hpp" 41 #include "runtime/frame.inline.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "runtime/stubRoutines.hpp" 44 #include "runtime/synchronizer.hpp" 45 #include "runtime/timer.hpp" 46 #include "runtime/vframeArray.hpp" 47 #include "utilities/debug.hpp" 48 #ifdef COMPILER1 49 #include "c1/c1_Runtime1.hpp" 50 #endif 51 52 #define __ _masm-> 53 54 //------------------------------------------------------------------------------------------------------------------------ 55 56 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 57 address entry = __ pc(); 58 // rbx,: method 59 // rcx: temporary 60 // rdi: pointer to locals 61 // rsp: end of copied parameters area 62 __ mov(rcx, rsp); 63 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); 64 __ ret(0); 65 return entry; 66 } 67 68 69 address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { 70 71 // rbx,: Method* 72 // rcx: scratrch 73 // rsi: sender sp 74 75 if (!InlineIntrinsics) return NULL; // Generate a vanilla entry 76 77 address entry_point = __ pc(); 78 79 // These don't need a safepoint check because they aren't virtually 80 // callable. We won't enter these intrinsics from compiled code. 81 // If in the future we added an intrinsic which was virtually callable 82 // we'd have to worry about how to safepoint so that this code is used. 83 84 // mathematical functions inlined by compiler 85 // (interpreter must provide identical implementation 86 // in order to avoid monotonicity bugs when switching 87 // from interpreter to compiler in the middle of some 88 // computation) 89 // |