203 }
204 guarantee(__ pc() <= s->code_end(), "overflowed buffer");
205 // shut the door on sizing bugs
206 int slop = 2*BytesPerInstWord; // 32-bit offset is this much larger than a 13-bit one
207 assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for sethi;add");
208
209 s->set_exception_points(npe_addr, ame_addr);
210 return s;
211 }
212
213
214 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
215 if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) return 1000;
216 else {
217 const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets)
218 if (is_vtable_stub) {
219 // ld;ld;ld,jmp,nop
220 const int basic = 5*BytesPerInstWord +
221 // shift;add for load_klass (only shift with zero heap based)
222 (UseCompressedKlassPointers ?
223 ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
224 return basic + slop;
225 } else {
226 const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
227 // shift;add for load_klass (only shift with zero heap based)
228 (UseCompressedKlassPointers ?
229 ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
230 return (basic + slop);
231 }
232 }
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[116] left over: 8
238 // Reduce the constants so that the "left over" number is 8
239 // Do not aim at a left-over number of zero, because a very
240 // large vtable or itable offset (> 4K) will require an extra
241 // sethi/or pair of instructions.
242 //
243 // The JVM98 app. _202_jess has a megamorphic interface call.
244 // The itable code looks like this:
245 // Decoding VtableStub itbl[1]@16
246 // ld [ %o0 + 4 ], %g3
247 // save %sp, -64, %sp
248 // ld [ %g3 + 0xe8 ], %l2
249 // sll %l2, 2, %l2
|
203 }
204 guarantee(__ pc() <= s->code_end(), "overflowed buffer");
205 // shut the door on sizing bugs
206 int slop = 2*BytesPerInstWord; // 32-bit offset is this much larger than a 13-bit one
207 assert(itable_index > 10 || __ pc() + slop <= s->code_end(), "room for sethi;add");
208
209 s->set_exception_points(npe_addr, ame_addr);
210 return s;
211 }
212
213
214 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
215 if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) return 1000;
216 else {
217 const int slop = 2*BytesPerInstWord; // sethi;add (needed for long offsets)
218 if (is_vtable_stub) {
219 // ld;ld;ld,jmp,nop
220 const int basic = 5*BytesPerInstWord +
221 // shift;add for load_klass (only shift with zero heap based)
222 (UseCompressedKlassPointers ?
223 ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
224 return basic + slop;
225 } else {
226 const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
227 // shift;add for load_klass (only shift with zero heap based)
228 (UseCompressedKlassPointers ?
229 ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
230 return (basic + slop);
231 }
232 }
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[116] left over: 8
238 // Reduce the constants so that the "left over" number is 8
239 // Do not aim at a left-over number of zero, because a very
240 // large vtable or itable offset (> 4K) will require an extra
241 // sethi/or pair of instructions.
242 //
243 // The JVM98 app. _202_jess has a megamorphic interface call.
244 // The itable code looks like this:
245 // Decoding VtableStub itbl[1]@16
246 // ld [ %o0 + 4 ], %g3
247 // save %sp, -64, %sp
248 // ld [ %g3 + 0xe8 ], %l2
249 // sll %l2, 2, %l2
|