/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_RUNTIME_REGISTERMAP_HPP
#define SHARE_VM_RUNTIME_REGISTERMAP_HPP
#include "utilities/globalDefinitions.hpp"
#ifdef TARGET_ARCH_x86
# include "register_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "register_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "register_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "register_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "register_ppc.hpp"
#endif
class JavaThread;
//
// RegisterMap
//
// A companion structure used for stack traversal. The RegisterMap contains
// misc. information needed in order to do correct stack traversal of stack
// frames. Hence, it must always be passed in as an argument to
// frame::sender(RegisterMap*).
//
// In particular,
// 1) It provides access to the thread for which the stack belongs. The
// thread object is needed in order to get sender of a deoptimized frame.
//
// 2) It is used to pass information from a callee frame to its caller
// frame about how the frame should be traversed. This is used to let
// the caller frame take care of calling oops-do of out-going
// arguments, when the callee frame is not instantiated yet. This
// happens, e.g., when a compiled frame calls into
// resolve_virtual_call. (Hence, it is critical that the same
// RegisterMap object is used for the entire stack walk. Normally,
// this is hidden by using the StackFrameStream.) This is used when
// doing follow_oops and oops_do.
//
// 3) The RegisterMap keeps track of the values of callee-saved registers
// from frame to frame (hence, the name). For some stack traversal the
// values of the callee-saved registers does not matter, e.g., if you
// only need the static properies such as frame type, pc, and such.
// Updating of the RegisterMap can be turned off by instantiating the
// register map as: RegisterMap map(thread, false);
public:
enum {
};
private:
intptr_t* _location[reg_count]; // Location of registers (intptr_t* looks better than address in the debugger)
// updated when traversing the stack
#ifdef ASSERT
void check_location_valid();
#else
void check_location_valid() {}
#endif
public:
debug_only(intptr_t* _update_for_id;) // Assert that RegisterMap is not updated twice for same frame
} else {
return pd_location(reg);
}
}
}
// Called by an entry frame.
void clear();
void print() const;
// the following contains the definition of pd_xxx methods
#ifdef TARGET_ARCH_x86
# include "registerMap_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "registerMap_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "registerMap_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "registerMap_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "registerMap_ppc.hpp"
#endif
};
#endif // SHARE_VM_RUNTIME_REGISTERMAP_HPP