< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page
rev 51802 : [mq]: crash_C2_method.patch

@@ -909,10 +909,18 @@
     // NOTE: We set the table base offset here because users might be
     // emitted before MachConstantBaseNode.
     Compile::ConstantTable& constant_table = C->constant_table();
     constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
   }
+
+#ifndef PRODUCT
+  ciMethod *currMethod = C->method();
+  if (currMethod && currMethod->has_option("crashOnEntry")) {
+    // aaa instruction not valid in 64-bit mode, leads to crash
+    emit_opcode(cbuf, 0x37);
+  }
+#endif 
 }
 
 uint MachPrologNode::size(PhaseRegAlloc* ra_) const
 {
   return MachNode::size(ra_); // too many variables; just compute it

@@ -967,10 +975,18 @@
 void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
 {
   Compile* C = ra_->C;
   MacroAssembler _masm(&cbuf);
 
+#ifndef PRODUCT
+  ciMethod *currMethod = C->method();
+  if (currMethod && currMethod->has_option("crashOnExit")) {
+    // aaa instruction not valid in 64-bit mode, leads to crash
+    emit_opcode(cbuf, 0x37);
+  }
+#endif
+
   if (generate_vzeroupper(C)) {
     // Clear upper bits of YMM registers when current compiled code uses
     // wide vectors to avoid AVX <-> SSE transition penalty during call.
     __ vzeroupper();
   }
< prev index next >