Skip to content

Commit

Permalink
添加asm文档
Browse files Browse the repository at this point in the history
  • Loading branch information
rain9155 committed Aug 18, 2020
1 parent 55920e2 commit affb0c8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/plugindemo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected void onCreate(Bundle savedInstanceState) {
// long costTime = endTime - startTime;
// if(costTime > 100){
// StackTraceElement thisMethodStack = (new Exception()).getStackTrace()[0];//获得当前方法的StackTraceElement
// Log.e("rain", String.format(
// Log.e("TimeCost", String.format(
// "===> %s.%s(%s:%s)方法耗时 %d ms",
// thisMethodStack.getClassName(), //类的全限定名称
// thisMethodStack.getMethodName(),//方法名
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void visitInsn(int opcode) {
mv.visitVarInsn(ASTORE, thisMethodStack);

//Log.e("rain", String.format("===> %s.%s(%s:%s)方法耗时 %d ms", thisMethodStack.getClassName(), thisMethodStack.getMethodName(),thisMethodStack.getFileName(),thisMethodStack.getLineNumber(),costTime));
mv.visitLdcInsn("rain");
mv.visitLdcInsn("TimeCost");
mv.visitLdcInsn("===> %s.%s(%s:%s)\u65b9\u6cd5\u8017\u65f6 %d ms");
mv.visitInsn(ICONST_5);
mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
Expand Down
Binary file added doc/ASM4-guide(中文版).pdf
Binary file not shown.
Binary file added doc/asm4-guide.pdf
Binary file not shown.

0 comments on commit affb0c8

Please sign in to comment.