1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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_RUNTIME_JAVACALLS_HPP
26 #define SHARE_VM_RUNTIME_JAVACALLS_HPP
27
28 #include "memory/allocation.hpp"
29 #include "oops/method.hpp"
30 #include "runtime/handles.hpp"
31 #include "runtime/javaFrameAnchor.hpp"
32 #include "runtime/thread.hpp"
33 #include "runtime/vmThread.hpp"
34 #ifdef TARGET_ARCH_x86
35 # include "jniTypes_x86.hpp"
36 #endif
37 #ifdef TARGET_ARCH_sparc
38 # include "jniTypes_sparc.hpp"
39 #endif
40 #ifdef TARGET_ARCH_zero
41 # include "jniTypes_zero.hpp"
42 #endif
43 #ifdef TARGET_ARCH_arm
44 # include "jniTypes_arm.hpp"
45 #endif
46 #ifdef TARGET_ARCH_ppc
47 # include "jniTypes_ppc.hpp"
48 #endif
49 #ifdef TARGET_ARCH_aarch64
50 # include "jniTypes_aarch64.hpp"
51 #endif
52
53 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
54 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
55 // Java fp/sp. A pointer to the JavaCallWrapper is stored on the stack.
56
57 class JavaCallWrapper: StackObj {
58 friend class VMStructs;
59 private:
60 JavaThread* _thread; // the thread to which this call belongs
61 JNIHandleBlock* _handles; // the saved handle block
62 Method* _callee_method; // to be able to collect arguments if entry frame is top frame
63 oop _receiver; // the receiver of the call (if a non-static call)
64
65 JavaFrameAnchor _anchor; // last thread anchor state that we must restore
66
67 JavaValue* _result; // result value
68
69 public:
70 // Construction/destruction
71 JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
|
1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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_RUNTIME_JAVACALLS_HPP
26 #define SHARE_VM_RUNTIME_JAVACALLS_HPP
27
28 #include "memory/allocation.hpp"
29 #include "oops/method.hpp"
30 #include "runtime/handles.hpp"
31 #include "runtime/javaFrameAnchor.hpp"
32 #include "runtime/thread.hpp"
33 #include "runtime/vmThread.hpp"
34 #include "utilities/macros.hpp"
35
36 #include CPU_HEADER(jniTypes)
37
38 // A JavaCallWrapper is constructed before each JavaCall and destructed after the call.
39 // Its purpose is to allocate/deallocate a new handle block and to save/restore the last
40 // Java fp/sp. A pointer to the JavaCallWrapper is stored on the stack.
41
42 class JavaCallWrapper: StackObj {
43 friend class VMStructs;
44 private:
45 JavaThread* _thread; // the thread to which this call belongs
46 JNIHandleBlock* _handles; // the saved handle block
47 Method* _callee_method; // to be able to collect arguments if entry frame is top frame
48 oop _receiver; // the receiver of the call (if a non-static call)
49
50 JavaFrameAnchor _anchor; // last thread anchor state that we must restore
51
52 JavaValue* _result; // result value
53
54 public:
55 // Construction/destruction
56 JavaCallWrapper(methodHandle callee_method, Handle receiver, JavaValue* result, TRAPS);
|