473 REX_RB = 0x45,
474 REX_RX = 0x46,
475 REX_RXB = 0x47,
476
477 REX_W = 0x48,
478
479 REX_WB = 0x49,
480 REX_WX = 0x4A,
481 REX_WXB = 0x4B,
482 REX_WR = 0x4C,
483 REX_WRB = 0x4D,
484 REX_WRX = 0x4E,
485 REX_WRXB = 0x4F
486 };
487
488 enum WhichOperand {
489 // input to locate_operand, and format code for relocations
490 imm64_operand = 0, // embedded 64-bit immediate operand
491 disp32_operand = 1, // embedded 32-bit displacement
492 call32_operand = 2, // embedded 32-bit self-relative displacement
493 _WhichOperand_limit = 3
494 };
495
496 public:
497
498 // Creation
499 Assembler(CodeBuffer* code)
500 : AbstractAssembler(code) {
501 }
502
503 // Decoding
504 static address locate_operand(address inst, WhichOperand which);
505 static address locate_next_instruction(address inst);
506
507 // Utilities
508
509 static bool is_simm(int64_t x, int nbits) { return -( CONST64(1) << (nbits-1) ) <= x && x < ( CONST64(1) << (nbits-1) ); }
510 static bool is_simm32 (int64_t x) { return x == (int64_t)(int32_t)x; }
511
512
513 // Stack
1097 // C++ bool manipulation
1098
1099 void movbool(Register dst, Address src);
1100 void movbool(Address dst, bool boolconst);
1101 void movbool(Address dst, Register src);
1102 void testbool(Register dst);
1103
1104 // oop manipulations
1105 void load_klass(Register dst, Register src);
1106 void store_klass(Register dst, Register src);
1107
1108 void load_heap_oop(Register dst, Address src);
1109 void store_heap_oop(Address dst, Register src);
1110 void encode_heap_oop(Register r);
1111 void decode_heap_oop(Register r);
1112 void encode_heap_oop_not_null(Register r);
1113 void decode_heap_oop_not_null(Register r);
1114 void encode_heap_oop_not_null(Register dst, Register src);
1115 void decode_heap_oop_not_null(Register dst, Register src);
1116
1117 // Stack frame creation/removal
1118 void enter();
1119 void leave();
1120
1121 // Support for getting the JavaThread pointer (i.e.; a reference to
1122 // thread-local information) The pointer will be loaded into the
1123 // thread register.
1124 void get_thread(Register thread);
1125
1126 void int3();
1127
1128 // Support for VM calls
1129 //
1130 // It is imperative that all calls into the VM are handled via the
1131 // call_VM macros. They make sure that the stack linkage is setup
1132 // correctly. call_VM's correspond to ENTRY/ENTRY_X entry points
1133 // while call_VM_leaf's correspond to LEAF entry points.
1134 void call_VM(Register oop_result,
1135 address entry_point,
1136 bool check_exceptions = true);
|
473 REX_RB = 0x45,
474 REX_RX = 0x46,
475 REX_RXB = 0x47,
476
477 REX_W = 0x48,
478
479 REX_WB = 0x49,
480 REX_WX = 0x4A,
481 REX_WXB = 0x4B,
482 REX_WR = 0x4C,
483 REX_WRB = 0x4D,
484 REX_WRX = 0x4E,
485 REX_WRXB = 0x4F
486 };
487
488 enum WhichOperand {
489 // input to locate_operand, and format code for relocations
490 imm64_operand = 0, // embedded 64-bit immediate operand
491 disp32_operand = 1, // embedded 32-bit displacement
492 call32_operand = 2, // embedded 32-bit self-relative displacement
493 #ifndef AMD64
494 _WhichOperand_limit = 3
495 #else
496 narrow_oop_operand = 3, // embedded 32-bit immediate narrow oop
497 _WhichOperand_limit = 4
498 #endif
499 };
500
501 public:
502
503 // Creation
504 Assembler(CodeBuffer* code)
505 : AbstractAssembler(code) {
506 }
507
508 // Decoding
509 static address locate_operand(address inst, WhichOperand which);
510 static address locate_next_instruction(address inst);
511
512 // Utilities
513
514 static bool is_simm(int64_t x, int nbits) { return -( CONST64(1) << (nbits-1) ) <= x && x < ( CONST64(1) << (nbits-1) ); }
515 static bool is_simm32 (int64_t x) { return x == (int64_t)(int32_t)x; }
516
517
518 // Stack
1102 // C++ bool manipulation
1103
1104 void movbool(Register dst, Address src);
1105 void movbool(Address dst, bool boolconst);
1106 void movbool(Address dst, Register src);
1107 void testbool(Register dst);
1108
1109 // oop manipulations
1110 void load_klass(Register dst, Register src);
1111 void store_klass(Register dst, Register src);
1112
1113 void load_heap_oop(Register dst, Address src);
1114 void store_heap_oop(Address dst, Register src);
1115 void encode_heap_oop(Register r);
1116 void decode_heap_oop(Register r);
1117 void encode_heap_oop_not_null(Register r);
1118 void decode_heap_oop_not_null(Register r);
1119 void encode_heap_oop_not_null(Register dst, Register src);
1120 void decode_heap_oop_not_null(Register dst, Register src);
1121
1122 void set_narrow_oop(Register dst, jobject obj);
1123
1124 // Stack frame creation/removal
1125 void enter();
1126 void leave();
1127
1128 // Support for getting the JavaThread pointer (i.e.; a reference to
1129 // thread-local information) The pointer will be loaded into the
1130 // thread register.
1131 void get_thread(Register thread);
1132
1133 void int3();
1134
1135 // Support for VM calls
1136 //
1137 // It is imperative that all calls into the VM are handled via the
1138 // call_VM macros. They make sure that the stack linkage is setup
1139 // correctly. call_VM's correspond to ENTRY/ENTRY_X entry points
1140 // while call_VM_leaf's correspond to LEAF entry points.
1141 void call_VM(Register oop_result,
1142 address entry_point,
1143 bool check_exceptions = true);
|