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