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 "ci/ciSymbols.hpp"
26 #include "compiler/compileLog.hpp"
27 #include "oops/objArrayKlass.hpp"
28 #include "opto/addnode.hpp"
29 #include "opto/memnode.hpp"
30 #include "opto/mulnode.hpp"
31 #include "opto/parse.hpp"
32 #include "opto/rootnode.hpp"
33 #include "opto/runtime.hpp"
34 #include "runtime/sharedRuntime.hpp"
35
36 //------------------------------make_dtrace_method_entry_exit ----------------
37 // Dtrace -- record entry or exit of a method if compiled with dtrace support
38 void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) {
39 const TypeFunc *call_type = OptoRuntime::dtrace_method_entry_exit_Type();
40 address call_address = is_entry ? CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry) :
41 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit);
42 const char *call_name = is_entry ? "dtrace_method_entry" : "dtrace_method_exit";
43
44 // Get base of thread-local storage area
45 Node* thread = _gvn.transform( new ThreadLocalNode() );
46
47 // Get method
48 const TypePtr* method_type = TypeMetadataPtr::make(method);
49 Node *method_node = _gvn.transform(ConNode::make(method_type));
50
51 kill_dead_locals();
52
53 // For some reason, this call reads only raw memory.
54 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
55 make_runtime_call(RC_LEAF | RC_NARROW_MEM,
|
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 "ci/ciSymbols.hpp"
26 #include "compiler/compileLog.hpp"
27 #include "oops/objArrayKlass.hpp"
28 #include "opto/addnode.hpp"
29 #include "opto/memnode.hpp"
30 #include "opto/mulnode.hpp"
31 #include "opto/parse.hpp"
32 #include "opto/rootnode.hpp"
33 #include "opto/runtime.hpp"
34 #include "runtime/runtimeUpcalls.hpp"
35 #include "runtime/sharedRuntime.hpp"
36
37 void GraphKit::install_on_method_entry_runtime_upcalls(ciMethod* method) {
38 MethodDetails method_details(method);
39 RuntimeUpcallInfo* upcall = RuntimeUpcalls::get_first_upcall(RuntimeUpcallType::onMethodEntry, method_details);
40 while (upcall != nullptr) {
41 // Get base of thread-local storage area
42 Node* thread = _gvn.transform( new ThreadLocalNode() );
43 kill_dead_locals();
44
45 // For some reason, this call reads only raw memory.
46 const TypeFunc *call_type = OptoRuntime::runtime_up_call_Type();
47 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
48 make_runtime_call(RC_LEAF | RC_NARROW_MEM,
49 call_type, upcall->upcall_address(),
50 upcall->upcall_name(), raw_adr_type,
51 thread);
52
53 upcall = RuntimeUpcalls::get_next_upcall(RuntimeUpcallType::onMethodEntry, method_details, upcall);
54 }
55 }
56
57 //------------------------------make_dtrace_method_entry_exit ----------------
58 // Dtrace -- record entry or exit of a method if compiled with dtrace support
59 void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) {
60 const TypeFunc *call_type = OptoRuntime::dtrace_method_entry_exit_Type();
61 address call_address = is_entry ? CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry) :
62 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit);
63 const char *call_name = is_entry ? "dtrace_method_entry" : "dtrace_method_exit";
64
65 // Get base of thread-local storage area
66 Node* thread = _gvn.transform( new ThreadLocalNode() );
67
68 // Get method
69 const TypePtr* method_type = TypeMetadataPtr::make(method);
70 Node *method_node = _gvn.transform(ConNode::make(method_type));
71
72 kill_dead_locals();
73
74 // For some reason, this call reads only raw memory.
75 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
76 make_runtime_call(RC_LEAF | RC_NARROW_MEM,
|