1 /*
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
194 }
195 return false;
196 }
197
198 void CompiledMethod::verify_oop_relocations() {
199 // Ensure sure that the code matches the current oop values
200 RelocIterator iter(this, NULL, NULL);
201 while (iter.next()) {
202 if (iter.type() == relocInfo::oop_type) {
203 oop_Relocation* reloc = iter.oop_reloc();
204 if (!reloc->oop_is_immediate()) {
205 reloc->verify_oop_relocation();
206 }
207 }
208 }
209 }
210
211
212 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
213 PcDesc* pd = pc_desc_at(pc);
214 guarantee(pd != NULL, "scope must be present");
215 return new ScopeDesc(this, pd->scope_decode_offset(),
216 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
217 pd->return_oop());
218 }
219
220 void CompiledMethod::cleanup_inline_caches(bool clean_all/*=false*/) {
221 assert_locked_or_safepoint(CompiledIC_lock);
222
223 // If the method is not entrant or zombie then a JMP is plastered over the
224 // first few bytes. If an oop in the old code was there, that oop
225 // should not get GC'd. Skip the first few bytes of oops on
226 // not-entrant methods.
227 address low_boundary = verified_entry_point();
228 if (!is_in_use() && is_nmethod()) {
229 low_boundary += NativeJump::instruction_size;
230 // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
231 // This means that the low_boundary is going to be a little too high.
232 // This shouldn't matter, since oops of non-entrant methods are never used.
233 // In fact, why are we bothering to look at oops in a non-entrant method??
|
1 /*
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
194 }
195 return false;
196 }
197
198 void CompiledMethod::verify_oop_relocations() {
199 // Ensure sure that the code matches the current oop values
200 RelocIterator iter(this, NULL, NULL);
201 while (iter.next()) {
202 if (iter.type() == relocInfo::oop_type) {
203 oop_Relocation* reloc = iter.oop_reloc();
204 if (!reloc->oop_is_immediate()) {
205 reloc->verify_oop_relocation();
206 }
207 }
208 }
209 }
210
211
212 ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
213 PcDesc* pd = pc_desc_at(pc);
214 guarantee(pd != NULL, "scope must be present");
215 return new ScopeDesc(this, pd->scope_decode_offset(),
216 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
217 pd->return_oop());
218 }
219
220 ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
221 PcDesc* pd = pc_desc_near(pc);
222 guarantee(pd != NULL, "scope must be present");
223 return new ScopeDesc(this, pd->scope_decode_offset(),
224 pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
225 pd->return_oop());
226 }
227
228 void CompiledMethod::cleanup_inline_caches(bool clean_all/*=false*/) {
229 assert_locked_or_safepoint(CompiledIC_lock);
230
231 // If the method is not entrant or zombie then a JMP is plastered over the
232 // first few bytes. If an oop in the old code was there, that oop
233 // should not get GC'd. Skip the first few bytes of oops on
234 // not-entrant methods.
235 address low_boundary = verified_entry_point();
236 if (!is_in_use() && is_nmethod()) {
237 low_boundary += NativeJump::instruction_size;
238 // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
239 // This means that the low_boundary is going to be a little too high.
240 // This shouldn't matter, since oops of non-entrant methods are never used.
241 // In fact, why are we bothering to look at oops in a non-entrant method??
|