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_MACROASSEMBLER_PPC_HPP
27 #define CPU_PPC_MACROASSEMBLER_PPC_HPP
28
29 #include "asm/assembler.hpp"
30 #include "oops/accessDecorators.hpp"
31 #include "utilities/macros.hpp"
32
33 // MacroAssembler extends Assembler by a few frequently used macros.
34
35 class ciTypeArray;
36 class OopMap;
37
38 class MacroAssembler: public Assembler {
39 public:
40 MacroAssembler(CodeBuffer* code) : Assembler(code) {}
41
42 // Indicates whether and, if so, which registers must be preserved when calling runtime code.
43 enum PreservationLevel {
44 PRESERVATION_NONE,
45 PRESERVATION_FRAME_LR,
46 PRESERVATION_FRAME_LR_GP_REGS,
47 PRESERVATION_FRAME_LR_GP_FP_REGS
48 };
49
50 //
51 // Optimized instruction emitters
52 //
53
54 inline static int largeoffset_si16_si16_hi(int si31) { return (si31 + (1<<15)) >> 16; }
55 inline static int largeoffset_si16_si16_lo(int si31) { return si31 - (((si31 + (1<<15)) >> 16) << 16); }
56
993
994 private:
995 void stop(int type, const char* msg);
996
997 public:
998 enum {
999 stop_stop = 0,
1000 stop_untested = 1,
1001 stop_unimplemented = 2,
1002 stop_shouldnotreachhere = 3,
1003 stop_msg_present = -0x8000
1004 };
1005
1006 // Prints msg, dumps registers and stops execution.
1007 void stop (const char* msg = nullptr) { stop(stop_stop, msg); }
1008 void untested (const char* msg = nullptr) { stop(stop_untested, msg); }
1009 void unimplemented (const char* msg = nullptr) { stop(stop_unimplemented, msg); }
1010 void should_not_reach_here(const char* msg = nullptr) { stop(stop_shouldnotreachhere, msg); }
1011
1012 void zap_from_to(Register low, int before, Register high, int after, Register val, Register addr) PRODUCT_RETURN;
1013 };
1014
1015 #endif // CPU_PPC_MACROASSEMBLER_PPC_HPP
|
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_MACROASSEMBLER_PPC_HPP
27 #define CPU_PPC_MACROASSEMBLER_PPC_HPP
28
29 #include "asm/assembler.hpp"
30 #include "oops/accessDecorators.hpp"
31 #include "utilities/macros.hpp"
32
33 // MacroAssembler extends Assembler by a few frequently used macros.
34
35 class ciTypeArray;
36 class OopMap;
37 class ciInlineKlass;
38 class SigEntry;
39 class VMRegPair;
40
41 class MacroAssembler: public Assembler {
42 public:
43 MacroAssembler(CodeBuffer* code) : Assembler(code) {}
44
45 // Indicates whether and, if so, which registers must be preserved when calling runtime code.
46 enum PreservationLevel {
47 PRESERVATION_NONE,
48 PRESERVATION_FRAME_LR,
49 PRESERVATION_FRAME_LR_GP_REGS,
50 PRESERVATION_FRAME_LR_GP_FP_REGS
51 };
52
53 //
54 // Optimized instruction emitters
55 //
56
57 inline static int largeoffset_si16_si16_hi(int si31) { return (si31 + (1<<15)) >> 16; }
58 inline static int largeoffset_si16_si16_lo(int si31) { return si31 - (((si31 + (1<<15)) >> 16) << 16); }
59
996
997 private:
998 void stop(int type, const char* msg);
999
1000 public:
1001 enum {
1002 stop_stop = 0,
1003 stop_untested = 1,
1004 stop_unimplemented = 2,
1005 stop_shouldnotreachhere = 3,
1006 stop_msg_present = -0x8000
1007 };
1008
1009 // Prints msg, dumps registers and stops execution.
1010 void stop (const char* msg = nullptr) { stop(stop_stop, msg); }
1011 void untested (const char* msg = nullptr) { stop(stop_untested, msg); }
1012 void unimplemented (const char* msg = nullptr) { stop(stop_unimplemented, msg); }
1013 void should_not_reach_here(const char* msg = nullptr) { stop(stop_shouldnotreachhere, msg); }
1014
1015 void zap_from_to(Register low, int before, Register high, int after, Register val, Register addr) PRODUCT_RETURN;
1016
1017 // Inline type specific methods
1018 #include "asm/macroAssembler_common.hpp"
1019 };
1020
1021 #endif // CPU_PPC_MACROASSEMBLER_PPC_HPP
|