src/share/vm/runtime/javaFrameAnchor.hpp

Fri, 29 Apr 2016 00:06:10 +0800

author
aoqi
date
Fri, 29 Apr 2016 00:06:10 +0800
changeset 1
2d8a650513c2
parent 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Added MIPS 64-bit port.

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@1 25 /*
aoqi@1 26 * This file has been modified by Loongson Technology in 2015. These
aoqi@1 27 * modifications are Copyright (c) 2015 Loongson Technology, and are made
aoqi@1 28 * available on the same license terms set forth above.
aoqi@1 29 */
aoqi@1 30
aoqi@0 31 #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
aoqi@0 32 #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP
aoqi@0 33
aoqi@0 34 #include "utilities/globalDefinitions.hpp"
aoqi@0 35 #ifdef TARGET_OS_ARCH_linux_x86
aoqi@0 36 # include "orderAccess_linux_x86.inline.hpp"
aoqi@0 37 #endif
aoqi@0 38 #ifdef TARGET_OS_ARCH_linux_sparc
aoqi@0 39 # include "orderAccess_linux_sparc.inline.hpp"
aoqi@0 40 #endif
aoqi@1 41 #ifdef TARGET_OS_ARCH_linux_mips
aoqi@1 42 # include "orderAccess_linux_mips.inline.hpp"
aoqi@1 43 #endif
aoqi@0 44 #ifdef TARGET_OS_ARCH_linux_zero
aoqi@0 45 # include "orderAccess_linux_zero.inline.hpp"
aoqi@0 46 #endif
aoqi@0 47 #ifdef TARGET_OS_ARCH_solaris_x86
aoqi@0 48 # include "orderAccess_solaris_x86.inline.hpp"
aoqi@0 49 #endif
aoqi@0 50 #ifdef TARGET_OS_ARCH_solaris_sparc
aoqi@0 51 # include "orderAccess_solaris_sparc.inline.hpp"
aoqi@0 52 #endif
aoqi@0 53 #ifdef TARGET_OS_ARCH_windows_x86
aoqi@0 54 # include "orderAccess_windows_x86.inline.hpp"
aoqi@0 55 #endif
aoqi@0 56 #ifdef TARGET_OS_ARCH_linux_arm
aoqi@0 57 # include "orderAccess_linux_arm.inline.hpp"
aoqi@0 58 #endif
aoqi@0 59 #ifdef TARGET_OS_ARCH_linux_ppc
aoqi@0 60 # include "orderAccess_linux_ppc.inline.hpp"
aoqi@0 61 #endif
aoqi@0 62 #ifdef TARGET_OS_ARCH_aix_ppc
aoqi@0 63 # include "orderAccess_aix_ppc.inline.hpp"
aoqi@0 64 #endif
aoqi@0 65 #ifdef TARGET_OS_ARCH_bsd_x86
aoqi@0 66 # include "orderAccess_bsd_x86.inline.hpp"
aoqi@0 67 #endif
aoqi@0 68 #ifdef TARGET_OS_ARCH_bsd_zero
aoqi@0 69 # include "orderAccess_bsd_zero.inline.hpp"
aoqi@0 70 #endif
aoqi@0 71
aoqi@0 72 //
aoqi@0 73 // An object for encapsulating the machine/os dependent part of a JavaThread frame state
aoqi@0 74 //
aoqi@0 75 class JavaThread;
aoqi@0 76
aoqi@0 77 class JavaFrameAnchor VALUE_OBJ_CLASS_SPEC {
aoqi@0 78 // Too many friends...
aoqi@0 79 friend class CallNativeDirectNode;
aoqi@0 80 friend class OptoRuntime;
aoqi@0 81 friend class Runtime1;
aoqi@0 82 friend class StubAssembler;
aoqi@0 83 friend class CallRuntimeDirectNode;
aoqi@0 84 friend class MacroAssembler;
aoqi@0 85 friend class InterpreterGenerator;
aoqi@0 86 friend class LIR_Assembler;
aoqi@0 87 friend class GraphKit;
aoqi@0 88 friend class StubGenerator;
aoqi@0 89 friend class JavaThread;
aoqi@0 90 friend class frame;
aoqi@0 91 friend class VMStructs;
aoqi@0 92 friend class BytecodeInterpreter;
aoqi@0 93 friend class JavaCallWrapper;
aoqi@0 94
aoqi@0 95 private:
aoqi@0 96 //
aoqi@0 97 // Whenever _last_Java_sp != NULL other anchor fields MUST be valid!
aoqi@0 98 // The stack may not be walkable [check with walkable() ] but the values must be valid.
aoqi@0 99 // The profiler apparently depends on this.
aoqi@0 100 //
aoqi@0 101 intptr_t* volatile _last_Java_sp;
aoqi@0 102
aoqi@0 103 // Whenever we call from Java to native we can not be assured that the return
aoqi@0 104 // address that composes the last_Java_frame will be in an accessible location
aoqi@0 105 // so calls from Java to native store that pc (or one good enough to locate
aoqi@0 106 // the oopmap) in the frame anchor. Since the frames that call from Java to
aoqi@0 107 // native are never deoptimized we never need to patch the pc and so this
aoqi@0 108 // is acceptable.
aoqi@0 109 volatile address _last_Java_pc;
aoqi@0 110
aoqi@0 111 // tells whether the last Java frame is set
aoqi@0 112 // It is important that when last_Java_sp != NULL that the rest of the frame
aoqi@0 113 // anchor (including platform specific) all be valid.
aoqi@0 114
aoqi@0 115 bool has_last_Java_frame() const { return _last_Java_sp != NULL; }
aoqi@0 116 // This is very dangerous unless sp == NULL
aoqi@0 117 // Invalidate the anchor so that has_last_frame is false
aoqi@0 118 // and no one should look at the other fields.
aoqi@0 119 void zap(void) { _last_Java_sp = NULL; }
aoqi@0 120
aoqi@0 121 #ifdef TARGET_ARCH_x86
aoqi@0 122 # include "javaFrameAnchor_x86.hpp"
aoqi@0 123 #endif
aoqi@1 124 #ifdef TARGET_ARCH_mips
aoqi@1 125 # include "javaFrameAnchor_mips.hpp"
aoqi@1 126 #endif
aoqi@0 127 #ifdef TARGET_ARCH_sparc
aoqi@0 128 # include "javaFrameAnchor_sparc.hpp"
aoqi@0 129 #endif
aoqi@0 130 #ifdef TARGET_ARCH_zero
aoqi@0 131 # include "javaFrameAnchor_zero.hpp"
aoqi@0 132 #endif
aoqi@0 133 #ifdef TARGET_ARCH_arm
aoqi@0 134 # include "javaFrameAnchor_arm.hpp"
aoqi@0 135 #endif
aoqi@0 136 #ifdef TARGET_ARCH_ppc
aoqi@0 137 # include "javaFrameAnchor_ppc.hpp"
aoqi@0 138 #endif
aoqi@0 139
aoqi@0 140
aoqi@0 141 public:
aoqi@0 142 JavaFrameAnchor() { clear(); }
aoqi@0 143 JavaFrameAnchor(JavaFrameAnchor *src) { copy(src); }
aoqi@0 144
aoqi@0 145 void set_last_Java_pc(address pc) { _last_Java_pc = pc; }
aoqi@0 146
aoqi@0 147 // Assembly stub generation helpers
aoqi@0 148
aoqi@0 149 static ByteSize last_Java_sp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_sp); }
aoqi@0 150 static ByteSize last_Java_pc_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_pc); }
aoqi@0 151
aoqi@0 152 };
aoqi@0 153
aoqi@0 154 #endif // SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP

mercurial