src/share/vm/runtime/javaFrameAnchor.hpp

Tue, 23 Nov 2010 13:22:55 -0800

author
stefank
date
Tue, 23 Nov 2010 13:22:55 -0800
changeset 2314
f95d63e2154a
parent 2036
126ea7725993
child 2508
b92c45f2bc75
permissions
-rw-r--r--

6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions.
Reviewed-by: coleenp, kvn, kamg

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

mercurial