[Courgette] Refactor: Add AssemblyProgram::DispatchInstructionLabels() to hide InstructionVector usage.
To reduce Courgette memory usage (and possibly solve installer crashes),
we plan to make AssemblyProgram store instructions more efficiently. We
start by hiding AssemblyProgram's InstructionVector usage from
AdjustmentMethod and AdjustmentMethod2.
Previously AdjustmentMethod[2] get AssemblyProgram's instruction vector,
and loop over it to extract labels from abs32/rel32 instructions. This
CL moves the loop into AssemblyProgram::DispatchInstructionLabels().
Callers now specify a map of handlers, without needing to know how
instructions are stored in AssemblyProgram.
Review-Url: https://codereview.chromium.org/2457133002
Cr-Original-Commit-Position: refs/heads/master@{#428522}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 99a5a8c3c7923a01d37a6d6d63203234d310e320
4 files changed