< prev index next >

src/hotspot/cpu/x86/nativeInst_x86.cpp

Print this page
@@ -629,11 +629,10 @@
       address ptr = (address)((intptr_t)code_buffer + i);
       int a_byte = (*ptr) & 0xFF;
       assert(*((address)((intptr_t)instr_addr + i)) == a_byte, "mt safe patching failed");
     }
  #endif
- 
  }
  
  
  
  address NativeGeneralJump::jump_destination() const {

@@ -645,5 +644,32 @@
    if (is_rel32off)
      return addr_at(0) + length + int_at(offset);
    else
      return addr_at(0) + length + sbyte_at(offset);
  }
+ 
+ void NativePostCallNop::make_deopt() {
+   NativeDeoptInstruction::insert(addr_at(0));
+   // makes the first 2 bytes into UD, the rest is thrash. Make NOPs to help debugging.
+   set_char_at(2, 0x90);
+   set_char_at(3, 0x90);
+   set_char_at(4, 0x90);
+   set_char_at(5, 0x90);
+   set_char_at(6, 0x90);
+   set_char_at(7, 0x90);
+ }
+ 
+ void NativePostCallNop::patch(jint diff) {
+   assert(diff != 0, "must be");
+   int32_t *code_pos = (int32_t *) addr_at(displacement_offset);
+   *((int32_t *)(code_pos)) = (int32_t) diff;
+ }
+ 
+ void NativeDeoptInstruction::verify() {
+ }
+ 
+ // Inserts an undefined instruction at a given pc
+ void NativeDeoptInstruction::insert(address code_pos) {
+   *code_pos = instruction_prefix;
+   *(code_pos+1) = instruction_code;
+   ICache::invalidate_range(code_pos, instruction_size);
+ }
< prev index next >