Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Issue 1629703002: [Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. (Closed)

Created:
4 years, 11 months ago by huangs
Modified:
4 years, 10 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. Previously naked pointers AssemblyProgram and EncodedProgram are used over the place, and are deallocated using Delete{AssemblyProgram, EncodedProgram}(). In this CL we use scoped_ptr to manage the life cycles of these objects. - Removed DeleteAssemblyProgram() and DeleteEncodedProgram() and replaced calls with e.g., program.reset(nullptr); if the manual deallocation is a peak memory optimization. - Moved Encode() and ReadEncodedProgram() to the .h files matching the .cc files. - Extracted DetectExecutableType() and ParseDetectedExecutable() from disassembly.* to new files program_detector*c, since Disassembly is really an implementation that caller's don't care about. Committed: https://crrev.com/0a9cbf1781a114b35a4e0f4a834f2d24ade2e917 Cr-Commit-Position: refs/heads/master@{#372212} Committed: https://crrev.com/8d5be25a65a341fcbd1b92a6856e8c71600a2bec Cr-Commit-Position: refs/heads/master@{#372436}

Patch Set 1 #

Patch Set 2 : Fix comments and includes. #

Total comments: 18

Patch Set 3 : Replace .reset(nullptr) with reset(); spacing fixes. #

Patch Set 4 : Sync; spacing fixes. #

Patch Set 5 : Fix courgette_fuzz build error. #

Patch Set 6 : Sync. #

Patch Set 7 : Fix courgette_fuzzer in libfuzzer. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+322 lines, -302 lines) Patch
M courgette/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M courgette/adjustment_method_unittest.cc View 1 2 4 chunks +30 lines, -23 lines 0 comments Download
M courgette/assembly_program.h View 1 2 3 3 chunks +9 lines, -2 lines 0 comments Download
M courgette/assembly_program.cc View 1 2 7 chunks +22 lines, -28 lines 0 comments Download
M courgette/courgette.h View 2 chunks +1 line, -35 lines 0 comments Download
M courgette/courgette.gyp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M courgette/courgette_tool.cc View 1 2 9 chunks +43 lines, -36 lines 0 comments Download
M courgette/disassembler.cc View 1 chunk +0 lines, -93 lines 0 comments Download
M courgette/encode_decode_unittest.cc View 1 2 3 chunks +16 lines, -11 lines 0 comments Download
M courgette/encoded_program.h View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M courgette/encoded_program.cc View 1 2 4 chunks +10 lines, -14 lines 0 comments Download
M courgette/encoded_program_fuzz_unittest.cc View 1 2 3 4 5 chunks +15 lines, -13 lines 0 comments Download
M courgette/encoded_program_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M courgette/ensemble.cc View 2 chunks +1 line, -3 lines 0 comments Download
M courgette/patch_generator_x86_32.h View 1 2 3 4 chunks +23 lines, -27 lines 0 comments Download
M courgette/patcher_x86_32.h View 1 2 3 chunks +12 lines, -14 lines 0 comments Download
A courgette/program_detector.h View 1 1 chunk +43 lines, -0 lines 0 comments Download
A courgette/program_detector.cc View 1 2 1 chunk +85 lines, -0 lines 0 comments Download
M testing/libfuzzer/fuzzers/courgette_fuzzer.cc View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 53 (22 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1629703002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1629703002/1
4 years, 11 months ago (2016-01-24 17:30:27 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-24 18:52:52 UTC) #4
huangs
Refactoring CL. PTAL. https://chromiumcodereview.appspot.com/1629703002/diff/20001/courgette/courgette_tool.cc File courgette/courgette_tool.cc (right): https://chromiumcodereview.appspot.com/1629703002/diff/20001/courgette/courgette_tool.cc#newcode83 courgette/courgette_tool.cc:83: scoped_ptr<courgette::AssemblyProgram> program; Style: I prefer to ...
4 years, 11 months ago (2016-01-25 19:22:48 UTC) #7
grt (UTC plus 2)
This is a pretty major change to the API. I'm not sure it's the right ...
4 years, 11 months ago (2016-01-26 16:39:54 UTC) #10
Will Harris
https://codereview.chromium.org/1629703002/diff/20001/courgette/courgette_tool.cc File courgette/courgette_tool.cc (right): https://codereview.chromium.org/1629703002/diff/20001/courgette/courgette_tool.cc#newcode90 courgette/courgette_tool.cc:90: scoped_ptr<courgette::EncodedProgram> encoded; On 2016/01/26 16:39:54, grt wrote: > yeah, ...
4 years, 11 months ago (2016-01-26 18:40:20 UTC) #11
huangs
Addressed smaller changes, wrote length reply to the main comment. PTAL. https://chromiumcodereview.appspot.com/1629703002/diff/20001/courgette/assembly_program.cc File courgette/assembly_program.cc (right): ...
4 years, 11 months ago (2016-01-26 18:42:24 UTC) #12
grt (UTC plus 2)
On 2016/01/26 18:40:20, Will Harris wrote: > https://codereview.chromium.org/1629703002/diff/20001/courgette/courgette_tool.cc > File courgette/courgette_tool.cc (right): > > https://codereview.chromium.org/1629703002/diff/20001/courgette/courgette_tool.cc#newcode90 ...
4 years, 11 months ago (2016-01-27 14:23:07 UTC) #13
huangs
Ping wft@ for review. Thanks!
4 years, 10 months ago (2016-01-28 17:03:55 UTC) #14
Will Harris
lgtm. I looked really hard and all I found was an extra space in a ...
4 years, 10 months ago (2016-01-28 19:54:29 UTC) #15
huangs
Thanks! Will sync and commit today.
4 years, 10 months ago (2016-01-28 19:58:10 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1629703002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1629703002/60001
4 years, 10 months ago (2016-01-28 21:05:58 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_dbg/builds/14391)
4 years, 10 months ago (2016-01-28 21:40:02 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1629703002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1629703002/80001
4 years, 10 months ago (2016-01-28 22:55:21 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 10 months ago (2016-01-29 00:11:55 UTC) #26
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/0a9cbf1781a114b35a4e0f4a834f2d24ade2e917 Cr-Commit-Position: refs/heads/master@{#372212}
4 years, 10 months ago (2016-01-29 00:12:52 UTC) #28
dcheng
On 2016/01/29 at 00:12:52, commit-bot wrote: > Patchset 5 (id:??) landed as https://crrev.com/0a9cbf1781a114b35a4e0f4a834f2d24ade2e917 > Cr-Commit-Position: ...
4 years, 10 months ago (2016-01-29 03:11:15 UTC) #29
dcheng
On 2016/01/29 at 03:11:15, dcheng wrote: > On 2016/01/29 at 00:12:52, commit-bot wrote: > > ...
4 years, 10 months ago (2016-01-29 03:11:47 UTC) #30
dcheng
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/1650013002/ by dcheng@chromium.org. ...
4 years, 10 months ago (2016-01-29 03:13:03 UTC) #31
huangs
OWNER review to krasin@ for libfuzzer change.
4 years, 10 months ago (2016-01-29 19:31:56 UTC) #34
krasin1
lgtm
4 years, 10 months ago (2016-01-29 19:52:47 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1629703002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1629703002/120001
4 years, 10 months ago (2016-01-29 19:58:06 UTC) #37
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-01-29 21:14:54 UTC) #39
huangs
linux_libfuzzer_rel and linux_gn_rel undergo patch failure because they don't know \courgette exists. I'm going to ...
4 years, 10 months ago (2016-01-29 22:04:10 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1629703002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1629703002/120001
4 years, 10 months ago (2016-01-29 22:05:57 UTC) #43
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 10 months ago (2016-01-29 22:14:25 UTC) #45
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/8d5be25a65a341fcbd1b92a6856e8c71600a2bec Cr-Commit-Position: refs/heads/master@{#372436}
4 years, 10 months ago (2016-01-29 22:15:47 UTC) #47
dcheng
This still fails to build: ../../testing/libfuzzer/fuzzers/zlib_uncompress_fuzzer.cc:18:44: error: expected '(' after 'static_cast' static_cast<uLong>size)) { ^ ( ...
4 years, 10 months ago (2016-01-29 23:26:19 UTC) #49
huangs
Ugh, I see the reason; 1 line fix that will take 5 min. But please ...
4 years, 10 months ago (2016-01-29 23:28:41 UTC) #50
dcheng
shrug, i guess i'm the main person it affects =) i've worked around it locally ...
4 years, 10 months ago (2016-01-29 23:30:03 UTC) #51
huangs
Meanwhile, this failed because I had problem building libfuzzer_main on Windows, and trybots for linux_gn_rel ...
4 years, 10 months ago (2016-01-29 23:34:37 UTC) #52
huangs
4 years, 10 months ago (2016-01-29 23:40:15 UTC) #53
Message was sent while issue was closed.
https://codereview.chromium.org/1654503002

K, more than 5 min...

Powered by Google App Engine
This is Rietveld 408576698