src/cpu/zero/vm/nativeInst_zero.hpp

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * Copyright 2007 Red Hat, Inc.
aoqi@0 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 5 *
aoqi@0 6 * This code is free software; you can redistribute it and/or modify it
aoqi@0 7 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 8 * published by the Free Software Foundation.
aoqi@0 9 *
aoqi@0 10 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 13 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 14 * accompanied this code).
aoqi@0 15 *
aoqi@0 16 * You should have received a copy of the GNU General Public License version
aoqi@0 17 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 19 *
aoqi@0 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 21 * or visit www.oracle.com if you need additional information or have any
aoqi@0 22 * questions.
aoqi@0 23 *
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 #ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP
aoqi@0 27 #define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
aoqi@0 28
aoqi@0 29 #include "asm/assembler.hpp"
aoqi@0 30 #include "memory/allocation.hpp"
aoqi@0 31 #include "runtime/icache.hpp"
aoqi@0 32 #include "runtime/os.hpp"
aoqi@0 33 #include "utilities/top.hpp"
aoqi@0 34
aoqi@0 35 // We have interfaces for the following instructions:
aoqi@0 36 // - NativeInstruction
aoqi@0 37 // - - NativeCall
aoqi@0 38 // - - NativeMovConstReg
aoqi@0 39 // - - NativeMovConstRegPatching
aoqi@0 40 // - - NativeJump
aoqi@0 41 // - - NativeIllegalOpCode
aoqi@0 42 // - - NativeReturn
aoqi@0 43 // - - NativeReturnX (return with argument)
aoqi@0 44 // - - NativePushConst
aoqi@0 45 // - - NativeTstRegMem
aoqi@0 46
aoqi@0 47 // The base class for different kinds of native instruction abstractions.
aoqi@0 48 // Provides the primitive operations to manipulate code relative to this.
aoqi@0 49
aoqi@0 50 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
aoqi@0 51 public:
aoqi@0 52 bool is_jump() {
aoqi@0 53 ShouldNotCallThis();
aoqi@0 54 return false;
aoqi@0 55 }
aoqi@0 56
aoqi@0 57 bool is_safepoint_poll() {
aoqi@0 58 ShouldNotCallThis();
aoqi@0 59 return false;
aoqi@0 60 }
aoqi@0 61 };
aoqi@0 62
aoqi@0 63 inline NativeInstruction* nativeInstruction_at(address address) {
aoqi@0 64 ShouldNotCallThis();
aoqi@0 65 return NULL;
aoqi@0 66 }
aoqi@0 67
aoqi@0 68 class NativeCall : public NativeInstruction {
aoqi@0 69 public:
aoqi@0 70 enum zero_specific_constants {
aoqi@0 71 instruction_size = 0 // not used within the interpreter
aoqi@0 72 };
aoqi@0 73
aoqi@0 74 address instruction_address() const {
aoqi@0 75 ShouldNotCallThis();
aoqi@0 76 return NULL;
aoqi@0 77 }
aoqi@0 78
aoqi@0 79 address next_instruction_address() const {
aoqi@0 80 ShouldNotCallThis();
aoqi@0 81 return NULL;
aoqi@0 82 }
aoqi@0 83
aoqi@0 84 address return_address() const {
aoqi@0 85 ShouldNotCallThis();
aoqi@0 86 return NULL;
aoqi@0 87 }
aoqi@0 88
aoqi@0 89 address destination() const {
aoqi@0 90 ShouldNotCallThis();
aoqi@0 91 return NULL;
aoqi@0 92 }
aoqi@0 93
aoqi@0 94 void set_destination_mt_safe(address dest) {
aoqi@0 95 ShouldNotCallThis();
aoqi@0 96 }
aoqi@0 97
aoqi@0 98 void verify_alignment() {
aoqi@0 99 ShouldNotCallThis();
aoqi@0 100 }
aoqi@0 101
aoqi@0 102 void verify() {
aoqi@0 103 ShouldNotCallThis();
aoqi@0 104 }
aoqi@0 105
aoqi@0 106 static bool is_call_before(address return_address) {
aoqi@0 107 ShouldNotCallThis();
aoqi@0 108 return false;
aoqi@0 109 }
aoqi@0 110 };
aoqi@0 111
aoqi@0 112 inline NativeCall* nativeCall_before(address return_address) {
aoqi@0 113 ShouldNotCallThis();
aoqi@0 114 return NULL;
aoqi@0 115 }
aoqi@0 116
aoqi@0 117 inline NativeCall* nativeCall_at(address address) {
aoqi@0 118 ShouldNotCallThis();
aoqi@0 119 return NULL;
aoqi@0 120 }
aoqi@0 121
aoqi@0 122 class NativeMovConstReg : public NativeInstruction {
aoqi@0 123 public:
aoqi@0 124 address next_instruction_address() const {
aoqi@0 125 ShouldNotCallThis();
aoqi@0 126 return NULL;
aoqi@0 127 }
aoqi@0 128
aoqi@0 129 intptr_t data() const {
aoqi@0 130 ShouldNotCallThis();
aoqi@0 131 return 0;
aoqi@0 132 }
aoqi@0 133
aoqi@0 134 void set_data(intptr_t x) {
aoqi@0 135 ShouldNotCallThis();
aoqi@0 136 }
aoqi@0 137 };
aoqi@0 138
aoqi@0 139 inline NativeMovConstReg* nativeMovConstReg_at(address address) {
aoqi@0 140 ShouldNotCallThis();
aoqi@0 141 return NULL;
aoqi@0 142 }
aoqi@0 143
aoqi@0 144 class NativeMovRegMem : public NativeInstruction {
aoqi@0 145 public:
aoqi@0 146 int offset() const {
aoqi@0 147 ShouldNotCallThis();
aoqi@0 148 return 0;
aoqi@0 149 }
aoqi@0 150
aoqi@0 151 void set_offset(intptr_t x) {
aoqi@0 152 ShouldNotCallThis();
aoqi@0 153 }
aoqi@0 154
aoqi@0 155 void add_offset_in_bytes(int add_offset) {
aoqi@0 156 ShouldNotCallThis();
aoqi@0 157 }
aoqi@0 158 };
aoqi@0 159
aoqi@0 160 inline NativeMovRegMem* nativeMovRegMem_at(address address) {
aoqi@0 161 ShouldNotCallThis();
aoqi@0 162 return NULL;
aoqi@0 163 }
aoqi@0 164
aoqi@0 165 class NativeJump : public NativeInstruction {
aoqi@0 166 public:
aoqi@0 167 enum zero_specific_constants {
aoqi@0 168 instruction_size = 0 // not used within the interpreter
aoqi@0 169 };
aoqi@0 170
aoqi@0 171 address jump_destination() const {
aoqi@0 172 ShouldNotCallThis();
aoqi@0 173 return NULL;
aoqi@0 174 }
aoqi@0 175
aoqi@0 176 void set_jump_destination(address dest) {
aoqi@0 177 ShouldNotCallThis();
aoqi@0 178 }
aoqi@0 179
aoqi@0 180 static void check_verified_entry_alignment(address entry,
aoqi@0 181 address verified_entry) {
aoqi@0 182 }
aoqi@0 183
aoqi@0 184 static void patch_verified_entry(address entry,
aoqi@0 185 address verified_entry,
aoqi@0 186 address dest);
aoqi@0 187 };
aoqi@0 188
aoqi@0 189 inline NativeJump* nativeJump_at(address address) {
aoqi@0 190 ShouldNotCallThis();
aoqi@0 191 return NULL;
aoqi@0 192 }
aoqi@0 193
aoqi@0 194 class NativeGeneralJump : public NativeInstruction {
aoqi@0 195 public:
aoqi@0 196 address jump_destination() const {
aoqi@0 197 ShouldNotCallThis();
aoqi@0 198 return NULL;
aoqi@0 199 }
aoqi@0 200
aoqi@0 201 static void insert_unconditional(address code_pos, address entry) {
aoqi@0 202 ShouldNotCallThis();
aoqi@0 203 }
aoqi@0 204
aoqi@0 205 static void replace_mt_safe(address instr_addr, address code_buffer) {
aoqi@0 206 ShouldNotCallThis();
aoqi@0 207 }
aoqi@0 208 };
aoqi@0 209
aoqi@0 210 inline NativeGeneralJump* nativeGeneralJump_at(address address) {
aoqi@0 211 ShouldNotCallThis();
aoqi@0 212 return NULL;
aoqi@0 213 }
aoqi@0 214
aoqi@0 215 #endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP

mercurial