1010N/A/*
1879N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
1010N/A * Copyright 2007 Red Hat, Inc.
1010N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1010N/A *
1010N/A * This code is free software; you can redistribute it and/or modify it
1010N/A * under the terms of the GNU General Public License version 2 only, as
1010N/A * published by the Free Software Foundation.
1010N/A *
1010N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1010N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1010N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1010N/A * version 2 for more details (a copy is included in the LICENSE file that
1010N/A * accompanied this code).
1010N/A *
1010N/A * You should have received a copy of the GNU General Public License version
1010N/A * 2 along with this work; if not, write to the Free Software Foundation,
1010N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1010N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
1010N/A *
1010N/A */
1010N/A
1879N/A#ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP
1879N/A#define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
1879N/A
1879N/A#include "asm/assembler.hpp"
1879N/A#include "memory/allocation.hpp"
1879N/A#include "runtime/icache.hpp"
1879N/A#include "runtime/os.hpp"
1879N/A#include "utilities/top.hpp"
1879N/A
1010N/A// We have interfaces for the following instructions:
1010N/A// - NativeInstruction
1010N/A// - - NativeCall
1010N/A// - - NativeMovConstReg
1010N/A// - - NativeMovConstRegPatching
1010N/A// - - NativeJump
1010N/A// - - NativeIllegalOpCode
1010N/A// - - NativeReturn
1010N/A// - - NativeReturnX (return with argument)
1010N/A// - - NativePushConst
1010N/A// - - NativeTstRegMem
1010N/A
1010N/A// The base class for different kinds of native instruction abstractions.
1010N/A// Provides the primitive operations to manipulate code relative to this.
1010N/A
1010N/Aclass NativeInstruction VALUE_OBJ_CLASS_SPEC {
1010N/A public:
1010N/A bool is_jump() {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A bool is_safepoint_poll() {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A};
1010N/A
1010N/Ainline NativeInstruction* nativeInstruction_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Aclass NativeCall : public NativeInstruction {
1010N/A public:
1010N/A enum zero_specific_constants {
1010N/A instruction_size = 0 // not used within the interpreter
1010N/A };
1010N/A
1010N/A address instruction_address() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A address next_instruction_address() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A address return_address() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A address destination() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void set_destination_mt_safe(address dest) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void verify_alignment() {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void verify() {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A static bool is_call_before(address return_address) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A};
1010N/A
1010N/Ainline NativeCall* nativeCall_before(address return_address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Ainline NativeCall* nativeCall_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Aclass NativeMovConstReg : public NativeInstruction {
1010N/A public:
1010N/A address next_instruction_address() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A intptr_t data() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void set_data(intptr_t x) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A};
1010N/A
1010N/Ainline NativeMovConstReg* nativeMovConstReg_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Aclass NativeMovRegMem : public NativeInstruction {
1010N/A public:
1010N/A int offset() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void set_offset(intptr_t x) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void add_offset_in_bytes(int add_offset) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A};
1010N/A
1010N/Ainline NativeMovRegMem* nativeMovRegMem_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Aclass NativeJump : public NativeInstruction {
1010N/A public:
1010N/A enum zero_specific_constants {
1010N/A instruction_size = 0 // not used within the interpreter
1010N/A };
1010N/A
1010N/A address jump_destination() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A void set_jump_destination(address dest) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A static void check_verified_entry_alignment(address entry,
1010N/A address verified_entry) {
1010N/A }
1010N/A
1010N/A static void patch_verified_entry(address entry,
1010N/A address verified_entry,
1010N/A address dest);
1010N/A};
1010N/A
1010N/Ainline NativeJump* nativeJump_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1010N/A
1010N/Aclass NativeGeneralJump : public NativeInstruction {
1010N/A public:
1010N/A address jump_destination() const {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A static void insert_unconditional(address code_pos, address entry) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A
1010N/A static void replace_mt_safe(address instr_addr, address code_buffer) {
1010N/A ShouldNotCallThis();
1010N/A }
1010N/A};
1010N/A
1010N/Ainline NativeGeneralJump* nativeGeneralJump_at(address address) {
1010N/A ShouldNotCallThis();
1010N/A}
1879N/A
1879N/A#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP