Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
052a8db6
Commit
052a8db6
authored
Aug 09, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: resolve minor issues
parent
88ccba16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+1
-1
LiveVarAnalysis.java
...main/java/jadx/core/dex/visitors/ssa/LiveVarAnalysis.java
+0
-1
SSATransform.java
...rc/main/java/jadx/core/dex/visitors/ssa/SSATransform.java
+10
-9
No files found.
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
052a8db6
...
...
@@ -566,7 +566,7 @@ public class InsnGen {
private
void
makeConstructor
(
ConstructorInsn
insn
,
CodeWriter
code
)
throws
CodegenException
{
ClassNode
cls
=
mth
.
dex
().
resolveClass
(
insn
.
getClassType
());
if
(
cls
!=
null
&&
cls
.
isAnonymous
())
{
if
(
cls
!=
null
&&
cls
.
isAnonymous
()
&&
!
fallback
)
{
// anonymous class construction
ClassInfo
parent
;
if
(
cls
.
getInterfaces
().
size
()
==
1
)
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/ssa/LiveVarAnalysis.java
View file @
052a8db6
...
...
@@ -20,7 +20,6 @@ public class LiveVarAnalysis {
public
LiveVarAnalysis
(
MethodNode
mth
)
{
this
.
mth
=
mth
;
runAnalysis
();
}
public
void
runAnalysis
()
{
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/ssa/SSATransform.java
View file @
052a8db6
...
...
@@ -32,17 +32,18 @@ public class SSATransform extends AbstractVisitor {
process
(
mth
);
}
private
void
process
(
MethodNode
mth
)
{
private
static
void
process
(
MethodNode
mth
)
{
LiveVarAnalysis
la
=
new
LiveVarAnalysis
(
mth
);
la
.
runAnalysis
();
for
(
int
i
=
0
;
i
<
mth
.
getRegsCount
();
i
++)
{
int
regsCount
=
mth
.
getRegsCount
();
for
(
int
i
=
0
;
i
<
regsCount
;
i
++)
{
placePhi
(
mth
,
i
,
la
);
}
renameVariables
(
mth
);
removeUselessPhi
(
mth
);
}
private
void
placePhi
(
MethodNode
mth
,
int
regNum
,
LiveVarAnalysis
la
)
{
private
static
void
placePhi
(
MethodNode
mth
,
int
regNum
,
LiveVarAnalysis
la
)
{
List
<
BlockNode
>
blocks
=
mth
.
getBasicBlocks
();
int
blocksCount
=
blocks
.
size
();
BitSet
hasPhi
=
new
BitSet
(
blocksCount
);
...
...
@@ -71,7 +72,7 @@ public class SSATransform extends AbstractVisitor {
}
}
private
void
addPhi
(
BlockNode
block
,
int
regNum
)
{
private
static
void
addPhi
(
BlockNode
block
,
int
regNum
)
{
PhiListAttr
phiList
=
block
.
get
(
AType
.
PHI_LIST
);
if
(
phiList
==
null
)
{
phiList
=
new
PhiListAttr
();
...
...
@@ -82,7 +83,7 @@ public class SSATransform extends AbstractVisitor {
block
.
getInstructions
().
add
(
0
,
phiInsn
);
}
private
void
renameVariables
(
MethodNode
mth
)
{
private
static
void
renameVariables
(
MethodNode
mth
)
{
int
regsCount
=
mth
.
getRegsCount
();
SSAVar
[]
vars
=
new
SSAVar
[
regsCount
];
int
[]
versions
=
new
int
[
regsCount
];
...
...
@@ -94,7 +95,7 @@ public class SSATransform extends AbstractVisitor {
renameVar
(
mth
,
vars
,
versions
,
mth
.
getEnterBlock
());
}
private
void
renameVar
(
MethodNode
mth
,
SSAVar
[]
vars
,
int
[]
vers
,
BlockNode
block
)
{
private
static
void
renameVar
(
MethodNode
mth
,
SSAVar
[]
vars
,
int
[]
vers
,
BlockNode
block
)
{
SSAVar
[]
inputVars
=
Arrays
.
copyOf
(
vars
,
vars
.
length
);
for
(
InsnNode
insn
:
block
.
getInstructions
())
{
if
(
insn
.
getType
()
!=
InsnType
.
PHI
)
{
...
...
@@ -142,7 +143,7 @@ public class SSATransform extends AbstractVisitor {
System
.
arraycopy
(
inputVars
,
0
,
vars
,
0
,
vars
.
length
);
}
private
void
removeUselessPhi
(
MethodNode
mth
)
{
private
static
void
removeUselessPhi
(
MethodNode
mth
)
{
List
<
PhiInsn
>
insnToRemove
=
new
ArrayList
<
PhiInsn
>();
for
(
SSAVar
var
:
mth
.
getSVars
())
{
// phi result not used
...
...
@@ -165,7 +166,7 @@ public class SSATransform extends AbstractVisitor {
removePhiList
(
mth
,
insnToRemove
);
}
private
void
removePhiWithSameArgs
(
PhiInsn
phi
,
List
<
PhiInsn
>
insnToRemove
)
{
private
static
void
removePhiWithSameArgs
(
PhiInsn
phi
,
List
<
PhiInsn
>
insnToRemove
)
{
if
(
phi
.
getArgsCount
()
<=
1
)
{
insnToRemove
.
add
(
phi
);
return
;
...
...
@@ -189,7 +190,7 @@ public class SSATransform extends AbstractVisitor {
}
}
private
void
removePhiList
(
MethodNode
mth
,
List
<
PhiInsn
>
insnToRemove
)
{
private
static
void
removePhiList
(
MethodNode
mth
,
List
<
PhiInsn
>
insnToRemove
)
{
if
(
insnToRemove
.
isEmpty
())
{
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment