diff src/cpu/x86/vm/compiledIC_x86.cpp @ 24094:9b69cec6d01b

Merge with jdk8u121-b13
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Mon, 06 Feb 2017 17:18:57 +0100
parents 7848fc12602b c3d0bd36ab28
children
line wrap: on
line diff
--- a/src/cpu/x86/vm/compiledIC_x86.cpp	Sat Feb 04 15:24:10 2017 +0100
+++ b/src/cpu/x86/vm/compiledIC_x86.cpp	Mon Feb 06 17:18:57 2017 +0100
@@ -50,7 +50,7 @@
 // ----------------------------------------------------------------------------
 
 #define __ _masm.
-void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
+address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
   // Stub is fixed up when the corresponding call is converted from
   // calling compiled code to calling interpreted code.
   // movq rbx, 0
@@ -64,10 +64,10 @@
   // That's why we must use the macroassembler to generate a stub.
   MacroAssembler _masm(&cbuf);
 
-  address base =
-  __ start_a_stub(to_interp_stub_size());
-  guarantee(base != NULL, "out of space");
-
+  address base = __ start_a_stub(to_interp_stub_size());
+  if (base == NULL) {
+    return NULL;  // CodeBuffer::expand failed.
+  }
   // Static stub relocation stores the instruction address of the call.
   __ relocate(static_stub_Relocation::spec(mark), Assembler::imm_operand);
   // Static stub relocation also tags the Method* in the code-stream.
@@ -75,10 +75,11 @@
   // This is recognized as unresolved by relocs/nativeinst/ic code.
   __ jump(RuntimeAddress(__ pc()));
 
-  assert(__ pc() - base <= to_interp_stub_size(), "wrong stub size"); 
+  assert(__ pc() - base <= to_interp_stub_size(), "wrong stub size");
 
   // Update current stubs pointer and restore insts_end.
   __ end_a_stub();
+  return base;
 }
 #undef __