2362N/A * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * WARNING: The contents of this source file are not part of any 0N/A * supported API. Code that depends on them does so at its own risk: 0N/A * they are subject to change or removal without notice. 0N/A // Check 'try' block. A variable is DA (DU) before the try 0N/A // block if it is DA (DU) before the try statement. 0N/A // A variable is DA before a catch block if it is DA before the 0N/A // try statement. A variable is DU before a catch block if it 0N/A // is DU after the try block and before any 'break', 'continue', 0N/A // 'throw', or 'return' contained therein. That is, the variable 0N/A // is DU upon entry to the try-statement and is not assigned to 0N/A // anywhere within the try block. 0N/A // A variable is DA (DU) after a try statement if 0N/A // it is DA (DU) after every catch block. 0N/A // Check that catch statements are actually reached 0N/A for (
int j =
0 ; j < i ; j++) {
0N/A // Make sure the exception is actually throw in that part of the code 0N/A // CatchStatement.checkValue() will have already printed 0N/A // Anyone can throw these! 0N/A // Make sure the exception is actually throw in that part of the code 0N/A // Only carry over exceptions that are not caught 0N/A // A variable is DA (DU) after a try statement if it is DA (DU) 0N/A // after the try block and after every catch block. These variables 0N/A // are represented by 'vs'. If the try statement is labelled, we 0N/A // may also exit from it (including from within a catch block) via 0N/A // a break statement. 0N/A // If there is a finally block, the Vset returned here is further 0N/A // adjusted. Note that this 'TryStatement' node will be a child of 0N/A // a 'FinallyStatement' node in that case. 0N/A * Create a copy of the statement for method inlining 0N/A * Compute cost of inlining this statement 0N/A // Don't inline methods containing try statements. 0N/A // If the try statement is being inlined in order to 0N/A // inline a method that returns a value which is 0N/A // a subexpression of an expression involving the 0N/A // operand stack, then the early operands may get lost. 0N/A // This shows up as a verifier error. For example, 0N/A // in the following: 0N/A // public static int test() { 0N/A // try { return 2; } catch (Exception e) { return 0; } 0N/A // System.out.println(test()); 0N/A // an inlined call to test() might look like this: 0N/A // 0 getstatic <Field java.io.PrintStream out> 0N/A // 9 invokevirtual <Method void println(int)> 0N/A // from to target type 0N/A // 3 7 7 <Class java.lang.Exception> 0N/A // This fails to verify because the operand stored 0N/A // for System.out gets axed at an exception, leading to 0N/A // an inconsistent stack depth at pc=7. 0N/A // Note that although all code must be able to be inlined 0N/A // to implement initializers, this problem doesn't come up, 0N/A // as try statements themselves can never be expressions. 0N/A // It suffices here to make sure they are never inlined as part