nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JumpStatement.java
changeset 28690 78317797ab62
parent 27204 06ec78f29a56
equal deleted inserted replaced
28597:b2f9702efbe9 28690:78317797ab62
    99      * to invoke the method on a jump statement that targets the breakable.
    99      * to invoke the method on a jump statement that targets the breakable.
   100      * @return the label of the target corresponding to the kind of jump statement.
   100      * @return the label of the target corresponding to the kind of jump statement.
   101      * @throws ClassCastException if invoked on the kind of breakable node that this jump statement is not prepared to
   101      * @throws ClassCastException if invoked on the kind of breakable node that this jump statement is not prepared to
   102      * handle.
   102      * handle.
   103      */
   103      */
   104     public abstract Label getTargetLabel(final BreakableNode target);
   104     abstract Label getTargetLabel(final BreakableNode target);
       
   105 
       
   106     /**
       
   107      * Returns the label this jump statement targets.
       
   108      * @param lc the lexical context
       
   109      * @return the label this jump statement targets.
       
   110      */
       
   111     public Label getTargetLabel(final LexicalContext lc) {
       
   112         return getTargetLabel(getTarget(lc));
       
   113     }
       
   114 
       
   115     /**
       
   116      * Returns the limit node for popping scopes when this jump statement is effected.
       
   117      * @param lc the current lexical context
       
   118      * @return the limit node for popping scopes when this jump statement is effected.
       
   119      */
       
   120     public LexicalContextNode getPopScopeLimit(final LexicalContext lc) {
       
   121         // In most cases (break and continue) this is equal to the target.
       
   122         return getTarget(lc);
       
   123     }
   105 
   124 
   106     @Override
   125     @Override
   107     public JumpStatement setLocalVariableConversion(final LexicalContext lc, final LocalVariableConversion conversion) {
   126     public JumpStatement setLocalVariableConversion(final LexicalContext lc, final LocalVariableConversion conversion) {
   108         if(this.conversion == conversion) {
   127         if(this.conversion == conversion) {
   109             return this;
   128             return this;