亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? methodrewriter.java

?? 配置文件
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/**
 * Copyright (c) 2003-2004 Craig Setera
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package eclipseme.preverifier.internal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.objectweb.asm.Label;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.attrs.StackMapAttribute;
import org.objectweb.asm.attrs.StackMapFrame;
import org.objectweb.asm.attrs.StackMapType;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.LineNumberNode;
import org.objectweb.asm.tree.LocalVariableNode;
import org.objectweb.asm.tree.LookupSwitchInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TableSwitchInsnNode;
import org.objectweb.asm.tree.TryCatchBlockNode;
import org.objectweb.asm.tree.VarInsnNode;
import org.objectweb.asm.tree.analysis.Analyzer;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.objectweb.asm.tree.analysis.BasicValue;
import org.objectweb.asm.tree.analysis.Frame;
import org.objectweb.asm.tree.analysis.Interpreter;
import org.objectweb.asm.tree.analysis.Value;

/**
 * Handler for a single method in the class.  Capable of 
 * inlining subroutines and creating the Stack map attribute.
 * <p />
 * Copyright (c) 2003-2005 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.7 $
 * <br>
 * $Date: 2005/11/15 00:34:26 $
 * <br>
 * @author Craig Setera
 */
public class MethodRewriter {
	/** A Label instance mapped to the new region and code offset after inlining */
	public class MappedLabel extends Label {
		private Label originalLabel;
		
		/**
		 * Construct a new instance
		 */
		public MappedLabel(Label label) {
			super();
			originalLabel = label;
		}

		public Label getOriginalLabel() {
			return originalLabel;
		}
		
		/**
		 * @see java.lang.Object#toString()
		 */
		public String toString() {
			return originalLabel.toString() + " -> " + super.toString();
		}
	}

	/** A region of instructions to be handled.  */
	class Region {
		protected Region parentRegion;
		protected int startIndex;
		protected int endIndex;
		protected Map labelMap;
		protected Set labels;
		protected List tryCatchBlocks;
		
		/**
		 * Construct a new instance. 
		 */
		Region() {
			this(0, 0);
		}

		/**
		 * Construct a new instance. 
		 * 
		 * @param startIndex
		 * @param endIndex
		 */
		Region(int startIndex, int endIndex) {
			this.startIndex = startIndex;
			this.endIndex = endIndex;
			
			labelMap = new HashMap();
			labels = new HashSet();
			tryCatchBlocks = new ArrayList();
		}
		
		/**
		 * Add a new label to this region's list.
		 * 
		 * @param label
		 */
		void addLabel(Label label) {
			labels.add(label);
		}
		
		/**
		 * Add a new try catch block that is contained within
		 * this region.
		 * 
		 * @param tryCatchBlock
		 */
		void addTryCatchBlock(TryCatchBlockNode tryCatchBlock) {
			tryCatchBlocks.add(tryCatchBlock);
		}
		
		/**
		 * Return a boolean indicating whether the specified 
		 * TryCatchBlockNode is enclosed within this instruction
		 * region.
		 * 
		 * @param tryCatchBlock
		 * @return
		 */
		boolean encloses(TryCatchBlockNode tryCatchBlock) {
			return
				labels.contains(tryCatchBlock.start) &&
				labels.contains(tryCatchBlock.end);
		}
		
		/**
		 * Enter the region.  Do any setup for this region.
		 * @param method 
		 */
		void enter(MethodNode method) {
			labelMap.clear();
			copyTryCatchBlocks(method, this, tryCatchBlocks);
		}
		
		/**
		 * Exit the region.  Do any cleanup for this region.
		 * @param method 
		 */
		void exit(MethodNode method) {
		}

		/**
		 * Return the length (in AbstractInsnNode instances) of
		 * this region.
		 * 
		 * @return
		 */
		int getLength() {
			return endIndex - startIndex;
		}
		
		/**
		 * Get the mapped label for the specified label based on the
		 * current region.
		 * 
		 * @param originalLabel
		 * @return
		 */
		Label getMappedLabel(Label originalLabel) {
			Label mappedLabel = findMappedLabel(originalLabel);
			if (mappedLabel == null) {
				mappedLabel = new MappedLabel(originalLabel);
				
				Map map = findLabelMap(originalLabel);
				map.put(originalLabel, mappedLabel);
			}
			
			return mappedLabel;
		}
		
		/**
		 * Returnn a boolean indicating whether the specified opcode
		 * at the specified index in the method is a subroutine store
		 * opcode.
		 * 
		 * @param methodNode
		 * @param index
		 * @return
		 */
		boolean isSubroutineReturnStore(MethodNode methodNode, int index) {
			return false;
		}
		
		/**
		 * Store the parent region.
		 * 
		 * @param parentRegion
		 */
		void setParentRegion(Region parentRegion) {
			this.parentRegion = parentRegion;
		}
		
		/**
		 * Find the label map recursively as necessary.
		 * 
		 * @param originalLabel
		 * @return
		 */
		protected Map findLabelMap(Label originalLabel) {
			Map map = findLabelMapRecursive(originalLabel);
			return (map != null) ? map : labelMap;
		}
		
		/**
		 * Find the label map recursively.
		 * 
		 * @param originalLabel
		 * @return
		 */
		protected Map findLabelMapRecursive(Label originalLabel) {
			Map map = null;
			
			if (labels.contains(originalLabel)) {
				map = labelMap;
			} else if (parentRegion != null) {
				map = parentRegion.findLabelMapRecursive(originalLabel);
			}
			
			return map;
		}
		
		/**
		 * Find and return the specified label mapped appropriately for the
		 * region or <code>null</code> if not found.
		 * 
		 * @param originalLabel
		 * @return
		 */
		protected Label findMappedLabel(Label originalLabel) {
			Label mappedLabel = (Label) labelMap.get(originalLabel);
			if ((mappedLabel == null) && (parentRegion != null)) {
				mappedLabel = parentRegion.findMappedLabel(originalLabel);
			}
			
			return mappedLabel;
		}
		
		/**
		 * Return the try catch blocks in this region.
		 * 
		 * @return
		 */
		List getTryCatchBlocks() {
			return tryCatchBlocks;
		}
	}
	
	/** Holder for information about a subroutine in a method */
	class Subroutine extends Region {
		Label label;
		int returnVariable;
		
		/**
		 * Construct a new subroutine instance.
		 * 
		 * @param label
		 */
		Subroutine(Label label) {
			super();
			this.label = label;
		}
		
		/**
		 * @return Returns the returnVariable.
		 */
		public int getReturnVariable() {
			return returnVariable;
		}
		
		/**
		 * @see eclipseme.preverifier.internal.MethodRewriter.Region#isSubroutineReturnStore(org.objectweb.asm.tree.MethodNode, int)
		 */
		boolean isSubroutineReturnStore(MethodNode methodNode, int index) {
			boolean isReturnStore = false;
			
			AbstractInsnNode insnNode = getInstruction(methodNode, index);
			if (insnNode.getOpcode() == Opcodes.ASTORE) {
				VarInsnNode varInsnNode = (VarInsnNode) insnNode;
				isReturnStore = (varInsnNode.var == returnVariable);
			}
			
			return isReturnStore;
		}

		/**
		 * @param returnVariable The returnVariable to set.
		 */
		public void setReturnVariable(int returnVariable) {
			this.returnVariable = returnVariable;
		}
	}

	private PreverificationClassNode classNode;
	private PreverifierMethodNode srcMethod;
	private MethodNode updatedMethod;
	
	private Map subroutineMap;
	private Map lineNumberMap;
	private Map localVariableByStartLabelMap;
	private Map localVariableByEndLabelMap;
	
	/**
	 * Construct a new rewriter instance.
	 * 
	 * @param classNode
	 * @param srcMethod
	 */
	public MethodRewriter(PreverificationClassNode classNode, PreverifierMethodNode srcMethod)
	{
		super();
		
		this.classNode = classNode;
		this.srcMethod = srcMethod;
		localVariableByEndLabelMap = new HashMap();
	}

	/**
	 * Return the method with subroutines inlined and
	 * an associated StackMapAttribute.
	 * 
	 * @return
	 * @throws AnalyzerException
	 */
	public MethodNode getUpdatedMethod() 
		throws AnalyzerException 
	{
		boolean inliningRequired = (srcMethod.getJsrInstructionIndices().size() > 0); 
		if (inliningRequired) {
			inlineSubroutines();
		} else {
			updatedMethod = srcMethod;
		}
		
		createStackMapAttribute();
		return updatedMethod;
	}

	/**
	 * Create a new StackMapAttribute for the method.
	 * This method also removes any dead code that would
	 * cause the stack map attribute to be incorrect.
	 * 
	 * @throws AnalyzerException 
	 */
	private void createStackMapAttribute() 
		throws AnalyzerException 
	{
		StackMapAttribute stackMapAttribute = new StackMapAttribute();
		
		Set targetLabels = findTargetLabels();
		
		// We need to have the verifier operating with the classpath
		// of the class being rewritten
		Interpreter interpreter = 
			new SimpleVerifierPlusClassloader(classNode.getClassLoader());
		Analyzer analyzer = new Analyzer(interpreter);
		Frame[] frames = analyzer.analyze(classNode.name, updatedMethod);
		
		int deadCodeFrameCount = 0;
		int[] deadCodeIndices = new int[frames.length];
		
		for (int i = 0; i < updatedMethod.instructions.size(); i++) {
			Frame frame = frames[i];

			// We only need to add stack map attributes for labels
			// that are the target of certain instructions
			AbstractInsnNode insnNode = getInstruction(updatedMethod, i); 
			if (insnNode.getType() == AbstractInsnNode.LABEL) {
				LabelNode labelNode = (LabelNode) insnNode;
			
				if (targetLabels.contains(labelNode.label) && (frame != null)) {
					stackMapAttribute.frames.add(newStackMapFrame(labelNode.label, frame));
				}
			} else if (frame == null) {
				// Track the indices of dead code for removal after
				// building the stack map
				deadCodeIndices[deadCodeFrameCount++] = i;
			}
			
		}
		
		// Write out the newly created stack map attribute
		// and remove any unnecessary dead code that would
		// have an adverse effect on the stack map attribute
		if (stackMapAttribute.frames.size() != 0) {
			updatedMethod.visitAttribute(stackMapAttribute);
			
			// Remove the dead code in reverse order so that
			// the indices remain correct after each removal
			for (int i = deadCodeFrameCount - 1; i >= 0; i--) {
				updatedMethod.instructions.remove(deadCodeIndices[i]);
			}
		}
	}

	/**
	 * Inline all subroutines.
	 * 
	 * @throws AnalyzerException

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合色婷婷| 欧美疯狂性受xxxxx喷水图片| 久久久91精品国产一区二区精品 | 欧美精品一区二区三区一线天视频| 亚洲高清免费在线| 欧美一区二区福利视频| 麻豆精品视频在线观看| 精品国产一区二区亚洲人成毛片| 韩日精品视频一区| 欧美韩国一区二区| 在线视频你懂得一区二区三区| 亚洲成av人片一区二区三区| 日韩精品一区二| 成人午夜电影网站| 一区av在线播放| 精品免费视频.| 成人高清视频在线| 午夜精品成人在线视频| 久久综合色天天久久综合图片| jizz一区二区| 婷婷成人激情在线网| 久久免费的精品国产v∧| 99麻豆久久久国产精品免费 | 天堂蜜桃91精品| 欧美va亚洲va| 91色乱码一区二区三区| 午夜欧美2019年伦理| 精品国产伦一区二区三区观看方式| 国产成人精品免费看| 亚洲午夜免费电影| 亚洲精品一区在线观看| 日本大香伊一区二区三区| 久久爱www久久做| 一个色综合av| 国产亚洲污的网站| 欧美欧美欧美欧美| www.在线欧美| 久久69国产一区二区蜜臀| 亚洲欧美日韩人成在线播放| 欧美一区二区三区免费观看视频 | 欧美中文一区二区三区| 国产一区欧美日韩| 日韩成人精品在线| 亚洲精品视频在线| 国产亚洲美州欧州综合国| 欧美高清hd18日本| 日本黄色一区二区| 国产盗摄精品一区二区三区在线| 亚洲国产综合色| 日韩美女啊v在线免费观看| 欧美一区二区三区啪啪| 欧美性猛交一区二区三区精品| 国产99久久久国产精品 | 麻豆高清免费国产一区| 亚洲国产aⅴ成人精品无吗| 亚洲欧洲av在线| 国产清纯白嫩初高生在线观看91 | 亚洲一区在线免费观看| 日本一区二区三区久久久久久久久不| 67194成人在线观看| 色8久久人人97超碰香蕉987| 粉嫩av一区二区三区在线播放| 久久成人精品无人区| 丝袜诱惑亚洲看片| 亚洲一区电影777| 亚洲美女在线国产| 亚洲人123区| 亚洲欧洲综合另类在线| 国产精品青草综合久久久久99| 久久久久久久久久久电影| 精品国内二区三区| 2024国产精品视频| 久久亚洲一级片| 国产欧美综合色| 国产免费成人在线视频| 中文字幕国产一区| 中文欧美字幕免费| 国产精品久久久久久久午夜片| 久久久久97国产精华液好用吗| 亚洲精品一区二区精华| 久久精品视频一区二区三区| 国产人妖乱国产精品人妖| 国产精品伦一区| 夜夜爽夜夜爽精品视频| 亚洲韩国精品一区| 日本亚洲最大的色成网站www| 久色婷婷小香蕉久久| 精品亚洲成a人在线观看| 国产在线视视频有精品| 国产成人在线视频网址| a级精品国产片在线观看| 91一区二区三区在线观看| 色婷婷综合久久久久中文一区二区 | av中文字幕亚洲| 99精品桃花视频在线观看| 色综合久久综合网| 欧美电影一区二区三区| 精品精品欲导航| 欧美激情综合五月色丁香| 亚洲欧洲日韩综合一区二区| 一区二区三区在线视频观看58 | 日韩高清在线观看| 精品一区二区国语对白| 丁香五精品蜜臀久久久久99网站| 99久久久久久99| 欧美日韩dvd在线观看| 久久综合九色综合97_久久久| 中文字幕中文字幕在线一区 | 欧美高清hd18日本| 久久久综合九色合综国产精品| 国产精品美女久久久久久2018| 亚洲一区二区四区蜜桃| 极品美女销魂一区二区三区| 9人人澡人人爽人人精品| 欧美日韩精品是欧美日韩精品| 久久蜜桃av一区二区天堂| 亚洲欧美另类小说| 麻豆国产91在线播放| 99久久婷婷国产精品综合| 欧美日韩电影在线| 亚洲国产精品国自产拍av| 夜夜爽夜夜爽精品视频| 国产精品456| 欧美情侣在线播放| 亚洲欧洲国产日本综合| 另类小说色综合网站| 91麻豆免费观看| 欧美变态tickle挠乳网站| 中文字幕一区日韩精品欧美| 久久精品国产久精国产爱| 91麻豆精品秘密| 久久久久一区二区三区四区| 亚洲成人综合网站| 99久久夜色精品国产网站| 久久久亚洲精品石原莉奈| 亚洲专区一二三| 91亚洲精品一区二区乱码| 精品久久久久久综合日本欧美| 亚洲国产一区二区三区| 不卡的av网站| 欧美精品一区二区三| 午夜精品久久久久久| 91麻豆精品视频| 国产精品久久久久影视| 韩日av一区二区| 日韩午夜av一区| 午夜精品aaa| 欧美午夜宅男影院| 玉米视频成人免费看| 成人午夜电影久久影院| 久久综合色综合88| 美女视频一区二区三区| 欧美日韩aaaaaa| 亚洲sss视频在线视频| 色综合天天狠狠| 亚洲精品菠萝久久久久久久| 成人激情黄色小说| 国产精品丝袜91| 丁香网亚洲国际| 中文字幕欧美区| 国产高清在线精品| 久久亚洲影视婷婷| 国产美女娇喘av呻吟久久| 欧美精品一区二区在线播放| 黄页网站大全一区二区| 亚洲精品一线二线三线| 国产在线播放一区三区四| 精品国产成人系列| 国产一区二区精品久久| 久久香蕉国产线看观看99| 激情五月婷婷综合| 久久久亚洲精品一区二区三区 | 久草精品在线观看| 日韩欧美在线1卡| 黑人精品欧美一区二区蜜桃| 久久久久久久一区| 播五月开心婷婷综合| 亚洲欧美一区二区不卡| 在线中文字幕一区二区| 亚洲国产日产av| 欧美精品1区2区3区| 日韩成人伦理电影在线观看| 精品国产污网站| 国产成人aaaa| |精品福利一区二区三区| 色婷婷激情久久| 日韩成人dvd| 欧美国产精品中文字幕| 一本色道久久加勒比精品| 亚洲成a人片综合在线| 欧美成人在线直播| 成人综合婷婷国产精品久久| 亚洲美女精品一区| 91精品国产品国语在线不卡| 国产毛片精品国产一区二区三区| 国产欧美日韩亚州综合| 日本二三区不卡| 久久99久久99小草精品免视看| 国产精品国产三级国产普通话三级| 欧美亚洲国产怡红院影院|