< prev index next >

src/hotspot/share/runtime/continuation.hpp

Print this page
@@ -24,10 +24,11 @@
  
  #ifndef SHARE_VM_RUNTIME_CONTINUATION_HPP
  #define SHARE_VM_RUNTIME_CONTINUATION_HPP
  
  #include "jni.h"
+ #include "classfile/javaClasses.hpp"
  #include "memory/allStatic.hpp"
  #include "oops/oopsHierarchy.hpp"
  
  class ContinuationEntry;
  class frame;

@@ -45,10 +46,22 @@
  void continuations_init();
  
  class javaVFrame;
  class JavaThread;
  
+ // should match Continuation.toPreemptStatus() in Continuation.java
+ enum freeze_result {
+   freeze_ok = 0,
+   freeze_ok_bottom = 1,
+   freeze_pinned_cs = 2,
+   freeze_pinned_native = 3,
+   freeze_pinned_monitor = 4,
+   freeze_exception = 5,
+   freeze_not_mounted = 6,
+   unsupported = 7
+ };
+ 
  class Continuation : AllStatic {
  public:
  
    enum thaw_kind {
      thaw_top = 0,

@@ -67,18 +80,24 @@
    }
  
    static void init();
  
    static address freeze_entry();
+   static address freeze_preempt_entry();
    static int prepare_thaw(JavaThread* thread, bool return_barrier);
    static address thaw_entry();
  
+   static int try_preempt(JavaThread* target, oop continuation, bool set_state_yielding = false);
+ 
    static ContinuationEntry* get_continuation_entry_for_continuation(JavaThread* thread, oop continuation);
    static ContinuationEntry* get_continuation_entry_for_sp(JavaThread* thread, intptr_t* const sp);
    static ContinuationEntry* get_continuation_entry_for_entry_frame(JavaThread* thread, const frame& f);
  
    static bool is_continuation_mounted(JavaThread* thread, oop continuation);
+   static bool is_continuation_preempted(oop cont);
+   static bool is_continuation_done(oop cont);
+ 
  
    static bool is_cont_barrier_frame(const frame& f);
    static bool is_return_barrier_entry(const address pc);
    static bool is_continuation_enterSpecial(const frame& f);
    static bool is_continuation_entry_frame(const frame& f, const RegisterMap *map);
< prev index next >