src/share/vm/runtime/javaFrameAnchor.hpp

Tue, 05 Apr 2011 14:12:31 -0700

author
trims
date
Tue, 05 Apr 2011 14:12:31 -0700
changeset 2708
1d1603768966
parent 2508
b92c45f2bc75
child 3156
f08d439fab8c
permissions
-rw-r--r--

7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
Summary: Update the copyright to be 2010 on all changed files in OpenJDK
Reviewed-by: ohair

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
duke@435 53 //
duke@435 54 // An object for encapsulating the machine/os dependent part of a JavaThread frame state
duke@435 55 //
duke@435 56 class JavaThread;
duke@435 57
duke@435 58 class JavaFrameAnchor VALUE_OBJ_CLASS_SPEC {
duke@435 59 // Too many friends...
duke@435 60 friend class CallNativeDirectNode;
duke@435 61 friend class OptoRuntime;
duke@435 62 friend class Runtime1;
duke@435 63 friend class StubAssembler;
duke@435 64 friend class CallRuntimeDirectNode;
duke@435 65 friend class MacroAssembler;
duke@435 66 friend class InterpreterGenerator;
duke@435 67 friend class LIR_Assembler;
duke@435 68 friend class GraphKit;
duke@435 69 friend class StubGenerator;
duke@435 70 friend class JavaThread;
duke@435 71 friend class frame;
duke@435 72 friend class VMStructs;
duke@435 73 friend class BytecodeInterpreter;
duke@435 74 friend class JavaCallWrapper;
duke@435 75
duke@435 76 private:
duke@435 77 //
duke@435 78 // Whenever _last_Java_sp != NULL other anchor fields MUST be valid!
duke@435 79 // The stack may not be walkable [check with walkable() ] but the values must be valid.
duke@435 80 // The profiler apparently depends on this.
duke@435 81 //
duke@435 82 intptr_t* volatile _last_Java_sp;
duke@435 83
duke@435 84 // Whenever we call from Java to native we can not be assured that the return
duke@435 85 // address that composes the last_Java_frame will be in an accessible location
duke@435 86 // so calls from Java to native store that pc (or one good enough to locate
duke@435 87 // the oopmap) in the frame anchor. Since the frames that call from Java to
duke@435 88 // native are never deoptimized we never need to patch the pc and so this
duke@435 89 // is acceptable.
duke@435 90 volatile address _last_Java_pc;
duke@435 91
duke@435 92 // tells whether the last Java frame is set
duke@435 93 // It is important that when last_Java_sp != NULL that the rest of the frame
duke@435 94 // anchor (including platform specific) all be valid.
duke@435 95
duke@435 96 bool has_last_Java_frame() const { return _last_Java_sp != NULL; }
duke@435 97 // This is very dangerous unless sp == NULL
duke@435 98 // Invalidate the anchor so that has_last_frame is false
duke@435 99 // and no one should look at the other fields.
duke@435 100 void zap(void) { _last_Java_sp = NULL; }
duke@435 101
stefank@2314 102 #ifdef TARGET_ARCH_x86
stefank@2314 103 # include "javaFrameAnchor_x86.hpp"
stefank@2314 104 #endif
stefank@2314 105 #ifdef TARGET_ARCH_sparc
stefank@2314 106 # include "javaFrameAnchor_sparc.hpp"
stefank@2314 107 #endif
stefank@2314 108 #ifdef TARGET_ARCH_zero
stefank@2314 109 # include "javaFrameAnchor_zero.hpp"
stefank@2314 110 #endif
bobv@2508 111 #ifdef TARGET_ARCH_arm
bobv@2508 112 # include "javaFrameAnchor_arm.hpp"
bobv@2508 113 #endif
bobv@2508 114 #ifdef TARGET_ARCH_ppc
bobv@2508 115 # include "javaFrameAnchor_ppc.hpp"
bobv@2508 116 #endif
stefank@2314 117
duke@435 118
duke@435 119 public:
duke@435 120 JavaFrameAnchor() { clear(); }
duke@435 121 JavaFrameAnchor(JavaFrameAnchor *src) { copy(src); }
duke@435 122
duke@435 123 void set_last_Java_pc(address pc) { _last_Java_pc = pc; }
duke@435 124
duke@435 125 // Assembly stub generation helpers
duke@435 126
duke@435 127 static ByteSize last_Java_sp_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_sp); }
duke@435 128 static ByteSize last_Java_pc_offset() { return byte_offset_of(JavaFrameAnchor, _last_Java_pc); }
duke@435 129
duke@435 130 };
stefank@2314 131
stefank@2314 132 #endif // SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP

mercurial