1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)nativeInst_sparc.hpp 1.89 07/05/05 17:04:31 JVM"
3 #endif
4 /*
5 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
29 // - NativeInstruction
30 // - - NativeCall
31 // - - NativeFarCall
32 // - - NativeMovConstReg
33 // - - NativeMovConstRegPatching
34 // - - NativeMovRegMem
35 // - - NativeMovRegMemPatching
36 // - - NativeJump
37 // - - NativeGeneralJump
38 // - - NativeIllegalInstruction
39 // The base class for different kinds of native instruction abstractions.
40 // Provides the primitive operations to manipulate code relative to this.
41 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
42 friend class Relocation;
43
44 public:
45 enum Sparc_specific_constants {
46 nop_instruction_size = 4
47 };
48
49 bool is_nop() { return long_at(0) == nop_instruction(); }
50 bool is_call() { return is_op(long_at(0), Assembler::call_op); }
51 bool is_sethi() { return (is_op2(long_at(0), Assembler::sethi_op2)
52 && inv_rd(long_at(0)) != G0); }
53
54 bool sets_cc() {
55 // conservative (returns true for some instructions that do not set the
56 // the condition code, such as, "save".
57 // Does not return true for the deprecated tagged instructions, such as, TADDcc
58 int x = long_at(0);
59 return (is_op(x, Assembler::arith_op) &&
60 (inv_op3(x) & Assembler::cc_bit_op3) == Assembler::cc_bit_op3);
61 }
62 bool is_illegal();
63 bool is_zombie() {
64 int x = long_at(0);
65 return is_op3(x,
66 VM_Version::v9_instructions_work() ?
67 Assembler::ldsw_op3 : Assembler::lduw_op3,
68 Assembler::ldst_op)
|
1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)nativeInst_sparc.hpp 1.89 07/05/05 17:04:31 JVM"
3 #endif
4 /*
5 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
29 // - NativeInstruction
30 // - - NativeCall
31 // - - NativeFarCall
32 // - - NativeMovConstReg
33 // - - NativeMovConstRegPatching
34 // - - NativeMovRegMem
35 // - - NativeMovRegMemPatching
36 // - - NativeJump
37 // - - NativeGeneralJump
38 // - - NativeIllegalInstruction
39 // The base class for different kinds of native instruction abstractions.
40 // Provides the primitive operations to manipulate code relative to this.
41 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
42 friend class Relocation;
43
44 public:
45 enum Sparc_specific_constants {
46 nop_instruction_size = 4
47 };
48
49 bool is_dtrace_trap();
50 bool is_nop() { return long_at(0) == nop_instruction(); }
51 bool is_call() { return is_op(long_at(0), Assembler::call_op); }
52 bool is_sethi() { return (is_op2(long_at(0), Assembler::sethi_op2)
53 && inv_rd(long_at(0)) != G0); }
54
55 bool sets_cc() {
56 // conservative (returns true for some instructions that do not set the
57 // the condition code, such as, "save".
58 // Does not return true for the deprecated tagged instructions, such as, TADDcc
59 int x = long_at(0);
60 return (is_op(x, Assembler::arith_op) &&
61 (inv_op3(x) & Assembler::cc_bit_op3) == Assembler::cc_bit_op3);
62 }
63 bool is_illegal();
64 bool is_zombie() {
65 int x = long_at(0);
66 return is_op3(x,
67 VM_Version::v9_instructions_work() ?
68 Assembler::ldsw_op3 : Assembler::lduw_op3,
69 Assembler::ldst_op)
|