equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
65 assert(probe != NULL, "valid probe"); |
65 assert(probe != NULL, "valid probe"); |
66 assert(probe->method != NULL, "valid method"); |
66 assert(probe->method != NULL, "valid method"); |
67 assert(probe->name != NULL, "valid probe name"); |
67 assert(probe->name != NULL, "valid probe name"); |
68 assert(probe->function != NULL, "valid probe function spec"); |
68 assert(probe->function != NULL, "valid probe function spec"); |
69 methodHandle h_method = |
69 methodHandle h_method = |
70 methodHandle(THREAD, JNIHandles::resolve_jmethod_id(probe->method)); |
70 methodHandle(THREAD, Method::resolve_jmethod_id(probe->method)); |
71 nmethod* nm = AdapterHandlerLibrary::create_dtrace_nmethod(h_method); |
71 nmethod* nm = AdapterHandlerLibrary::create_dtrace_nmethod(h_method); |
72 if (nm == NULL) { |
72 if (nm == NULL) { |
73 delete probes; |
73 delete probes; |
74 THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), |
74 THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), |
75 "Unable to register DTrace probes (CodeCache: no room for DTrace nmethods)."); |
75 "Unable to register DTrace probes (CodeCache: no room for DTrace nmethods)."); |
90 probes->set_helper_handle(handle); |
90 probes->set_helper_handle(handle); |
91 return RegisteredProbes::toOpaqueProbes(probes); |
91 return RegisteredProbes::toOpaqueProbes(probes); |
92 } |
92 } |
93 |
93 |
94 jboolean DTraceJSDT::is_probe_enabled(jmethodID method) { |
94 jboolean DTraceJSDT::is_probe_enabled(jmethodID method) { |
95 methodOop m = JNIHandles::resolve_jmethod_id(method); |
95 Method* m = Method::resolve_jmethod_id(method); |
96 return nativeInstruction_at(m->code()->trap_address())->is_dtrace_trap(); |
96 return nativeInstruction_at(m->code()->trap_address())->is_dtrace_trap(); |
97 } |
97 } |
98 |
98 |
99 void DTraceJSDT::dispose(OpaqueProbes probes) { |
99 void DTraceJSDT::dispose(OpaqueProbes probes) { |
100 RegisteredProbes* p = RegisteredProbes::toRegisteredProbes(probes); |
100 RegisteredProbes* p = RegisteredProbes::toRegisteredProbes(probes); |