205 __ flush();
206
207 if (PrintMiscellaneous && (WizardMode || Verbose)) {
208 tty->print_cr("itable #%d at " PTR_FORMAT "[%d] left over: %d",
209 itable_index, s->entry_point(),
210 (int)(s->code_end() - s->entry_point()),
211 (int)(s->code_end() - __ pc()));
212 }
213 guarantee(__ pc() <= s->code_end(), "overflowed buffer");
214 // shut the door on sizing bugs
215 int slop = 3; // 32-bit offset is this much larger than an 8-bit one
216 assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for 32-bit offset");
217
218 s->set_exception_points(npe_addr, ame_addr);
219 return s;
220 }
221
222 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
223 if (is_vtable_stub) {
224 // Vtable stub size
225 return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
226 (UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
227 } else {
228 // Itable stub size
229 return (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
230 (UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
231 }
232 // In order to tune these parameters, run the JVM with VM options
233 // +PrintMiscellaneous and +WizardMode to see information about
234 // actual itable stubs. Look for lines like this:
235 // itable #1 at 0x5551212[71] left over: 3
236 // Reduce the constants so that the "left over" number is >=3
237 // for the common cases.
238 // Do not aim at a left-over number of zero, because a
239 // large vtable or itable index (>= 32) will require a 32-bit
240 // immediate displacement instead of an 8-bit one.
241 //
242 // The JVM98 app. _202_jess has a megamorphic interface call.
243 // The itable code looks like this:
244 // Decoding VtableStub itbl[1]@12
245 // mov 0x8(%rsi),%r10
246 // mov 0x198(%r10),%r11d
247 // lea 0x218(%r10,%r11,8),%r11
248 // lea 0x8(%r10),%r10
249 // mov (%r11),%rbx
|
205 __ flush();
206
207 if (PrintMiscellaneous && (WizardMode || Verbose)) {
208 tty->print_cr("itable #%d at " PTR_FORMAT "[%d] left over: %d",
209 itable_index, s->entry_point(),
210 (int)(s->code_end() - s->entry_point()),
211 (int)(s->code_end() - __ pc()));
212 }
213 guarantee(__ pc() <= s->code_end(), "overflowed buffer");
214 // shut the door on sizing bugs
215 int slop = 3; // 32-bit offset is this much larger than an 8-bit one
216 assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for 32-bit offset");
217
218 s->set_exception_points(npe_addr, ame_addr);
219 return s;
220 }
221
222 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
223 if (is_vtable_stub) {
224 // Vtable stub size
225 return (ShenandoahVerifyReadsToFromSpace ? 512 : 0) +
226 (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
227 (UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
228 } else {
229 // Itable stub size
230 return (ShenandoahVerifyReadsToFromSpace ? 512 : 0) +
231 (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
232 (UseCompressedClassPointers ? MacroAssembler::instr_size_for_decode_klass_not_null() : 0);
233 }
234 // In order to tune these parameters, run the JVM with VM options
235 // +PrintMiscellaneous and +WizardMode to see information about
236 // actual itable stubs. Look for lines like this:
237 // itable #1 at 0x5551212[71] left over: 3
238 // Reduce the constants so that the "left over" number is >=3
239 // for the common cases.
240 // Do not aim at a left-over number of zero, because a
241 // large vtable or itable index (>= 32) will require a 32-bit
242 // immediate displacement instead of an 8-bit one.
243 //
244 // The JVM98 app. _202_jess has a megamorphic interface call.
245 // The itable code looks like this:
246 // Decoding VtableStub itbl[1]@12
247 // mov 0x8(%rsi),%r10
248 // mov 0x198(%r10),%r11d
249 // lea 0x218(%r10,%r11,8),%r11
250 // lea 0x8(%r10),%r10
251 // mov (%r11),%rbx
|