本文整理汇总了Java中com.android.dx.dex.code.RopTranslator类的典型用法代码示例。如果您正苦于以下问题:Java RopTranslator类的具体用法?Java RopTranslator怎么用?Java RopTranslator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RopTranslator类属于com.android.dx.dex.code包,在下文中一共展示了RopTranslator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCode
import com.android.dx.dex.code.RopTranslator; //导入依赖的package包/类
/**
* Extracts the code block from the given method of the given class, or
* <code>null</code>, if method is native or abstract.
*/
private static DalvCode getCode(Method method, DirectClassFile classFile) {
boolean isNative = AccessFlags.isNative(method.getAccessFlags());
boolean isStatic = AccessFlags.isStatic(method.getAccessFlags());
boolean isAbstract = AccessFlags.isAbstract(method.getAccessFlags());
if (isNative || isAbstract) {
return null;
}
ConcreteMethod concrete = new ConcreteMethod(method, classFile, false, false);
TranslationAdvice advice = DexTranslationAdvice.THE_ONE;
RopMethod rmeth = Ropper.convert(concrete, advice);
CstMethodRef meth = new CstMethodRef(method.getDefiningClass(), method.getNat());
int paramSize = meth.getParameterWordCount(isStatic);
DalvCode code = RopTranslator.translate(rmeth, PositionList.NONE, null, paramSize);
DalvCode.AssignIndicesCallback callback = new DalvCode.AssignIndicesCallback() {
public int getIndex(Constant cst) {
// Everything is at index 0!
return 0;
}
};
code.assignIndices(callback);
return code;
}
开发者ID:shannah,项目名称:cn1,代码行数:29,代码来源:JDKAnalyzer.java
示例2: updateDexStatistics
import com.android.dx.dex.code.RopTranslator; //导入依赖的package包/类
/**
* Helper that updates the dex statistics.
*/
private static void updateDexStatistics(CfOptions cfOptions, DexOptions dexOptions,
RopMethod optRmeth, RopMethod nonOptRmeth,
LocalVariableInfo locals, int paramSize, int originalByteCount) {
/*
* Run rop->dex again on optimized vs. non-optimized method to
* collect statistics. We have to totally convert both ways,
* since converting the "real" method getting added to the
* file would corrupt it (by messing with its constant pool
* indices).
*/
DalvCode optCode = RopTranslator.translate(optRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
/*
* Fake out the indices, so code.getInsns() can work well enough
* for the current purpose.
*/
DalvCode.AssignIndicesCallback callback =
new DalvCode.AssignIndicesCallback() {
public int getIndex(Constant cst) {
// Everything is at index 0!
return 0;
}
};
optCode.assignIndices(callback);
nonOptCode.assignIndices(callback);
CodeStatistics.updateDexStatistics(nonOptCode, optCode);
CodeStatistics.updateOriginalByteCount(originalByteCount);
}
开发者ID:JLLK,项目名称:multidex-maker,代码行数:39,代码来源:CfTranslator.java
示例3: toEncodedMethod
import com.android.dx.dex.code.RopTranslator; //导入依赖的package包/类
EncodedMethod toEncodedMethod(DexOptions dexOptions) {
RopMethod ropMethod = new RopMethod(code.toBasicBlocks(), 0);
LocalVariableInfo locals = null;
DalvCode dalvCode = RopTranslator.translate(
ropMethod, PositionList.NONE, locals, code.paramSize(), dexOptions);
return new EncodedMethod(method.constant, flags, dalvCode, StdTypeList.EMPTY);
}
开发者ID:linkedin,项目名称:dexmaker,代码行数:8,代码来源:DexMaker.java
示例4: updateDexStatistics
import com.android.dx.dex.code.RopTranslator; //导入依赖的package包/类
/**
* Helper that updates the dex statistics.
*/
private static void updateDexStatistics(CfOptions cfOptions, DexOptions dexOptions,
RopMethod optRmeth, RopMethod nonOptRmeth,
LocalVariableInfo locals, int paramSize, int originalByteCount) {
/*
* Run rop->dex again on optimized vs. non-optimized method to
* collect statistics. We have to totally convert both ways,
* since converting the "real" method getting added to the
* file would corrupt it (by messing with its constant pool
* indices).
*/
DalvCode optCode = RopTranslator.translate(optRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
/*
* Fake out the indices, so code.getInsns() can work well enough
* for the current purpose.
*/
DalvCode.AssignIndicesCallback callback =
new DalvCode.AssignIndicesCallback() {
public int getIndex(Constant cst) {
// Everything is at index 0!
return 0;
}
};
optCode.assignIndices(callback);
nonOptCode.assignIndices(callback);
cfOptions.codeStatistics.updateDexStatistics(nonOptCode, optCode);
cfOptions.codeStatistics.updateOriginalByteCount(originalByteCount);
}
开发者ID:saleehk,项目名称:buck-cutom,代码行数:39,代码来源:CfTranslator.java
示例5: updateDexStatistics
import com.android.dx.dex.code.RopTranslator; //导入依赖的package包/类
/**
* Helper that updates the dex statistics.
*/
private static void updateDexStatistics(DxContext context, CfOptions cfOptions, DexOptions dexOptions,
RopMethod optRmeth, RopMethod nonOptRmeth,
LocalVariableInfo locals, int paramSize, int originalByteCount) {
/*
* Run rop->dex again on optimized vs. non-optimized method to
* collect statistics. We have to totally convert both ways,
* since converting the "real" method getting added to the
* file would corrupt it (by messing with its constant pool
* indices).
*/
DalvCode optCode = RopTranslator.translate(optRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
cfOptions.positionInfo, locals, paramSize, dexOptions);
/*
* Fake out the indices, so code.getInsns() can work well enough
* for the current purpose.
*/
DalvCode.AssignIndicesCallback callback =
new DalvCode.AssignIndicesCallback() {
public int getIndex(Constant cst) {
// Everything is at index 0!
return 0;
}
};
optCode.assignIndices(callback);
nonOptCode.assignIndices(callback);
context.codeStatistics.updateDexStatistics(nonOptCode, optCode);
context.codeStatistics.updateOriginalByteCount(originalByteCount);
}
开发者ID:facebook,项目名称:buck,代码行数:39,代码来源:CfTranslator.java
注:本文中的com.android.dx.dex.code.RopTranslator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论