1 /*
2 * Copyright (c) 2002, 2007, 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 class JavaThread;
26
27 //
28 // RegisterMap
29 //
30 // A companion structure used for stack traversal. The RegisterMap contains
31 // misc. information needed in order to do correct stack traversal of stack
32 // frames. Hence, it must always be passed in as an argument to
33 // frame::sender(RegisterMap*).
34 //
35 // In particular,
36 // 1) It provides access to the thread for which the stack belongs. The
37 // thread object is needed in order to get sender of a deoptimized frame.
38 //
39 // 2) It is used to pass information from a callee frame to its caller
40 // frame about how the frame should be traversed. This is used to let
41 // the caller frame take care of calling oops-do of out-going
42 // arguments, when the callee frame is not instantiated yet. This
43 // happens, e.g., when a compiled frame calls into
44 // resolve_virtual_call. (Hence, it is critical that the same
97 assert(0 <= index && index < location_valid_size, "range check");
98 assert(_update_map, "updating map that does not need updating");
99 _location[reg->value()] = (intptr_t*) loc;
100 _location_valid[index] |= ((LocationValidType)1 << (reg->value() % location_valid_type_size));
101 check_location_valid();
102 }
103
104 // Called by an entry frame.
105 void clear();
106
107 bool include_argument_oops() const { return _include_argument_oops; }
108 void set_include_argument_oops(bool f) { _include_argument_oops = f; }
109
110 JavaThread *thread() const { return _thread; }
111 bool update_map() const { return _update_map; }
112
113 void print_on(outputStream* st) const;
114 void print() const;
115
116 // the following contains the definition of pd_xxx methods
117 # include "incls/_registerMap_pd.hpp.incl"
118 };
|
1 /*
2 * Copyright (c) 2002, 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 #ifndef SHARE_VM_RUNTIME_REGISTERMAP_HPP
26 #define SHARE_VM_RUNTIME_REGISTERMAP_HPP
27
28 #include "code/vmreg.hpp"
29 #include "utilities/globalDefinitions.hpp"
30 #ifdef TARGET_ARCH_x86
31 # include "register_x86.hpp"
32 #endif
33 #ifdef TARGET_ARCH_sparc
34 # include "register_sparc.hpp"
35 #endif
36 #ifdef TARGET_ARCH_zero
37 # include "register_zero.hpp"
38 #endif
39
40 class JavaThread;
41
42 //
43 // RegisterMap
44 //
45 // A companion structure used for stack traversal. The RegisterMap contains
46 // misc. information needed in order to do correct stack traversal of stack
47 // frames. Hence, it must always be passed in as an argument to
48 // frame::sender(RegisterMap*).
49 //
50 // In particular,
51 // 1) It provides access to the thread for which the stack belongs. The
52 // thread object is needed in order to get sender of a deoptimized frame.
53 //
54 // 2) It is used to pass information from a callee frame to its caller
55 // frame about how the frame should be traversed. This is used to let
56 // the caller frame take care of calling oops-do of out-going
57 // arguments, when the callee frame is not instantiated yet. This
58 // happens, e.g., when a compiled frame calls into
59 // resolve_virtual_call. (Hence, it is critical that the same
112 assert(0 <= index && index < location_valid_size, "range check");
113 assert(_update_map, "updating map that does not need updating");
114 _location[reg->value()] = (intptr_t*) loc;
115 _location_valid[index] |= ((LocationValidType)1 << (reg->value() % location_valid_type_size));
116 check_location_valid();
117 }
118
119 // Called by an entry frame.
120 void clear();
121
122 bool include_argument_oops() const { return _include_argument_oops; }
123 void set_include_argument_oops(bool f) { _include_argument_oops = f; }
124
125 JavaThread *thread() const { return _thread; }
126 bool update_map() const { return _update_map; }
127
128 void print_on(outputStream* st) const;
129 void print() const;
130
131 // the following contains the definition of pd_xxx methods
132 #ifdef TARGET_ARCH_x86
133 # include "registerMap_x86.hpp"
134 #endif
135 #ifdef TARGET_ARCH_sparc
136 # include "registerMap_sparc.hpp"
137 #endif
138 #ifdef TARGET_ARCH_zero
139 # include "registerMap_zero.hpp"
140 #endif
141
142 };
143
144 #endif // SHARE_VM_RUNTIME_REGISTERMAP_HPP
|