< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Print this page




  91   //
  92   // Generates code that causes a NULL OS exception if the content of reg is NULL.
  93   // If the accessed location is M[reg + offset] and the offset is known, provide the
  94   // offset. No explicit code generation is needed if the offset is within a certain
  95   // range (0 <= offset <= page_size).
  96 
  97   void null_check(Register reg, int offset = -1);
  98   static bool needs_explicit_null_check(intptr_t offset);
  99 
 100   void test_klass_is_value(Register klass, Register temp_reg, Label& is_value);
 101 
 102   void test_field_is_flattenable(Register flags, Register temp_reg, Label& is_flattenable);
 103   void test_field_is_not_flattenable(Register flags, Register temp_reg, Label& notFlattenable);
 104   void test_field_is_flattened(Register flags, Register temp_reg, Label& is_flattened);
 105   void test_value_is_not_buffered(Register value, Register temp_reg, Label& not_buffered);
 106 
 107   // Check klass/oops is flat value type array (oop->_klass->_layout_helper & vt_bit)
 108   void test_flat_array_klass(Register klass, Register temp_reg, Label& is_flat_array);
 109   void test_flat_array_oop(Register oop, Register temp_reg, Label& is_flat_array);
 110 


 111   // Required platform-specific helpers for Label::patch_instructions.
 112   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
 113   void pd_patch_instruction(address branch, address target) {
 114     unsigned char op = branch[0];
 115     assert(op == 0xE8 /* call */ ||
 116         op == 0xE9 /* jmp */ ||
 117         op == 0xEB /* short jmp */ ||
 118         (op & 0xF0) == 0x70 /* short jcc */ ||
 119         op == 0x0F && (branch[1] & 0xF0) == 0x80 /* jcc */ ||
 120         op == 0xC7 && branch[1] == 0xF8 /* xbegin */,
 121         "Invalid opcode at patch point");
 122 
 123     if (op == 0xEB || (op & 0xF0) == 0x70) {
 124       // short offset operators (jmp and jcc)
 125       char* disp = (char*) &branch[1];
 126       int imm8 = target - (address) &disp[1];
 127       guarantee(this->is8bit(imm8), "Short forward jump exceeds 8-bit offset");
 128       *disp = imm8;
 129     } else {
 130       int* disp = (int*) &branch[(op == 0x0F || op == 0xC7)? 2: 1];




  91   //
  92   // Generates code that causes a NULL OS exception if the content of reg is NULL.
  93   // If the accessed location is M[reg + offset] and the offset is known, provide the
  94   // offset. No explicit code generation is needed if the offset is within a certain
  95   // range (0 <= offset <= page_size).
  96 
  97   void null_check(Register reg, int offset = -1);
  98   static bool needs_explicit_null_check(intptr_t offset);
  99 
 100   void test_klass_is_value(Register klass, Register temp_reg, Label& is_value);
 101 
 102   void test_field_is_flattenable(Register flags, Register temp_reg, Label& is_flattenable);
 103   void test_field_is_not_flattenable(Register flags, Register temp_reg, Label& notFlattenable);
 104   void test_field_is_flattened(Register flags, Register temp_reg, Label& is_flattened);
 105   void test_value_is_not_buffered(Register value, Register temp_reg, Label& not_buffered);
 106 
 107   // Check klass/oops is flat value type array (oop->_klass->_layout_helper & vt_bit)
 108   void test_flat_array_klass(Register klass, Register temp_reg, Label& is_flat_array);
 109   void test_flat_array_oop(Register oop, Register temp_reg, Label& is_flat_array);
 110 
 111   void test_oop_is_value(Register oop, Register temp, Label* is_value, Label* is_not_value);
 112 
 113   // Required platform-specific helpers for Label::patch_instructions.
 114   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
 115   void pd_patch_instruction(address branch, address target) {
 116     unsigned char op = branch[0];
 117     assert(op == 0xE8 /* call */ ||
 118         op == 0xE9 /* jmp */ ||
 119         op == 0xEB /* short jmp */ ||
 120         (op & 0xF0) == 0x70 /* short jcc */ ||
 121         op == 0x0F && (branch[1] & 0xF0) == 0x80 /* jcc */ ||
 122         op == 0xC7 && branch[1] == 0xF8 /* xbegin */,
 123         "Invalid opcode at patch point");
 124 
 125     if (op == 0xEB || (op & 0xF0) == 0x70) {
 126       // short offset operators (jmp and jcc)
 127       char* disp = (char*) &branch[1];
 128       int imm8 = target - (address) &disp[1];
 129       guarantee(this->is8bit(imm8), "Short forward jump exceeds 8-bit offset");
 130       *disp = imm8;
 131     } else {
 132       int* disp = (int*) &branch[(op == 0x0F || op == 0xC7)? 2: 1];


< prev index next >