14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef CPU_PPC_VM_NATIVEINST_PPC_HPP
27 #define CPU_PPC_VM_NATIVEINST_PPC_HPP
28
29 #include "asm/assembler.hpp"
30 #include "asm/macroAssembler.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/icache.hpp"
33 #include "runtime/os.hpp"
34
35 // We have interfaces for the following instructions:
36 //
37 // - NativeInstruction
38 // - NativeCall
39 // - NativeFarCall
40 // - NativeMovConstReg
41 // - NativeJump
42 // - NativeIllegalInstruction
43 // - NativeConditionalFarBranch
44 // - NativeCallTrampolineStub
45
46 // The base class for different kinds of native instruction abstractions.
47 // It provides the primitive operations to manipulate code relative to this.
48 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
49 friend class Relocation;
50
51 public:
52 bool is_jump() { return Assembler::is_b(long_at(0)); } // See NativeGeneralJump.
53
76 return NativeInstruction::is_sigill_zombie_not_entrant_at(addr_at(0));
77 }
78 static bool is_sigill_zombie_not_entrant_at(address addr);
79
80 #ifdef COMPILER2
81 // SIGTRAP-based implicit range checks
82 bool is_sigtrap_range_check() {
83 assert(UseSIGTRAP && TrapBasedRangeChecks, "precondition");
84 return MacroAssembler::is_trap_range_check(long_at(0));
85 }
86 #endif
87
88 // 'should not reach here'.
89 bool is_sigtrap_should_not_reach_here() {
90 return MacroAssembler::is_trap_should_not_reach_here(long_at(0));
91 }
92
93 bool is_safepoint_poll() {
94 // Is the current instruction a POTENTIAL read access to the polling page?
95 // The current arguments of the instruction are not checked!
96 return MacroAssembler::is_load_from_polling_page(long_at(0), NULL);
97 }
98
99 bool is_memory_serialization(JavaThread *thread, void *ucontext) {
100 // Is the current instruction a write access of thread to the
101 // memory serialization page?
102 return MacroAssembler::is_memory_serialization(long_at(0), thread, ucontext);
103 }
104
105 address get_stack_bang_address(void *ucontext) {
106 // If long_at(0) is not a stack bang, return 0. Otherwise, return
107 // banged address.
108 return MacroAssembler::get_stack_bang_address(long_at(0), ucontext);
109 }
110
111 protected:
112 address addr_at(int offset) const { return address(this) + offset; }
113 int long_at(int offset) const { return *(int*)addr_at(offset); }
114
115 public:
|
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef CPU_PPC_VM_NATIVEINST_PPC_HPP
27 #define CPU_PPC_VM_NATIVEINST_PPC_HPP
28
29 #include "asm/assembler.hpp"
30 #include "asm/macroAssembler.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/icache.hpp"
33 #include "runtime/os.hpp"
34 #include "runtime/safepointMechanism.hpp"
35
36 // We have interfaces for the following instructions:
37 //
38 // - NativeInstruction
39 // - NativeCall
40 // - NativeFarCall
41 // - NativeMovConstReg
42 // - NativeJump
43 // - NativeIllegalInstruction
44 // - NativeConditionalFarBranch
45 // - NativeCallTrampolineStub
46
47 // The base class for different kinds of native instruction abstractions.
48 // It provides the primitive operations to manipulate code relative to this.
49 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
50 friend class Relocation;
51
52 public:
53 bool is_jump() { return Assembler::is_b(long_at(0)); } // See NativeGeneralJump.
54
77 return NativeInstruction::is_sigill_zombie_not_entrant_at(addr_at(0));
78 }
79 static bool is_sigill_zombie_not_entrant_at(address addr);
80
81 #ifdef COMPILER2
82 // SIGTRAP-based implicit range checks
83 bool is_sigtrap_range_check() {
84 assert(UseSIGTRAP && TrapBasedRangeChecks, "precondition");
85 return MacroAssembler::is_trap_range_check(long_at(0));
86 }
87 #endif
88
89 // 'should not reach here'.
90 bool is_sigtrap_should_not_reach_here() {
91 return MacroAssembler::is_trap_should_not_reach_here(long_at(0));
92 }
93
94 bool is_safepoint_poll() {
95 // Is the current instruction a POTENTIAL read access to the polling page?
96 // The current arguments of the instruction are not checked!
97 if (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) {
98 int encoding = SafepointMechanism::poll_bit();
99 return MacroAssembler::is_tdi(long_at(0), Assembler::traptoGreaterThanUnsigned | Assembler::traptoEqual,
100 -1, encoding);
101 }
102 return MacroAssembler::is_load_from_polling_page(long_at(0), NULL);
103 }
104
105 bool is_memory_serialization(JavaThread *thread, void *ucontext) {
106 // Is the current instruction a write access of thread to the
107 // memory serialization page?
108 return MacroAssembler::is_memory_serialization(long_at(0), thread, ucontext);
109 }
110
111 address get_stack_bang_address(void *ucontext) {
112 // If long_at(0) is not a stack bang, return 0. Otherwise, return
113 // banged address.
114 return MacroAssembler::get_stack_bang_address(long_at(0), ucontext);
115 }
116
117 protected:
118 address addr_at(int offset) const { return address(this) + offset; }
119 int long_at(int offset) const { return *(int*)addr_at(offset); }
120
121 public:
|