annotate src/hotspot/share/runtime/continuation.hpp @ 53258:c0fa6641f5e6

merge
author rpressler
date Wed, 02 Jan 2019 17:06:50 +0000
parents 12235211dae8 a8fab0f44f6c
children cf30790dc86d
rev   line source
alanb@51115 1 /*
alanb@51115 2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
alanb@51115 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
alanb@51115 4 *
alanb@51115 5 * This code is free software; you can redistribute it and/or modify it
alanb@51115 6 * under the terms of the GNU General Public License version 2 only, as
alanb@51115 7 * published by the Free Software Foundation.
alanb@51115 8 *
alanb@51115 9 * This code is distributed in the hope that it will be useful, but WITHOUT
alanb@51115 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
alanb@51115 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
alanb@51115 12 * version 2 for more details (a copy is included in the LICENSE file that
alanb@51115 13 * accompanied this code).
alanb@51115 14 *
alanb@51115 15 * You should have received a copy of the GNU General Public License version
alanb@51115 16 * 2 along with this work; if not, write to the Free Software Foundation,
alanb@51115 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
alanb@51115 18 *
alanb@51115 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
alanb@51115 20 * or visit www.oracle.com if you need additional information or have any
alanb@51115 21 * questions.
alanb@51115 22 *
alanb@51115 23 */
alanb@51115 24
alanb@51115 25 #ifndef SHARE_VM_RUNTIME_CONTINUATION_HPP
alanb@51115 26 #define SHARE_VM_RUNTIME_CONTINUATION_HPP
alanb@51115 27
alanb@51115 28 #include "runtime/globals.hpp"
alanb@51115 29
alanb@51115 30 #define CONT_FULL_STACK (!UseNewCode)
alanb@51115 31
alanb@51115 32 // The order of this struct matters as it's directly manipulated by assembly code (push/pop)
alanb@51115 33 struct FrameInfo {
alanb@51115 34 address pc;
alanb@51115 35 intptr_t* fp;
alanb@51115 36 intptr_t* sp;
alanb@51115 37 };
alanb@51115 38
alanb@51115 39 class Continuations : public AllStatic {
alanb@51115 40 private:
alanb@51115 41 static volatile long _exploded_miss;
alanb@51115 42 static volatile long _exploded_hit;
alanb@51115 43 static volatile long _nmethod_hit;
alanb@51115 44 static volatile long _nmethod_miss;
alanb@51115 45 public:
alanb@51115 46 static void exploded_miss();
alanb@51115 47 static void exploded_hit();
alanb@51115 48 static void nmethod_miss();
alanb@51115 49 static void nmethod_hit();
alanb@51115 50
alanb@51115 51 static void print_statistics();
alanb@51115 52 };
alanb@51115 53
alanb@51115 54 class Continuation : AllStatic {
alanb@51115 55 public:
rpressler@52874 56 static int freeze0(JavaThread* thread, FrameInfo* fi, bool safepoint_yield);
alanb@51115 57 static int freeze(JavaThread* thread, FrameInfo* fi);
alanb@51115 58 static int prepare_thaw(FrameInfo* fi, bool return_barrier);
rpressler@52081 59 static address thaw(FrameInfo* fi, bool return_barrier, bool exception);
rpressler@52874 60 static int try_force_yield(JavaThread* thread, oop cont);
alanb@51115 61
rpressler@52061 62 static bool is_continuation_entry_frame(const frame& f, const RegisterMap* map);
alanb@51115 63 static bool is_cont_bottom_frame(const frame& f);
rpressler@52874 64 static bool is_return_barrier_entry(const address pc);
rpressler@51287 65 static bool is_frame_in_continuation(JavaThread* thread, const frame& f);
alanb@51115 66 static address fix_continuation_bottom_sender(const frame* callee, RegisterMap* map, address pc);
rpressler@51923 67
rpressler@51923 68 static frame top_frame(const frame& callee, RegisterMap* map);
rpressler@51923 69 static frame sender_for_interpreter_frame(const frame& callee, RegisterMap* map);
rbackman@52455 70 static frame sender_for_compiled_frame(const frame& callee, RegisterMap* map);
rpressler@51923 71
rpressler@53257 72 static bool has_last_Java_frame(Handle continuation);
rpressler@53257 73 static frame last_frame(Handle continuation, RegisterMap *map);
rpressler@53257 74 static javaVFrame* last_java_vframe(Handle continuation, RegisterMap *map);
rpressler@53017 75
rpressler@51923 76 // access frame data
rpressler@51923 77 static address usp_offset_to_location(const frame& fr, const RegisterMap* map, const int usp_offset_in_bytes);
rpressler@53017 78 static address usp_offset_to_location(const frame& fr, const RegisterMap* map, const int usp_offset_in_bytes, bool is_oop);
rpressler@51923 79 static address interpreter_frame_expression_stack_at(const frame& fr, const RegisterMap* map, const InterpreterOopMap& oop_mask, int index);
rpressler@51923 80 static address interpreter_frame_local_at(const frame& fr, const RegisterMap* map, const InterpreterOopMap& oop_mask, int index);
rpressler@51923 81
rpressler@51923 82 static Method* interpreter_frame_method(const frame& fr, const RegisterMap* map);
rpressler@51923 83 static address interpreter_frame_bcp(const frame& fr, const RegisterMap* map);
rpressler@52061 84
rpressler@52874 85 static oop continuation_scope(oop cont);
rpressler@52061 86 static bool is_scope_bottom(oop cont_scope, const frame& fr, const RegisterMap* map);
rpressler@51923 87
rpressler@52066 88 static int PERFTEST_LEVEL;
rpressler@51923 89 private:
rpressler@51923 90 // declared here as it's used in friend declarations
rpressler@51923 91 static address oop_address(objArrayOop ref_stack, address stack_address);
alanb@51115 92 };
alanb@51115 93
alanb@51115 94 void CONT_RegisterNativeMethods(JNIEnv *env, jclass cls);
alanb@51115 95
alanb@51115 96 #endif // SHARE_VM_RUNTIME_CONTINUATION_HPP