comparison src/cpu/sparc/vm/vtableStubs_sparc.cpp @ 12294:891687731b59

7009641: Don't fail VM when CodeCache is full Summary: Allocation in the code cache returns NULL instead of failing the entire VM Reviewed-by: kvn, iveresov
author anoll
date Tue, 24 Sep 2013 15:56:25 +0200
parents 7944aba7ba41
children
comparison
equal deleted inserted replaced
12274:8a6a85321d3a 12294:891687731b59
50 // NOTE: %%%% if any change is made to this stub make sure that the function 50 // NOTE: %%%% if any change is made to this stub make sure that the function
51 // pd_code_size_limit is changed to ensure the correct size for VtableStub 51 // pd_code_size_limit is changed to ensure the correct size for VtableStub
52 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { 52 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
53 const int sparc_code_length = VtableStub::pd_code_size_limit(true); 53 const int sparc_code_length = VtableStub::pd_code_size_limit(true);
54 VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index); 54 VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index);
55 // Can be NULL if there is no free space in the code cache.
56 if (s == NULL) {
57 return NULL;
58 }
59
55 ResourceMark rm; 60 ResourceMark rm;
56 CodeBuffer cb(s->entry_point(), sparc_code_length); 61 CodeBuffer cb(s->entry_point(), sparc_code_length);
57 MacroAssembler* masm = new MacroAssembler(&cb); 62 MacroAssembler* masm = new MacroAssembler(&cb);
58 63
59 #ifndef PRODUCT 64 #ifndef PRODUCT
123 // NOTE: %%%% if any change is made to this stub make sure that the function 128 // NOTE: %%%% if any change is made to this stub make sure that the function
124 // pd_code_size_limit is changed to ensure the correct size for VtableStub 129 // pd_code_size_limit is changed to ensure the correct size for VtableStub
125 VtableStub* VtableStubs::create_itable_stub(int itable_index) { 130 VtableStub* VtableStubs::create_itable_stub(int itable_index) {
126 const int sparc_code_length = VtableStub::pd_code_size_limit(false); 131 const int sparc_code_length = VtableStub::pd_code_size_limit(false);
127 VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index); 132 VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index);
133 // Can be NULL if there is no free space in the code cache.
134 if (s == NULL) {
135 return NULL;
136 }
137
128 ResourceMark rm; 138 ResourceMark rm;
129 CodeBuffer cb(s->entry_point(), sparc_code_length); 139 CodeBuffer cb(s->entry_point(), sparc_code_length);
130 MacroAssembler* masm = new MacroAssembler(&cb); 140 MacroAssembler* masm = new MacroAssembler(&cb);
131 141
132 Register G3_Klass = G3_scratch; 142 Register G3_Klass = G3_scratch;