< prev index next >

src/java.base/share/classes/java/lang/StackFrameInfo.java

Print this page
*** 24,21 ***
   */
  package java.lang;
  
  import jdk.internal.access.JavaLangInvokeAccess;
  import jdk.internal.access.SharedSecrets;
  
  import java.lang.StackWalker.StackFrame;
  import java.lang.invoke.MethodType;
  
  class StackFrameInfo implements StackFrame {
      private static final JavaLangInvokeAccess JLIA =
          SharedSecrets.getJavaLangInvokeAccess();
  
      private final boolean retainClassRef;
!     private final Object memberName;    // MemberName initialized by VM
!     private int bci;                    // initialized by VM to >= 0
      private volatile StackTraceElement ste;
  
      /*
       * Construct an empty StackFrameInfo object that will be filled by the VM
       * during stack walking.
--- 24,25 ---
   */
  package java.lang;
  
  import jdk.internal.access.JavaLangInvokeAccess;
  import jdk.internal.access.SharedSecrets;
+ import jdk.internal.vm.Continuation;
+ import jdk.internal.vm.ContinuationScope;
  
  import java.lang.StackWalker.StackFrame;
  import java.lang.invoke.MethodType;
+ import java.lang.reflect.Method;
  
  class StackFrameInfo implements StackFrame {
      private static final JavaLangInvokeAccess JLIA =
          SharedSecrets.getJavaLangInvokeAccess();
  
      private final boolean retainClassRef;
!     private Object memberName;    // MemberName initialized by VM
!     private int bci;              // initialized by VM to >= 0
+     private ContinuationScope contScope;
      private volatile StackTraceElement ste;
  
      /*
       * Construct an empty StackFrameInfo object that will be filled by the VM
       * during stack walking.

*** 55,10 ***
--- 59,25 ---
      // the capability check
      Class<?> declaringClass() {
          return JLIA.getDeclaringClass(memberName);
      }
  
+     void setMemberName(Method method) {
+         this.memberName = JLIA.newMemberName(method);
+     }
+ 
+     void setBCI(short bci) {
+         this.bci = bci;
+     }
+ 
+     void setContinuationScope(ContinuationScope contScope) {
+         this.contScope = contScope;
+     }
+     
+     protected void clear() {
+     }
+ 
      // ----- implementation of StackFrame methods
  
      @Override
      public String getClassName() {
          return declaringClass().getName();

*** 113,10 ***
--- 132,15 ---
      @Override
      public boolean isNativeMethod() {
          return JLIA.isNative(memberName);
      }
  
+     @Override
+     public java.lang.String getContinuationScopeName() {
+         return contScope != null ? contScope.getName() : null;
+     }
+ 
      @Override
      public String toString() {
          return toStackTraceElement().toString();
      }
  
< prev index next >