8147475: compiler/jvmci/code/SimpleDebugInfoTest.java fails in Assembler::locate_operand: ShouldNotReachHere()
authorrschatz
Wed, 20 Jan 2016 17:00:17 -1000
changeset 35583 3e83096ee8e5
parent 35582 c32a0cc19877
child 35584 bd3f4749a19c
child 35585 439d9cd90559
8147475: compiler/jvmci/code/SimpleDebugInfoTest.java fails in Assembler::locate_operand: ShouldNotReachHere() Reviewed-by: kvn, twisti
hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java
--- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java	Wed Jan 20 14:22:46 2016 +0100
+++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java	Wed Jan 20 17:00:17 2016 -1000
@@ -45,8 +45,22 @@
         super(codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10);
     }
 
+    private void emitFatNop() {
+        // 5 byte NOP:
+        // NOP DWORD ptr [EAX + EAX*1 + 00H]
+        code.emitByte(0x0F);
+        code.emitByte(0x1F);
+        code.emitByte(0x44);
+        code.emitByte(0x00);
+        code.emitByte(0x00);
+    }
+
     @Override
     public void emitPrologue() {
+        // WARNING: Initial instruction MUST be 5 bytes or longer so that
+        // NativeJump::patch_verified_entry will be able to patch out the entry
+        // code safely.
+        emitFatNop();
         code.emitByte(0x50 | AMD64.rbp.encoding);  // PUSH rbp
         emitMove(true, AMD64.rbp, AMD64.rsp);      // MOV rbp, rsp
     }