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

Issue 2793153003: [Courgette] Refactor: Store Label Annotation in AssemblyProgram for patch generation. (Closed)

Created:
3 years, 8 months ago by huangs
Modified:
3 years, 8 months ago
Reviewers:
Will Harris
CC:
chromium-reviews, wfh+watch_chromium.org, huangs+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Courgette] Refactor: Store Label Annotation in AssemblyProgram for patch generation. For Courgette-gen, label adjustment needs lists of abs32 & rel32 Label* sorted by file offset. Let these lists be "Label Annotations". Previously these were extracted during label adjustment from list of instructions in AssemblyProgram, but now we wish to remove these stored instructions. This CL make AssemblyProgram store Label annotations. These are computed only when needed (Courgette-gen / -gen1a). Details: - Add ParseDetecteExecutableWithAnnotation() alongside ParseDetecteExecutable(), to avoid affecting flows that don't require Label Annotations. - AssemblyProgram: Add |*_label_annotations_| as storage vectors. These are optionally populated in InstructionStoreReceptor when Disassembler::Disassemble() gets called. - InstructionCountReceptor now put into use. - Simplify Label adjustment: AssemblyProgram::HandleInstructionLabels() is replaced with visiting AssemblyProgram's Label Annotations. - Subtle: GraphAdjuster now includes abs64. The class doesn't get used, but the change is logical anyway. BUG=660980 Review-Url: https://codereview.chromium.org/2793153003 Cr-Commit-Position: refs/heads/master@{#464536} Committed: https://chromium.googlesource.com/chromium/src/+/c4155eb674ece85b214aaf4cb781510d7377d390

Patch Set 1 #

Total comments: 2

Patch Set 2 : Sync and merge. #

Patch Set 3 : Rename *_label_annotation to *_label_annotations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -98 lines) Patch
M courgette/adjustment_method.cc View 1 2 2 chunks +4 lines, -11 lines 0 comments Download
M courgette/adjustment_method_2.cc View 1 2 2 chunks +4 lines, -10 lines 0 comments Download
M courgette/adjustment_method_unittest.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M courgette/assembly_program.h View 1 2 4 chunks +25 lines, -12 lines 0 comments Download
M courgette/assembly_program.cc View 1 2 6 chunks +45 lines, -28 lines 0 comments Download
M courgette/courgette_tool.cc View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M courgette/disassembler.h View 1 chunk +3 lines, -3 lines 0 comments Download
M courgette/disassembler.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M courgette/disassembler_elf_32_x86_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M courgette/patch_generator_x86_32.h View 4 chunks +9 lines, -11 lines 0 comments Download
M courgette/program_detector.h View 2 chunks +8 lines, -1 line 0 comments Download
M courgette/program_detector.cc View 2 chunks +28 lines, -12 lines 0 comments Download

Messages

Total messages: 26 (15 generated)
huangs
PTAL. Thanks!
3 years, 8 months ago (2017-04-04 20:13:27 UTC) #2
huangs
Ping for review. Thanks!
3 years, 8 months ago (2017-04-10 16:54:52 UTC) #7
huangs
Changed to wfh@, since chrisha@ is OOO. PTAL. Thanks!
3 years, 8 months ago (2017-04-13 15:53:56 UTC) #9
Will Harris
am I right a lot of code to support the -gen1a switch? how often is ...
3 years, 8 months ago (2017-04-13 17:14:05 UTC) #10
huangs
Re: -gen1a switch: It's likely just a debugging tool that doesn't get used in production. ...
3 years, 8 months ago (2017-04-13 18:02:06 UTC) #11
Will Harris
On 2017/04/13 18:02:06, huangs wrote: > Re: -gen1a switch: It's likely just a debugging tool ...
3 years, 8 months ago (2017-04-13 18:51:05 UTC) #13
huangs
Oh, I manually tested it, and verified that the code changes in courgette_tool.cc are needed ...
3 years, 8 months ago (2017-04-13 18:53:35 UTC) #14
Will Harris
okay sure. lgtm :)
3 years, 8 months ago (2017-04-13 19:16:22 UTC) #15
huangs
Thanks. Committing soon!
3 years, 8 months ago (2017-04-13 19:29:49 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2793153003/40001
3 years, 8 months ago (2017-04-13 20:38:33 UTC) #23
commit-bot: I haz the power
3 years, 8 months ago (2017-04-13 20:48:06 UTC) #26
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/c4155eb674ece85b214aaf4cb781...

Powered by Google App Engine
This is Rietveld 408576698