1472N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Forward Declarations 0N/A/////////////////////////////////////////////////////////////// 0N/A// class JvmtiEnvThreadStateIterator 0N/A// The only safe means of iterating through the JvmtiEnvThreadStates 0N/A// in a JvmtiThreadState. 0N/A// Note that this iteratation includes invalid environments pending 0N/A// deallocation -- in fact, some uses depend on this behavior. 0N/A/////////////////////////////////////////////////////////////// 0N/A// class JvmtiThreadState 0N/A// The Jvmti state for each thread (across all JvmtiEnv): 0N/A// 1. Local table of enabled events. 0N/A // info to the class file load hook event handler. 0N/A // This is only valid when is_interp_only_mode() returns true 0N/A // for support of JvmtiEnvThreadState 0N/A // doubly-linked linear list of active thread state 0N/A // needed in order to iterate the list without holding Threads_lock 0N/A // holds the current dynamic code event collector, NULL if no event collector in use 0N/A // holds the current vm object alloc event collector, NULL if no event collector in use 0N/A // Should only be created by factory methods 0N/A // is event_type enabled and usable for this thread in any enviroments? 0N/A // Must only be called in situations where the state is for the current thread and 0N/A // the environment can not go away. To be safe, the returned JvmtiEnvThreadState 0N/A // must be used in such a way as there can be no intervening safepoints. 0N/A // Used by the interpreter for fullspeed debugging support 0N/A // access to the linked list of all JVMTI thread states 0N/A // Current stack depth is only valid when is_interp_only_mode() returns true. 0N/A // These functions should only be called at a safepoint - usually called from same thread. 0N/A // Returns the number of Java activations on the stack. 0N/A // Step pending flag is set when PopFrame is called and it is cleared 0N/A // when step for the Pop Frame is completed. 0N/A // This logic is used to distinguish b/w step for pop frame and repeat step. 0N/A // Step pending flag is set when ForceEarlyReturn is called and it is cleared 0N/A // when step for the ForceEarlyReturn is completed. 0N/A // This logic is used to distinguish b/w step for early return and repeat step. 0N/A // Setter and getter method is used to send redefined class info 0N/A // when class file load hook event is posted. 0N/A // It is set while loading redefined class and cleared before the 0N/A // class file load hook event is posted. 0N/A // RedefineClasses support 0N/A // The bug 6214132 caused the verification to fail. 0N/A // Below is the detailed description of the fix approach taken: 0N/A // 1. What's done in RedefineClasses() before verification: 0N/A // a) A reference to the class being redefined (_the_class) and a 0N/A // reference to new version of the class (_scratch_class) are 0N/A // saved here for use during the bytecode verification phase of 0N/A // RedefineClasses. See RedefineVerifyMark for how these fields 0N/A // b) The _java_mirror field from _the_class is copied to the 0N/A // _java_mirror field in _scratch_class. This means that a jclass 0N/A // returned for _the_class or _scratch_class will refer to the 0N/A // same Java mirror. The verifier will see the "one true mirror" 0N/A // for the class being verified. 0N/A // 2. What is done at verification: 0N/A // When the verifier makes calls into the VM to ask questions about 0N/A // the class being verified, it will pass the jclass to JVM_* functions. 0N/A // The jclass is always pointing to the mirror of _the_class. 0N/A // ~28 JVM_* functions called by the verifier for the information 0N/A // about CP entries and klass structure should check the jvmtiThreadState 0N/A // info about equivalent klass versions and use it to replace a klassOop 0N/A // of _the_class with a klassOop of _scratch_class. The function 0N/A // class_to_verify_considering_redefinition() must be called for it. 0N/A // Note again, that this redirection happens only for the verifier thread. 0N/A // Other threads have very small overhead by checking the existence 0N/A // of the jvmtiThreadSate and the information about klasses equivalence. 0N/A // No JNI functions need to be changed, they don't reference the klass guts. 0N/A // The JavaThread pointer is already available in all JVM_* functions 0N/A // used by the verifier, so there is no extra performance issue with it. 0N/A // Todo: get rid of this! 0N/A // Should the thread be enumerated by jvmtiInternal::GetAllThreads? 0N/A // If a thread cannot be suspended (has no valid last_java_frame) then it gets marked !debuggable 0N/A // Thread local event collector setter and getter methods. 0N/A // true when the thread was suspended with a pointer to the last Java frame. 0N/A // already holding JvmtiThreadState_lock - retrieve or create JvmtiThreadState 609N/A // Can return NULL if JavaThread is exiting. 608N/A // don't add a JvmtiThreadState to a thread that is exiting 0N/A // retrieve or create JvmtiThreadState 609N/A // Can return NULL if JavaThread is exiting. 0N/A // check again with the lock held 0N/A // JVMTI ForceEarlyReturn support 0N/A // This is set to earlyret_pending to signal that top Java frame 0N/A // should be returned immediately 0N/A // ForceEarlyReturnObject, GC-preserved 0N/A // Setting and clearing earlyret_state 0N/A // earlyret_pending indicates that a ForceEarlyReturn() has been 0N/A // requested and not yet been completed. 1879N/A#
endif // SHARE_VM_PRIMS_JVMTITHREADSTATE_HPP