1 /*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5 package com.sun.org.apache.bcel.internal.util;
6
7 import com.sun.org.apache.bcel.internal.generic.*;
8 import com.sun.org.apache.bcel.internal.classfile.Utility;
9 import com.sun.org.apache.bcel.internal.Constants;
10 import java.io.PrintWriter;
11 import java.util.*;
12
13 /* ====================================================================
14 * The Apache Software License, Version 1.1
15 *
16 * Copyright (c) 2002 The Apache Software Foundation. All rights
17 * reserved.
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 *
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 *
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in
28 * the documentation and/or other materials provided with the
29 * distribution.
30 *
31 * 3. The end-user documentation included with the redistribution,
32 * if any, must include the following acknowledgment:
33 * "This product includes software developed by the
34 * Apache Software Foundation (http://www.apache.org/)."
35 * Alternately, this acknowledgment may appear in the software itself,
36 * if and wherever such third-party acknowledgments normally appear.
37 *
38 * 4. The names "Apache" and "Apache Software Foundation" and
39 * "Apache BCEL" must not be used to endorse or promote products
40 * derived from this software without prior written permission. For
41 * written permission, please contact apache@apache.org.
42 *
43 * 5. Products derived from this software may not be called "Apache",
44 * "Apache BCEL", nor may "Apache" appear in their name, without
45 * prior written permission of the Apache Software Foundation.
46 *
47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
48 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
51 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
52 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
53 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
54 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
55 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
57 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 * ====================================================================
60 *
61 * This software consists of voluntary contributions made by many
62 * individuals on behalf of the Apache Software Foundation. For more
63 * information on the Apache Software Foundation, please see
64 * <http://www.apache.org/>.
65 */
66
67 /**
68 * Factory creates il.append() statements, and sets instruction targets.
69 * A helper class for BCELifier.
70 *
71 * @see BCELifier
72 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
73 */
74 class BCELFactory extends EmptyVisitor {
75 private MethodGen _mg;
76 private PrintWriter _out;
77 private ConstantPoolGen _cp;
78
79 BCELFactory(MethodGen mg, PrintWriter out) {
80 _mg = mg;
81 _cp = mg.getConstantPool();
82 _out = out;
83 }
84
85 private HashMap branch_map = new HashMap(); // Map<Instruction, InstructionHandle>
|
1 /*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5 /*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22 package com.sun.org.apache.bcel.internal.util;
23
24 import com.sun.org.apache.bcel.internal.generic.*;
25 import com.sun.org.apache.bcel.internal.classfile.Utility;
26 import com.sun.org.apache.bcel.internal.Constants;
27 import java.io.PrintWriter;
28 import java.util.*;
29
30
31 /**
32 * Factory creates il.append() statements, and sets instruction targets.
33 * A helper class for BCELifier.
34 *
35 * @see BCELifier
36 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
37 */
38 class BCELFactory extends EmptyVisitor {
39 private MethodGen _mg;
40 private PrintWriter _out;
41 private ConstantPoolGen _cp;
42
43 BCELFactory(MethodGen mg, PrintWriter out) {
44 _mg = mg;
45 _cp = mg.getConstantPool();
46 _out = out;
47 }
48
49 private HashMap branch_map = new HashMap(); // Map<Instruction, InstructionHandle>
|