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 */
23
24 #include "jvmci/jvmciCodeInstaller.hpp"
25 #include "jvmci/jvmciRuntime.hpp"
26 #include "jvmci/jvmciCompilerToVM.hpp"
27 #include "jvmci/jvmciJavaClasses.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "runtime/sharedRuntime.hpp"
30 #include "vmreg_aarch64.inline.hpp"
31
32 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
33 if (inst->is_call() || inst->is_jump() || inst->is_blr()) {
34 return pc_offset + NativeCall::instruction_size;
35 } else if (inst->is_general_jump()) {
36 return pc_offset + NativeGeneralJump::instruction_size;
37 } else {
38 JVMCI_ERROR_0("unsupported type of instruction for call site");
39 }
40 }
41
42 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
43 address pc = _instructions->start() + pc_offset;
44 #ifdef ASSERT
45 {
46 NativeInstruction *insn = nativeInstruction_at(pc);
47 if (HotSpotObjectConstantImpl::compressed(constant)) {
48 // Mov narrow constant: movz n << 16, movk
|
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 */
23
24 #include "jvmci/jvmciCodeInstaller.hpp"
25 #include "jvmci/jvmciRuntime.hpp"
26 #include "jvmci/jvmciCompilerToVM.hpp"
27 #include "jvmci/jvmciJavaClasses.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "runtime/handles.inline.hpp"
30 #include "runtime/sharedRuntime.hpp"
31 #include "vmreg_aarch64.inline.hpp"
32
33 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
34 if (inst->is_call() || inst->is_jump() || inst->is_blr()) {
35 return pc_offset + NativeCall::instruction_size;
36 } else if (inst->is_general_jump()) {
37 return pc_offset + NativeGeneralJump::instruction_size;
38 } else {
39 JVMCI_ERROR_0("unsupported type of instruction for call site");
40 }
41 }
42
43 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
44 address pc = _instructions->start() + pc_offset;
45 #ifdef ASSERT
46 {
47 NativeInstruction *insn = nativeInstruction_at(pc);
48 if (HotSpotObjectConstantImpl::compressed(constant)) {
49 // Mov narrow constant: movz n << 16, movk
|