src/share/vm/runtime/javaFrameAnchor.hpp

Thu, 22 Aug 2013 09:39:54 -0700

author
goetz
date
Thu, 22 Aug 2013 09:39:54 -0700
changeset 6461
bdd155477289
parent 3156
f08d439fab8c
child 6876
710a3c8b516e
child 6911
ce8f6bb717c9
permissions
-rw-r--r--

8023033: PPC64 (part 13): basic changes for AIX
Summary: Added AIX includes alpha-sorted before BSD. Fix compilation issues with xlC in shared code. Basic shared platform dependend adaption (vm_version etc.).
Reviewed-by: kvn, dholmes, stefank

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

mercurial