1f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project/* 2f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project 3f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 4f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 5f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * you may not use this file except in compliance with the License. 6f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * You may obtain a copy of the License at 7f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 8f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 9f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 10f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 11f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 12f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * See the License for the specific language governing permissions and 14f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * limitations under the License. 15f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 16f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 17f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Projectpackage com.android.dx.rop; 18f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project 19f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project/** 20f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h1>An Introduction to Rop Form</h1> 21f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 2299409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * This package contains classes associated with dx's {@code Rop} 23f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * intermediate form.<p> 24f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 25f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * The Rop form is intended to represent the instructions and the control-flow 26f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * graph in a reasonably programmatically useful form while closely mirroring 27f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the dex instruction set.<p> 28f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 29f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h2>Key Classes</h2> 30f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 31f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <ul> 32f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link RopMethod}, the representation of an individual method 33f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link BasicBlock} and its per-method container, {@link BasicBlockList}, 34f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the representation of control flow elements. 35f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link Insn} and its subclasses along with its per-basic block 3699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * container {@link InsnList}. {@code Insn} instances represent 37f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * individual instructions in the abstract register machine. 38f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link RegisterSpec} and its container {@link RegisterSpecList}. A 39f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * register spec encodes register number, register width, type information, 40f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * and potentially local variable information as well for instruction sources 41f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * and results. 42f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link Rop} instances represent opcodes in the abstract machine. Many 4399409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * {@code Rop} instances are singletons defined in static fields in 44f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link Rops}. The rest are constructed dynamically using static methods 4599409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * in {@code Rops} 46f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link RegOps} lists numeric constants for the opcodes 47f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link Constant} and its subclasses represent constant data values 48f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * that opcodes may refer to. 49f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> {@link Type} instances represent the core data types that can be 50f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * handled by the abstract machine. 51f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <li> The {@link TypeBearer} interface is implemented by classes that 52f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * represent a core data type, but may also have secondary information 53f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * (such as constant value) associated with them. 54f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <ul> 55f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 56f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h2>Control-Flow Graph</h2> 57f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 58f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Each method is separated into a list of basic blocks. For the most part, 59f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * basic blocks are referred to by a positive integer 60f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link BasicBlock#getLabel label}, which is always unique per method. The 61f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * label value is typically derived from a bytecode address from the source 62f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * bytecode. Blocks that don't originate directly from source bytecode have 63f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * labels generated for them in a mostly arbitrary order.<p> 64f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 6599409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * Blocks are referred to by their label, for the most part, because 6699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * {@code BasicBlock} instances are immutable and thus any modification to 67f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the control flow graph or the instruction list results in replacement 68f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instances (with identical labels) being created.<p> 69f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 70f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * A method has a single {@link RopMethod#getFirstLabel entry block} and 0 71f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * to N {@link RopMethod#getExitPredecessors exit predecessor blocks} which 72f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * will return. All blocks that are not the entry block will have at least 73f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * one predecessor (or are unreachable and should be removed from the block 74f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * list). All blocks that are not exit predecessors must have at least one 75f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * successor.<p> 76f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 77f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Since all blocks must branch, all blocks must have, as their final 78f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instruction, an instruction whose opcode has a {@link Rop#getBranchingness 79f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * branchingness} other than {@link Rop.BRANCH_NONE}. Furthermore, branching 80f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instructions may only be the final instruction in any basic block. If 81f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * no other terminating opcode is appropriate, use a {@link Rops#GOTO GOTO}.<p> 82f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 83f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Typically a block will have a {@link BasicBlock#getPrimarySuccessor 84f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * primary successor} which distinguishes a particular control flow path. 85f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * For {Rops#isCallLike}call or call-like} opcodes, this is the path taken 86f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * in the non-exceptional case, where all other successors represent 87f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * various exception paths. For comparison operators such as 88f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link Rops#IF_EQZ_INT}, the primary successor represents the path taken 89f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * if the <b>condition evaluates to false</b>. For {@link SwitchInsn switch 90f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instructions}, the primary successor is the default case.<p> 91f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 92f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * A basic block's successor list is ordered and may refer to unique labels 93f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * multiple times. For example, if a switch statement contains multiple case 94f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * statements for the same code path, a single basic block will likely 95f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * appear in the successor list multiple times. In general, the 96f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * significance of the successor list's order (like the significance of 97f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the primary successor) is a property of the final instruction of the basic 98f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * block. A basic block containing a {@link ThrowingInsn}, for example, has 99f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * its successor list in an order identical to the 100f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link ThrowingInsn#getCatches} instruction's catches list, with the 101f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * primary successor (the no-exception case) listed at the end. 102f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 103f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * It is legal for a basic block to have no primary successor. An obvious 104f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * example of this is a block that terminates in a {@link Rops#THROW throw} 105f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instruction where a catch block exists inside the current method for that 106f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * exception class. Since the only possible path is the exception path, only 107f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the exception path (which cannot be a primary successor) is a successor. 10899409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * An example of this is shown in {@code dx/tests/092-ssa-cfg-edge-cases}. 109f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 110f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h2>Rop Instructions</h2> 111f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 112f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h3>move-result and move-result-pseudo</h3> 113f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 114f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * An instruction that may throw an exception may not specify a result. This 115f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * is necessary because the result register will not be assigned to if an 116f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * exception occurs while processing said instruction and a result assignment 117f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * may not occur. Since result assignments only occur in the non-exceptional 118f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * case, the result assignments for throwing instructions can be said to occur 119f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * at the beginning of the primary successor block rather than at the end of 120f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the current block. The Rop form represents the result assignments this way. 121f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Throwing instructions may not directly specify results. Instead, result 122f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * assignments are represented by {@link 123f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Rops#MOVE_RESULT move-result} or {@link Rops#MOVE_RESULT_PSEUDO 124f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * move-result-pseudo} instructions at the top of the primary successor block. 125f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 12699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * Only a single {@code move-result} or {@code move-result-pseudo} 127f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * may exist in any block and it must be exactly the first instruction in the 128f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * block. 129f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 13099409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * A {@code move-result} instruction is used for the results of call-like 13199409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * instructions. If the value produced by a {@code move-result} is not 132f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * used by the method, it may be eliminated as dead code. 133f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 13499409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * A {@code move-result-pseudo} instruction is used for the results of 135f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * non-call-like throwing instructions. It may never be considered dead code 136f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * since the final dex instruction will always indicate a result register. 13799409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * If a required {@code move-result-pseudo} instruction is not found 138f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * during conversion to dex bytecode, an exception will be thrown. 139f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 140f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h3>move-exception</h3> 141f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 142f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * A {@link RegOps.MOVE_EXCEPTION move-exception} instruction may appear at 143f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the start of a catch block, and represents the obtaining of the thrown 144f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * exception instance. It may only occur as the first instruction in a 145f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * basic block, and any basic block in which it occurs must be reachable only 146f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * as an exception successor. 147f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 148f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h3>move-param</h3> 149f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 150f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * A {@link RegOps.MOVE_PARAM move-param} instruction represents a method 15199409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * parameter. Every {@code move-param} instruction is a 152f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link PlainCstInsn}. The index of the method parameter they refer to is 153f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * carried as the {@link CstInteger integer constant} associated with the 154f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instruction. 155f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 15699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * Any number of {@code move-param} instructions referring to the same 157f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * parameter index may be included in a method's instruction lists. They 158f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * have no restrictions on placement beyond those of any other 159f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link Rop.BRANCH_NONE} instruction. Note that the SSA optimizer arranges the 160f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * parameter assignments to align with the dex bytecode calling conventions. 161f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * With parameter assignments so arranged, the 16299409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * {@link com.android.dx.dex.code.RopTranslator} sees Rop {@code move-param} 163f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * instructions as unnecessary in dex form and eliminates them. 164f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 165f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * <h3>mark-local</h3> 166f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 167f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * A {@link RegOps.MARK_LOCAL mark-local} instruction indicates that a local 168f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * variable becomes live in a specified register specified register for the 16999409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * purposes of debug information. A {@code mark-local} instruction has 170f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * a single source (the register which will now be considered a local variable) 171f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * and no results. The instruction has no side effect.<p> 172f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 173f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * In a typical case, a local variable's lifetime begins with an 174f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * assignment. The local variable whose information is present in a result's 175f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * {@link RegisterSpec#getLocalItem LocalItem} is considered to begin (or move 176f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * between registers) when the instruction is executed.<p> 177f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 178f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * However, sometimes a local variable can begin its life or move without 179f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * an assignment occurring. A common example of this is occurs in the Rop 180f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * representation of the following code:<p> 181f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * 18299409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * <pre> 183f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * try { 184f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * Object foo = null; 185f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * foo = new Object(); 18699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * } catch (Throwable ex) { } 18799409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * </pre> 18899409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * 18999409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * An object's initialization occurs in two steps. First, a 19099409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * {@code new-instance} instruction is executed, whose result is stored in a 19199409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * register. However, that register can not yet be considered to contain 19299409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * "foo". That's because the instance's constructor method must be called 19399409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * via an {@code invoke} instruction. The constructor method, however, may 194f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * throw an exception. And if an exception occurs, then "foo" should remain 19599409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * null. So "foo" becomes the value of the result of the {@code new-instance} 19699409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * instruction after the (void) constructor method is invoked and 19799409883d9c4c0ffb49b070ce307bb33a9dfe9f1The Android Open Source Project * returns successfully. In such a case, a {@code mark-local} will 198f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * typically occur at the beginning of the primary successor block following 199f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project * the invocation to the constructor. 200f6c387128427e121477c1b32ad35cdcaa5101ba3The Android Open Source Project */ 201