Path: blob/master/src/hotspot/cpu/zero/nativeInst_zero.hpp
40931 views
/*1* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright 2007 Red Hat, Inc.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 it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 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 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_ZERO_NATIVEINST_ZERO_HPP26#define CPU_ZERO_NATIVEINST_ZERO_HPP2728#include "asm/assembler.hpp"29#include "runtime/icache.hpp"30#include "runtime/os.hpp"3132// We have interfaces for the following instructions:33// - NativeInstruction34// - - NativeCall35// - - NativeMovConstReg36// - - NativeMovConstRegPatching37// - - NativeJump38// - - NativeIllegalOpCode39// - - NativeReturn40// - - NativeReturnX (return with argument)41// - - NativePushConst42// - - NativeTstRegMem4344// The base class for different kinds of native instruction abstractions.45// Provides the primitive operations to manipulate code relative to this.4647class NativeInstruction {48public:49bool is_jump() {50ShouldNotCallThis();51return false;52}5354bool is_safepoint_poll() {55ShouldNotCallThis();56return false;57}58};5960inline NativeInstruction* nativeInstruction_at(address address) {61ShouldNotCallThis();62return NULL;63}6465class NativeCall : public NativeInstruction {66public:67enum zero_specific_constants {68instruction_size = 0 // not used within the interpreter69};7071address instruction_address() const {72ShouldNotCallThis();73return NULL;74}7576address next_instruction_address() const {77ShouldNotCallThis();78return NULL;79}8081address return_address() const {82ShouldNotCallThis();83return NULL;84}8586address destination() const {87ShouldNotCallThis();88return NULL;89}9091void set_destination_mt_safe(address dest) {92ShouldNotCallThis();93}9495void verify_alignment() {96ShouldNotCallThis();97}9899void verify() {100ShouldNotCallThis();101}102103static bool is_call_before(address return_address) {104ShouldNotCallThis();105return false;106}107};108109inline NativeCall* nativeCall_before(address return_address) {110ShouldNotCallThis();111return NULL;112}113114inline NativeCall* nativeCall_at(address address) {115ShouldNotCallThis();116return NULL;117}118119class NativeMovConstReg : public NativeInstruction {120public:121address next_instruction_address() const {122ShouldNotCallThis();123return NULL;124}125126intptr_t data() const {127ShouldNotCallThis();128return 0;129}130131void set_data(intptr_t x) {132ShouldNotCallThis();133}134};135136inline NativeMovConstReg* nativeMovConstReg_at(address address) {137ShouldNotCallThis();138return NULL;139}140141class NativeMovRegMem : public NativeInstruction {142public:143int offset() const {144ShouldNotCallThis();145return 0;146}147148void set_offset(intptr_t x) {149ShouldNotCallThis();150}151152void add_offset_in_bytes(int add_offset) {153ShouldNotCallThis();154}155};156157inline NativeMovRegMem* nativeMovRegMem_at(address address) {158ShouldNotCallThis();159return NULL;160}161162class NativeJump : public NativeInstruction {163public:164enum zero_specific_constants {165instruction_size = 0 // not used within the interpreter166};167168address jump_destination() const {169ShouldNotCallThis();170return NULL;171}172173void set_jump_destination(address dest) {174ShouldNotCallThis();175}176177static void check_verified_entry_alignment(address entry,178address verified_entry) {179}180181static void patch_verified_entry(address entry,182address verified_entry,183address dest);184};185186inline NativeJump* nativeJump_at(address address) {187ShouldNotCallThis();188return NULL;189}190191class NativeGeneralJump : public NativeInstruction {192public:193address jump_destination() const {194ShouldNotCallThis();195return NULL;196}197198static void insert_unconditional(address code_pos, address entry) {199ShouldNotCallThis();200}201202static void replace_mt_safe(address instr_addr, address code_buffer) {203ShouldNotCallThis();204}205};206207inline NativeGeneralJump* nativeGeneralJump_at(address address) {208ShouldNotCallThis();209return NULL;210}211212#endif // CPU_ZERO_NATIVEINST_ZERO_HPP213214215