src/cpu/zero/vm/nativeInst_zero.hpp

Thu, 16 Jun 2011 13:46:55 -0700

author
never
date
Thu, 16 Jun 2011 13:46:55 -0700
changeset 2978
d83ac25d0304
parent 2314
f95d63e2154a
child 5545
e16282db4946
permissions
-rw-r--r--

7055355: JSR 292: crash while throwing WrongMethodTypeException
Reviewed-by: jrose, twisti, bdelsart

     1 /*
     2  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright 2007 Red Hat, Inc.
     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.
    23  *
    24  */
    26 #ifndef CPU_ZERO_VM_NATIVEINST_ZERO_HPP
    27 #define CPU_ZERO_VM_NATIVEINST_ZERO_HPP
    29 #include "asm/assembler.hpp"
    30 #include "memory/allocation.hpp"
    31 #include "runtime/icache.hpp"
    32 #include "runtime/os.hpp"
    33 #include "utilities/top.hpp"
    35 // We have interfaces for the following instructions:
    36 // - NativeInstruction
    37 // - - NativeCall
    38 // - - NativeMovConstReg
    39 // - - NativeMovConstRegPatching
    40 // - - NativeJump
    41 // - - NativeIllegalOpCode
    42 // - - NativeReturn
    43 // - - NativeReturnX (return with argument)
    44 // - - NativePushConst
    45 // - - NativeTstRegMem
    47 // The base class for different kinds of native instruction abstractions.
    48 // Provides the primitive operations to manipulate code relative to this.
    50 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
    51  public:
    52   bool is_jump() {
    53     ShouldNotCallThis();
    54   }
    56   bool is_safepoint_poll() {
    57     ShouldNotCallThis();
    58   }
    59 };
    61 inline NativeInstruction* nativeInstruction_at(address address) {
    62   ShouldNotCallThis();
    63 }
    65 class NativeCall : public NativeInstruction {
    66  public:
    67   enum zero_specific_constants {
    68     instruction_size = 0 // not used within the interpreter
    69   };
    71   address instruction_address() const {
    72     ShouldNotCallThis();
    73   }
    75   address next_instruction_address() const {
    76     ShouldNotCallThis();
    77   }
    79   address return_address() const {
    80     ShouldNotCallThis();
    81   }
    83   address destination() const {
    84     ShouldNotCallThis();
    85   }
    87   void set_destination_mt_safe(address dest) {
    88     ShouldNotCallThis();
    89   }
    91   void verify_alignment() {
    92     ShouldNotCallThis();
    93   }
    95   void verify() {
    96     ShouldNotCallThis();
    97   }
    99   static bool is_call_before(address return_address) {
   100     ShouldNotCallThis();
   101   }
   102 };
   104 inline NativeCall* nativeCall_before(address return_address) {
   105   ShouldNotCallThis();
   106 }
   108 inline NativeCall* nativeCall_at(address address) {
   109   ShouldNotCallThis();
   110 }
   112 class NativeMovConstReg : public NativeInstruction {
   113  public:
   114   address next_instruction_address() const {
   115     ShouldNotCallThis();
   116   }
   118   intptr_t data() const {
   119     ShouldNotCallThis();
   120   }
   122   void set_data(intptr_t x) {
   123     ShouldNotCallThis();
   124   }
   125 };
   127 inline NativeMovConstReg* nativeMovConstReg_at(address address) {
   128   ShouldNotCallThis();
   129 }
   131 class NativeMovRegMem : public NativeInstruction {
   132  public:
   133   int offset() const {
   134     ShouldNotCallThis();
   135   }
   137   void set_offset(intptr_t x) {
   138     ShouldNotCallThis();
   139   }
   141   void add_offset_in_bytes(int add_offset) {
   142     ShouldNotCallThis();
   143   }
   144 };
   146 inline NativeMovRegMem* nativeMovRegMem_at(address address) {
   147   ShouldNotCallThis();
   148 }
   150 class NativeJump : public NativeInstruction {
   151  public:
   152   enum zero_specific_constants {
   153     instruction_size = 0 // not used within the interpreter
   154   };
   156   address jump_destination() const {
   157     ShouldNotCallThis();
   158   }
   160   void set_jump_destination(address dest) {
   161     ShouldNotCallThis();
   162   }
   164   static void check_verified_entry_alignment(address entry,
   165                                              address verified_entry) {
   166   }
   168   static void patch_verified_entry(address entry,
   169                                    address verified_entry,
   170                                    address dest);
   171 };
   173 inline NativeJump* nativeJump_at(address address) {
   174   ShouldNotCallThis();
   175 }
   177 class NativeGeneralJump : public NativeInstruction {
   178  public:
   179   address jump_destination() const {
   180     ShouldNotCallThis();
   181   }
   183   static void insert_unconditional(address code_pos, address entry) {
   184     ShouldNotCallThis();
   185   }
   187   static void replace_mt_safe(address instr_addr, address code_buffer) {
   188     ShouldNotCallThis();
   189   }
   190 };
   192 inline NativeGeneralJump* nativeGeneralJump_at(address address) {
   193   ShouldNotCallThis();
   194 }
   196 #endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP

mercurial