208
209
210 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
211 PcDesc* pd = pc_desc_at(pc);
212 guarantee(pd != NULL, "scope must be present");
213 return new ScopeDesc(this, pd->scope_decode_offset(),
214 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
215 pd->return_oop());
216 }
217
218 ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
219 PcDesc* pd = pc_desc_near(pc);
220 guarantee(pd != NULL, "scope must be present");
221 return new ScopeDesc(this, pd->scope_decode_offset(),
222 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
223 pd->return_oop());
224 }
225
226 address CompiledMethod::oops_reloc_begin() const {
227 // If the method is not entrant or zombie then a JMP is plastered over the
228 // first few bytes. If an oop in the old code was there, that oop
229 // should not get GC'd. Skip the first few bytes of oops on
230 // not-entrant methods.
231 address low_boundary = verified_entry_point();
232 if (!is_in_use() && is_nmethod()) {
233 low_boundary += NativeJump::instruction_size;
234 // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
235 // This means that the low_boundary is going to be a little too high.
236 // This shouldn't matter, since oops of non-entrant methods are never used.
237 // In fact, why are we bothering to look at oops in a non-entrant method??
238 }
239 return low_boundary;
240 }
241
242 int CompiledMethod::verify_icholder_relocations() {
243 ResourceMark rm;
244 int count = 0;
245
246 RelocIterator iter(this);
247 while(iter.next()) {
248 if (iter.type() == relocInfo::virtual_call_type) {
249 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) {
250 CompiledIC *ic = CompiledIC_at(&iter);
251 if (TraceCompiledIC) {
252 tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
253 ic->print();
254 }
255 assert(ic->cached_icholder() != NULL, "must be non-NULL");
256 count++;
257 }
258 }
|
208
209
210 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
211 PcDesc* pd = pc_desc_at(pc);
212 guarantee(pd != NULL, "scope must be present");
213 return new ScopeDesc(this, pd->scope_decode_offset(),
214 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
215 pd->return_oop());
216 }
217
218 ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
219 PcDesc* pd = pc_desc_near(pc);
220 guarantee(pd != NULL, "scope must be present");
221 return new ScopeDesc(this, pd->scope_decode_offset(),
222 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
223 pd->return_oop());
224 }
225
226 address CompiledMethod::oops_reloc_begin() const {
227 // If the method is not entrant or zombie then a JMP is plastered over the
228 // first few bytes. Therefore, we do not allow an oop in the first
229 // NativeJump::instruction_size after the verified entry. Since the
230 // frame is being built in this path, that guarantees such oops can not
231 // exist until the frame is completed, which should be strictly later.
232 return MAX2(code_begin() + frame_complete_offset(),
233 verified_entry_point() + NativeJump::instruction_size);
234 }
235
236 int CompiledMethod::verify_icholder_relocations() {
237 ResourceMark rm;
238 int count = 0;
239
240 RelocIterator iter(this);
241 while(iter.next()) {
242 if (iter.type() == relocInfo::virtual_call_type) {
243 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) {
244 CompiledIC *ic = CompiledIC_at(&iter);
245 if (TraceCompiledIC) {
246 tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
247 ic->print();
248 }
249 assert(ic->cached_icholder() != NULL, "must be non-NULL");
250 count++;
251 }
252 }
|