25 #ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP
26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
27
28 #include "asm/macroAssembler.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/icache.hpp"
31 #include "runtime/os.hpp"
32
33 // We have interface for the following instructions:
34 // - NativeInstruction
35 // - - NativeCall
36 // - - NativeFarCall
37 // - - NativeMovConstReg
38 // - - NativeMovConstRegPatching
39 // - - NativeMovRegMem
40 // - - NativeJump
41 // - - NativeGeneralJump
42 // - - NativeIllegalInstruction
43 // The base class for different kinds of native instruction abstractions.
44 // Provides the primitive operations to manipulate code relative to this.
45 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
46 friend class Relocation;
47
48 public:
49 enum Sparc_specific_constants {
50 nop_instruction_size = 4
51 };
52
53 bool is_nop() { return long_at(0) == nop_instruction(); }
54 bool is_call() { return is_op(long_at(0), Assembler::call_op); }
55 bool is_call_reg() { return is_op(long_at(0), Assembler::arith_op); }
56 bool is_sethi() { return (is_op2(long_at(0), Assembler::sethi_op2)
57 && inv_rd(long_at(0)) != G0); }
58
59 bool sets_cc() {
60 // conservative (returns true for some instructions that do not set the
61 // the condition code, such as, "save".
62 // Does not return true for the deprecated tagged instructions, such as, TADDcc
63 int x = long_at(0);
64 return (is_op(x, Assembler::arith_op) &&
65 (inv_op3(x) & Assembler::cc_bit_op3) == Assembler::cc_bit_op3);
|
25 #ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP
26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
27
28 #include "asm/macroAssembler.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/icache.hpp"
31 #include "runtime/os.hpp"
32
33 // We have interface for the following instructions:
34 // - NativeInstruction
35 // - - NativeCall
36 // - - NativeFarCall
37 // - - NativeMovConstReg
38 // - - NativeMovConstRegPatching
39 // - - NativeMovRegMem
40 // - - NativeJump
41 // - - NativeGeneralJump
42 // - - NativeIllegalInstruction
43 // The base class for different kinds of native instruction abstractions.
44 // Provides the primitive operations to manipulate code relative to this.
45 class NativeInstruction {
46 friend class Relocation;
47
48 public:
49 enum Sparc_specific_constants {
50 nop_instruction_size = 4
51 };
52
53 bool is_nop() { return long_at(0) == nop_instruction(); }
54 bool is_call() { return is_op(long_at(0), Assembler::call_op); }
55 bool is_call_reg() { return is_op(long_at(0), Assembler::arith_op); }
56 bool is_sethi() { return (is_op2(long_at(0), Assembler::sethi_op2)
57 && inv_rd(long_at(0)) != G0); }
58
59 bool sets_cc() {
60 // conservative (returns true for some instructions that do not set the
61 // the condition code, such as, "save".
62 // Does not return true for the deprecated tagged instructions, such as, TADDcc
63 int x = long_at(0);
64 return (is_op(x, Assembler::arith_op) &&
65 (inv_op3(x) & Assembler::cc_bit_op3) == Assembler::cc_bit_op3);
|