1.1 --- a/src/cpu/x86/vm/vtableStubs_x86_32.cpp Fri Sep 20 11:17:04 2013 -0700 1.2 +++ b/src/cpu/x86/vm/vtableStubs_x86_32.cpp Tue Sep 24 15:56:25 2013 +0200 1.3 @@ -58,6 +58,11 @@ 1.4 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { 1.5 const int i486_code_length = VtableStub::pd_code_size_limit(true); 1.6 VtableStub* s = new(i486_code_length) VtableStub(true, vtable_index); 1.7 + // Can be NULL if there is no free space in the code cache. 1.8 + if (s == NULL) { 1.9 + return NULL; 1.10 + } 1.11 + 1.12 ResourceMark rm; 1.13 CodeBuffer cb(s->entry_point(), i486_code_length); 1.14 MacroAssembler* masm = new MacroAssembler(&cb); 1.15 @@ -132,6 +137,11 @@ 1.16 // add code here, bump the code stub size returned by pd_code_size_limit! 1.17 const int i486_code_length = VtableStub::pd_code_size_limit(false); 1.18 VtableStub* s = new(i486_code_length) VtableStub(false, itable_index); 1.19 + // Can be NULL if there is no free space in the code cache. 1.20 + if (s == NULL) { 1.21 + return NULL; 1.22 + } 1.23 + 1.24 ResourceMark rm; 1.25 CodeBuffer cb(s->entry_point(), i486_code_length); 1.26 MacroAssembler* masm = new MacroAssembler(&cb);