|
Courgette: Add static method QuickDetect() to optimize program detection.
Old way: The detection of executables is achieve by allocating an instance of each
Disassembler classes and trying to call ParseHeader() to see if it succeed.
This operation is done many times during FindEmbeddedElements() step,
which takes ~4% of patch generation time.
New way: Using QuickDetect(), which executes only a quick preliminary check,
we avoid useless allocation of Disassembler objects unless
there's a high probability of successfully detecting a valid executable.
This change reduces the execution time of FindEmbeddedElements() by 95%.
BUG= 619167
Committed: https://crrev.com/5059bca628d156901f9d5c0ef06c0047fa5e5117
Cr-Commit-Position: refs/heads/master@{#404433}
Total comments: 10
Total comments: 17
Total comments: 12
Total comments: 5
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+253 lines, -52 lines) |
Patch |
|
M |
courgette/BUILD.gn
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
courgette/courgette.gyp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32.h
|
View
|
1
2
3
4
5
6
|
2 chunks |
+8 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+28 lines, -3 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32_arm.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+6 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32_arm.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32_x86.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+6 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32_x86.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_elf_32_x86_unittest.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+6 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+31 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x64.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+7 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x64.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x64_unittest.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x86.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+7 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x86.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
courgette/disassembler_win32_x86_unittest.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
courgette/program_detector.h
|
View
|
1
2
3
4
5
6
|
3 chunks |
+23 lines, -2 lines |
0 comments
|
Download
|
|
M |
courgette/program_detector.cc
|
View
|
1
2
3
|
2 chunks |
+23 lines, -19 lines |
0 comments
|
Download
|
|
A |
courgette/program_detector_unittest.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+80 lines, -0 lines |
0 comments
|
Download
|
Total messages: 44 (14 generated)
|