Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/vtableStubs_sparc.cpp @ 14422:2b8e28fdf503
Merge
author | kvn |
---|---|
date | Tue, 05 Nov 2013 17:38:04 -0800 |
parents | 891687731b59 |
children |
comparison
equal
deleted
inserted
replaced
14421:3068270ba476 | 14422:2b8e28fdf503 |
---|---|
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; |
216 const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets) | 226 const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets) |
217 if (is_vtable_stub) { | 227 if (is_vtable_stub) { |
218 // ld;ld;ld,jmp,nop | 228 // ld;ld;ld,jmp,nop |
219 const int basic = 5*BytesPerInstWord + | 229 const int basic = 5*BytesPerInstWord + |
220 // shift;add for load_klass (only shift with zero heap based) | 230 // shift;add for load_klass (only shift with zero heap based) |
221 (UseCompressedKlassPointers ? | 231 (UseCompressedClassPointers ? |
222 MacroAssembler::instr_size_for_decode_klass_not_null() : 0); | 232 MacroAssembler::instr_size_for_decode_klass_not_null() : 0); |
223 return basic + slop; | 233 return basic + slop; |
224 } else { | 234 } else { |
225 const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord + | 235 const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord + |
226 // shift;add for load_klass (only shift with zero heap based) | 236 // shift;add for load_klass (only shift with zero heap based) |
227 (UseCompressedKlassPointers ? | 237 (UseCompressedClassPointers ? |
228 MacroAssembler::instr_size_for_decode_klass_not_null() : 0); | 238 MacroAssembler::instr_size_for_decode_klass_not_null() : 0); |
229 return (basic + slop); | 239 return (basic + slop); |
230 } | 240 } |
231 } | 241 } |
232 | 242 |