1 /* 2 * Copyright (c) 2003, 2006, 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 # include "incls/_precompiled.incl" 26 # include "incls/_jvmtiThreadState.cpp.incl" 27 28 // marker for when the stack depth has been reset and is now unknown. 29 // any negative number would work but small ones might obscure an 30 // underrun error. 31 static const int UNKNOWN_STACK_DEPTH = -99; 32 33 /////////////////////////////////////////////////////////////// 34 // 35 // class JvmtiThreadState 36 // 37 // Instances of JvmtiThreadState hang off of each thread. 38 // Thread local storage for JVMTI. 39 // 40 41 JvmtiThreadState *JvmtiThreadState::_head = NULL; 42 43 JvmtiThreadState::JvmtiThreadState(JavaThread* thread) 44 : _thread_event_enable() { 45 assert(JvmtiThreadState_lock->is_locked(), "sanity check"); 46 _thread = thread; | 1 /* 2 * Copyright (c) 2003, 2010, 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 #include "precompiled.hpp" 26 #include "jvmtifiles/jvmtiEnv.hpp" 27 #include "memory/gcLocker.hpp" 28 #include "memory/resourceArea.hpp" 29 #include "prims/jvmtiEventController.inline.hpp" 30 #include "prims/jvmtiImpl.hpp" 31 #include "prims/jvmtiThreadState.inline.hpp" 32 #include "runtime/vframe.hpp" 33 34 // marker for when the stack depth has been reset and is now unknown. 35 // any negative number would work but small ones might obscure an 36 // underrun error. 37 static const int UNKNOWN_STACK_DEPTH = -99; 38 39 /////////////////////////////////////////////////////////////// 40 // 41 // class JvmtiThreadState 42 // 43 // Instances of JvmtiThreadState hang off of each thread. 44 // Thread local storage for JVMTI. 45 // 46 47 JvmtiThreadState *JvmtiThreadState::_head = NULL; 48 49 JvmtiThreadState::JvmtiThreadState(JavaThread* thread) 50 : _thread_event_enable() { 51 assert(JvmtiThreadState_lock->is_locked(), "sanity check"); 52 _thread = thread; |