1 /*
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
123 frame frame::sender(RegisterMap* map) const {
124 // Default is we do have to follow them. The sender_for_xxx will
125 // update it accordingly.
126 map->set_include_argument_oops(false);
127
128 if (is_entry_frame()) return sender_for_entry_frame(map);
129 if (is_interpreted_frame()) return sender_for_interpreter_frame(map);
130 assert(_cb == CodeCache::find_blob(pc()),"Must be the same");
131
132 if (_cb != NULL) {
133 return sender_for_compiled_frame(map);
134 }
135 // Must be native-compiled frame, i.e. the marshaling code for native
136 // methods that exists in the core system.
137 return frame(sender_sp(), sender_pc());
138 }
139
140 void frame::patch_pc(Thread* thread, address pc) {
141 if (TracePcPatching) {
142 tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
143 &((address*) _sp)[-1], ((address*) _sp)[-1], pc);
144 }
145 own_abi()->lr = (uint64_t)pc;
146 _cb = CodeCache::find_blob(pc);
147 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
148 address orig = (((nmethod*)_cb)->get_original_pc(this));
149 assert(orig == _pc, "expected original to be stored before patching");
150 _deopt_state = is_deoptimized;
151 // Leave _pc as is.
152 } else {
153 _deopt_state = not_deoptimized;
154 _pc = pc;
155 }
156 }
157
158 void frame::pd_gc_epilog() {
159 if (is_interpreted_frame()) {
160 // Set constant pool cache entry for interpreter.
161 Method* m = interpreter_frame_method();
162
163 *interpreter_frame_cpoolcache_addr() = m->constants()->cache();
|
1 /*
2 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
123 frame frame::sender(RegisterMap* map) const {
124 // Default is we do have to follow them. The sender_for_xxx will
125 // update it accordingly.
126 map->set_include_argument_oops(false);
127
128 if (is_entry_frame()) return sender_for_entry_frame(map);
129 if (is_interpreted_frame()) return sender_for_interpreter_frame(map);
130 assert(_cb == CodeCache::find_blob(pc()),"Must be the same");
131
132 if (_cb != NULL) {
133 return sender_for_compiled_frame(map);
134 }
135 // Must be native-compiled frame, i.e. the marshaling code for native
136 // methods that exists in the core system.
137 return frame(sender_sp(), sender_pc());
138 }
139
140 void frame::patch_pc(Thread* thread, address pc) {
141 if (TracePcPatching) {
142 tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
143 p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
144 }
145 own_abi()->lr = (uint64_t)pc;
146 _cb = CodeCache::find_blob(pc);
147 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
148 address orig = (((nmethod*)_cb)->get_original_pc(this));
149 assert(orig == _pc, "expected original to be stored before patching");
150 _deopt_state = is_deoptimized;
151 // Leave _pc as is.
152 } else {
153 _deopt_state = not_deoptimized;
154 _pc = pc;
155 }
156 }
157
158 void frame::pd_gc_epilog() {
159 if (is_interpreted_frame()) {
160 // Set constant pool cache entry for interpreter.
161 Method* m = interpreter_frame_method();
162
163 *interpreter_frame_cpoolcache_addr() = m->constants()->cache();
|