mirror of
https://github.com/revanced/smali.git
synced 2025-04-29 22:24:26 +02:00
Don't include debug info in method size.
The debug info items can be shared across methods so don't count them as part of private method size.
This commit is contained in:
parent
6187d13f14
commit
4f4df9d54e
@ -172,13 +172,11 @@ public class DexBackedMethodImplementation implements MethodImplementation {
|
||||
/**
|
||||
* Calculate and return the private size of a method implementation.
|
||||
*
|
||||
* Calculated as: debug info size + instructions size + try-catch size
|
||||
* Calculated as: instructions size + try-catch size
|
||||
*
|
||||
* @return size in bytes
|
||||
*/
|
||||
public int getSize() {
|
||||
int debugSize = getDebugInfo().getSize();
|
||||
|
||||
//set last offset just before bytecode instructions (after insns_size)
|
||||
int lastOffset = getInstructionsStartOffset();
|
||||
|
||||
@ -195,7 +193,7 @@ public class DexBackedMethodImplementation implements MethodImplementation {
|
||||
lastOffset = ((VariableSizeListIterator)tryHandlerIter).getReaderOffset();
|
||||
}
|
||||
|
||||
//method impl size = debug block size + code_item size
|
||||
return debugSize + (lastOffset - codeOffset);
|
||||
//method impl size = code_item size
|
||||
return lastOffset - codeOffset;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user