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 23 package com.sun.org.apache.xalan.internal.xsltc.compiler.util; 24 import java.io.DataOutputStream; 25 import java.io.IOException; 26 27 import com.sun.org.apache.bcel.internal.Constants; 28 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; 29 import com.sun.org.apache.bcel.internal.generic.Instruction; 30 import com.sun.org.apache.bcel.internal.generic.Visitor; 31 32 /** 33 * A special abstract dummy subclass of 34 * {@link org.apache.bcel.generic.Instruction} used to mark locations of 35 * interest in an {@link com.sun.org.apache.bcel.internal.generic.InstructionList}. It and 36 * its subclasses are only used as placeholders, and do not contribute to the 37 * actual byte code instruction stream. 38 */ 39 abstract class MarkerInstruction extends Instruction { 40 /** 41 * Zero-argument constructor. Sets the opcode to an invalid value and 42 * sets the length to zero, as it will not be written as part of the 43 * generated byte code. 44 */ 45 public MarkerInstruction() { 46 super(Constants.UNDEFINED, (short) 0); 47 } 48 49 /** 50 * {@link com.sun.org.apache.bcel.internal.generic.Visitor}s will know nothing about this 51 * kind of {@link org.apche.bcel.generic.Instruction}, so this method does 52 * nothing. 53 */ 54 public void accept(Visitor v) { 55 } 56 57 /** 58 * The number of JVM stack entries consumed by the instruction. 59 * This instruction is just a place holder, so it does not consume any 60 * stack entries. 61 * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the 62 * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen} 63 * @return <code>0</code> always 64 */ 65 final public int consumeStack(ConstantPoolGen cpg) { 66 return 0; | 1 /* 2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 */ 4 /* 5 * Licensed to the Apache Software Foundation (ASF) under one or more 6 * contributor license agreements. See the NOTICE file distributed with 7 * this work for additional information regarding copyright ownership. 8 * The ASF licenses this file to You under the Apache License, Version 2.0 9 * (the "License"); you may not use this file except in compliance with 10 * the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 22 package com.sun.org.apache.xalan.internal.xsltc.compiler.util; 23 import java.io.DataOutputStream; 24 import java.io.IOException; 25 26 import com.sun.org.apache.bcel.internal.Const; 27 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; 28 import com.sun.org.apache.bcel.internal.generic.Instruction; 29 import com.sun.org.apache.bcel.internal.generic.Visitor; 30 31 /** 32 * A special abstract dummy subclass of 33 * {@link org.apache.bcel.generic.Instruction} used to mark locations of 34 * interest in an {@link com.sun.org.apache.bcel.internal.generic.InstructionList}. It and 35 * its subclasses are only used as placeholders, and do not contribute to the 36 * actual byte code instruction stream. 37 */ 38 abstract class MarkerInstruction extends Instruction { 39 /** 40 * Zero-argument constructor. Sets the opcode to an invalid value and 41 * sets the length to zero, as it will not be written as part of the 42 * generated byte code. 43 */ 44 public MarkerInstruction() { 45 super(Const.UNDEFINED, (short) 0); 46 } 47 48 /** 49 * {@link com.sun.org.apache.bcel.internal.generic.Visitor}s will know nothing about this 50 * kind of {@link org.apche.bcel.generic.Instruction}, so this method does 51 * nothing. 52 */ 53 public void accept(Visitor v) { 54 } 55 56 /** 57 * The number of JVM stack entries consumed by the instruction. 58 * This instruction is just a place holder, so it does not consume any 59 * stack entries. 60 * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the 61 * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen} 62 * @return <code>0</code> always 63 */ 64 final public int consumeStack(ConstantPoolGen cpg) { 65 return 0; |