7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/barrierSet.inline.hpp"
26 #include "gc/shared/cardTable.hpp"
27 #include "gc/shared/cardTableModRefBS.inline.hpp"
28 #include "gc/shared/collectedHeap.hpp"
29 #include "memory/metaspaceShared.hpp"
30 #include "runtime/frame.inline.hpp"
31
32 void JavaThread::cache_global_variables() {
33 BarrierSet* bs = Universe::heap()->barrier_set();
34
35 const bool allow_shared_alloc =
36 Universe::heap()->supports_inline_contig_alloc();
37
38 if (allow_shared_alloc) {
39 _heap_top_addr = (address) Universe::heap()->top_addr();
40 } else {
41 _heap_top_addr = NULL;
42 }
43
44 if (bs->is_a(BarrierSet::CardTableModRef)) {
45 _card_table_base = (address) (barrier_set_cast<CardTableModRefBS>(bs)->card_table()->byte_map_base());
46 } else {
47 _card_table_base = NULL;
48 }
49
50 }
51
52 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
53 // currently interrupted by SIGPROF
54 bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
55 void* ucontext, bool isInJava) {
56 assert(Thread::current() == this, "caller must be current thread");
57 return pd_get_top_frame(fr_addr, ucontext, isInJava);
58 }
59
60 bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
61 return pd_get_top_frame(fr_addr, ucontext, isInJava);
62 }
63
64 bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) {
|
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/barrierSet.inline.hpp"
26 #include "gc/shared/cardTable.hpp"
27 #include "gc/shared/cardTableBarrierSet.inline.hpp"
28 #include "gc/shared/collectedHeap.hpp"
29 #include "memory/metaspaceShared.hpp"
30 #include "runtime/frame.inline.hpp"
31
32 void JavaThread::cache_global_variables() {
33 BarrierSet* bs = Universe::heap()->barrier_set();
34
35 const bool allow_shared_alloc =
36 Universe::heap()->supports_inline_contig_alloc();
37
38 if (allow_shared_alloc) {
39 _heap_top_addr = (address) Universe::heap()->top_addr();
40 } else {
41 _heap_top_addr = NULL;
42 }
43
44 if (bs->is_a(BarrierSet::CardTableBarrierSet)) {
45 _card_table_base = (address) (barrier_set_cast<CardTableBarrierSet>(bs)->card_table()->byte_map_base());
46 } else {
47 _card_table_base = NULL;
48 }
49
50 }
51
52 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
53 // currently interrupted by SIGPROF
54 bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,
55 void* ucontext, bool isInJava) {
56 assert(Thread::current() == this, "caller must be current thread");
57 return pd_get_top_frame(fr_addr, ucontext, isInJava);
58 }
59
60 bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
61 return pd_get_top_frame(fr_addr, ucontext, isInJava);
62 }
63
64 bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) {
|