Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
asm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jamie Mansfield
asm
Commits
9412ed77
Commit
9412ed77
authored
Jun 20, 2018
by
Jason Zaugg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Short circuit instruction set containsAll based on set size
parent
c72a86bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java
...va/org/objectweb/asm/tree/analysis/SourceInterpreter.java
+6
-1
No files found.
asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java
View file @
9412ed77
...
...
@@ -201,7 +201,7 @@ public class SourceInterpreter extends Interpreter<SourceValue> implements Opcod
return
new
SourceValue
(
Math
.
min
(
value1
.
size
,
value2
.
size
),
setUnion
);
}
}
if
(
value1
.
size
!=
value2
.
size
||
!
value1
.
insns
.
containsAll
(
value2
.
insns
))
{
if
(
value1
.
size
!=
value2
.
size
||
!
containsAll
(
value1
.
insns
,
value2
.
insns
))
{
HashSet
<
AbstractInsnNode
>
setUnion
=
new
HashSet
<
AbstractInsnNode
>();
setUnion
.
addAll
(
value1
.
insns
);
setUnion
.
addAll
(
value2
.
insns
);
...
...
@@ -209,4 +209,9 @@ public class SourceInterpreter extends Interpreter<SourceValue> implements Opcod
}
return
value1
;
}
private
static
<
A
>
boolean
containsAll
(
Set
<
A
>
self
,
Set
<
A
>
other
)
{
if
(
self
.
size
()
<
other
.
size
())
return
false
;
return
self
.
containsAll
(
other
);
}
}
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