/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* WARNING: The contents of this source file are not part of any
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
public
/**
* Constructor
*/
}
/**
* An empty statement. Its costInline is infinite.
*/
/**
* The largest possible interesting inline cost value.
*/
public static final int MAXINLINECOST =
30).intValue();
/**
* Insert a bit of code at the front of a statement.
* Side-effect s2, if it is a CompoundStatement.
*/
} else if (s2 instanceof CompoundStatement) {
// Do not add another level of block nesting.
} else {
}
return s2;
}
/**
* Set the label of a statement
*/
} else {
// this should almost never happen. Multiple labels on
// the same statement. But handle it gracefully.
}
} else {
}
}
/**
* Check a statement
*/
// Set up ctx.getReturnContext() for the sake of ReturnStatement.check().
// Check for return
// In general, we suppress further error messages due to
// unreachable statements after reporting the first error
// along a flow path (using 'clearDeadEnd'). Here, we
// report an error anyway, because the end of the method
// should be unreachable despite the earlier error. The
// difference in treatment is due to the fact that, in this
// case, the error is reachability, not unreachability.
// NOTE: In addition to this subtle difference in the quality
// of the error diagnostics, this treatment is essential to
// preserve the correctness of using 'clearDeadEnd' to implement
// the special-case reachability rules for if-then and if-then-else.
}
}
// Simulate a return at the end.
return vset;
}
throw new CompilerError("checkDeclaration");
}
/**
* Make sure the labels on this statement do not duplicate the
* labels on any enclosing statement. Provided as a convenience
* for subclasses.
*/
// Make sure there is not a double label on this statement.
continue loop;
}
}
// Make sure no enclosing statement has the same label.
// Check to make sure the label is in not uplevel.
}
}
} // end loop
}
}
throw new CompilerError("check");
}
/** This is called in contexts where declarations are valid. */
}
}
return vset;
}
/**
* Inline
*/
return this;
}
/**
* Eliminate this statement, which is only possible if it has no label.
*/
}
return s;
}
/**
* Code
*/
throw new CompilerError("code");
}
/**
* Generate the code to call all finally's for a break, continue, or
* return statement. We must call "jsr" on all the cleanup code between
* the current context "ctx", and the destination context "stopctx".
* If 'save' isn't null, there is also a value on the top of the stack
*/
boolean haveCleanup = false; // there is a finally or synchronize;
boolean haveNonLocalFinally = false; // some finally doesn't return;
continue;
haveCleanup = true;
// c.contLabel == null indicates we're in the "finally" part
haveCleanup = true;
if (!st.finallyCanFinish) {
haveNonLocalFinally = true;
// after hitting a non-local finally, no need generating
// further code, because it won't get executed.
break;
}
}
}
if (!haveCleanup) {
// there is no cleanup that needs to be done. Just quit.
return;
}
// This statement has a return value on the stack.
if (!haveNonLocalFinally) {
// Save the return value in the register which should have
// been reserved.
} else {
// Pop the return value.
case TC_VOID:
break;
default:
}
}
}
// Call each of the cleanup functions, as necessary.
continue;
if (st.finallyCanFinish) {
} else {
// the code never returns, so we're done.
break;
}
}
}
// Move the return value from the register back to the stack.
}
}
/*
* Return true if the statement has the given label
*/
return true;
}
}
}
return false;
}
/**
* Check if the first thing is a constructor invocation
*/
return null;
}
/**
* Create a copy of the statement for method inlining
*/
}
return thresh;
}
/**
* Print
*/
for (int i = 0 ; i < indent ; i++) {
}
}
}
}
}
}