1 /*
2 * Copyright (c) 1997, 2008, 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 // We have interface for the following instructions:
26 // - NativeInstruction
27 // - - NativeCall
28 // - - NativeFarCall
29 // - - NativeMovConstReg
30 // - - NativeMovConstRegPatching
31 // - - NativeMovRegMem
32 // - - NativeMovRegMemPatching
33 // - - NativeJump
34 // - - NativeGeneralJump
35 // - - NativeIllegalInstruction
36 // The base class for different kinds of native instruction abstractions.
37 // Provides the primitive operations to manipulate code relative to this.
38 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
39 friend class Relocation;
40
41 public:
42 enum Sparc_specific_constants {
43 nop_instruction_size = 4
44 };
896 return jump;
897 }
898
899 // Insertion of native general jump instruction
900 static void insert_unconditional(address code_pos, address entry);
901 static void replace_mt_safe(address instr_addr, address code_buffer);
902
903 void verify();
904 };
905
906
907 class NativeIllegalInstruction: public NativeInstruction {
908 public:
909 enum Sparc_specific_constants {
910 instruction_size = 4
911 };
912
913 // Insert illegal opcode as specific address
914 static void insert(address code_pos);
915 };
|
1 /*
2 * Copyright (c) 1997, 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 CPU_SPARC_VM_NATIVEINST_SPARC_HPP
26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
27
28 #include "asm/assembler.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/icache.hpp"
31 #include "runtime/os.hpp"
32 #include "utilities/top.hpp"
33
34 // We have interface for the following instructions:
35 // - NativeInstruction
36 // - - NativeCall
37 // - - NativeFarCall
38 // - - NativeMovConstReg
39 // - - NativeMovConstRegPatching
40 // - - NativeMovRegMem
41 // - - NativeMovRegMemPatching
42 // - - NativeJump
43 // - - NativeGeneralJump
44 // - - NativeIllegalInstruction
45 // The base class for different kinds of native instruction abstractions.
46 // Provides the primitive operations to manipulate code relative to this.
47 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
48 friend class Relocation;
49
50 public:
51 enum Sparc_specific_constants {
52 nop_instruction_size = 4
53 };
905 return jump;
906 }
907
908 // Insertion of native general jump instruction
909 static void insert_unconditional(address code_pos, address entry);
910 static void replace_mt_safe(address instr_addr, address code_buffer);
911
912 void verify();
913 };
914
915
916 class NativeIllegalInstruction: public NativeInstruction {
917 public:
918 enum Sparc_specific_constants {
919 instruction_size = 4
920 };
921
922 // Insert illegal opcode as specific address
923 static void insert(address code_pos);
924 };
925
926 #endif // CPU_SPARC_VM_NATIVEINST_SPARC_HPP
|