2668N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2668N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2668N/A * This code is free software; you can redistribute it and/or modify it 2668N/A * under the terms of the GNU General Public License version 2 only, as 2668N/A * published by the Free Software Foundation. Oracle designates this 2668N/A * particular file as subject to the "Classpath" exception as provided 2668N/A * by Oracle in the LICENSE file that accompanied this code. 2668N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2668N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2668N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2668N/A * version 2 for more details (a copy is included in the LICENSE file that 2668N/A * You should have received a copy of the GNU General Public License version 2668N/A * 2 along with this work; if not, write to the Free Software Foundation, 2668N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2668N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2668N/A * or visit www.oracle.com if you need additional information or have any 2668N/Apackage xmlkit;
// -*- mode: java; indent-tabs-mode: nil -*- 2668N/A // Unpack instructions into temp. arrays, and find branches and labels. 2668N/A continue;
// delete PC holder element 2668N/A // Compute instruction sizes. These sizes are final, 2668N/A // except for branch instructions, which may need lengthening. 2668N/A // Some instructions (ldc, bipush, iload, iinc) are automagically widened. 2668N/A // Make sure operands fit within the given format. 2668N/A j++;
// skip type-of-constant marker 2668N/A assert (x >=
0 && x <= ((j ==
jlimit -
1) ?
0xFF :
0xFFFF));
2668N/A assert (
false);
// cannot lengthen 2668N/A // unsign the value now, to make later steps clearer 2668N/A // make local copies of the branches, and fix up labels 2668N/A // switch table is represented as Switch.Case sub-elements 2668N/A // compute branch offsets, and see if any branches need expansion 2668N/A //System.out.println("branch id="+id+" len="+insSize+" to="+target+" offset="+offset); 2668N/A break;
// done, usually on first try 2668N/A // Walk over all instructions, expanding branches and updating locations. 2668N/A // done expanding: ops and isWide reflect the decision 2668N/A // notify the caller of offsets, if requested 2668N/A //System.out.println("output id="+id+" loc="+insLocs[id]+" len="+(insLocs[id+1]-insLocs[id])+" #sbuf="+sbuf.length()); 2668N/A // emit <ifop lab=1f> <goto_w target> <label pc=1f> 2668N/A }
else if (
op ==
0xaa ||
//tableswitch 2668N/A // a single-byte instruction 2668N/A case 0xc5:
//multianewarray 2668N/A case 0xb9:
//invokeinterface 2668N/A // put the single operand and be done 2668N/A //System.out.println("getCPIndex "+ins+" => "+tag+"/"+val+" => "+x); 2668N/A //System.out.println("putInt x="+x+" len="+len);