diff options
author | Alex Light <allight@google.com> | 2014-07-08 09:53:18 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-07-08 10:06:08 -0700 |
commit | eefbe39799126afdf7d315a79359b9da23d1cef5 (patch) | |
tree | 7818d2124be53d5b01c11118ba6fe26f86adc0d5 /patchoat/patchoat.h | |
parent | c4c601b6dbe5e1a7321d663b36a531a87f21e931 (diff) | |
download | android_art-eefbe39799126afdf7d315a79359b9da23d1cef5.tar.gz android_art-eefbe39799126afdf7d315a79359b9da23d1cef5.tar.bz2 android_art-eefbe39799126afdf7d315a79359b9da23d1cef5.zip |
Fix some style nitpicks
Change-Id: Icfdd327f4ddf129f0a8607162c09ba271c1d49d9
Diffstat (limited to 'patchoat/patchoat.h')
-rw-r--r-- | patchoat/patchoat.h | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h index b9f36d4f8d..a63e6f44b8 100644 --- a/patchoat/patchoat.h +++ b/patchoat/patchoat.h @@ -36,38 +36,29 @@ class Object; class Reference; class Class; class ArtMethod; -}; - -int patchoat(int argc, char** argv); +}; // namespace mirror class PatchOat { public: - static bool Patch(File* oat_in, off_t delta, File* oat_out, TimingLogger& timings); + static bool Patch(File* oat_in, off_t delta, File* oat_out, TimingLogger* timings); static bool Patch(const std::string& art_location, off_t delta, File* art_out, InstructionSet isa, - TimingLogger& timings); + TimingLogger* timings); static bool Patch(const File* oat_in, const std::string& art_location, off_t delta, File* oat_out, File* art_out, InstructionSet isa, - TimingLogger& timings); + TimingLogger* timings); private: - std::unique_ptr<ElfFile> oat_file_; - MemMap* image_; - gc::accounting::ContinuousSpaceBitmap* bitmap_; - MemMap* heap_; - off_t delta_; - TimingLogger& timings_; - // Takes ownership only of the ElfFile. All other pointers are only borrowed. - PatchOat(ElfFile* oat_file, off_t delta, TimingLogger& timings) + PatchOat(ElfFile* oat_file, off_t delta, TimingLogger* timings) : oat_file_(oat_file), delta_(delta), timings_(timings) {} PatchOat(MemMap* image, gc::accounting::ContinuousSpaceBitmap* bitmap, - MemMap* heap, off_t delta, TimingLogger& timings) + MemMap* heap, off_t delta, TimingLogger* timings) : image_(image), bitmap_(bitmap), heap_(heap), delta_(delta), timings_(timings) {} PatchOat(ElfFile* oat_file, MemMap* image, gc::accounting::ContinuousSpaceBitmap* bitmap, - MemMap* heap, off_t delta, TimingLogger& timings) + MemMap* heap, off_t delta, TimingLogger* timings) : oat_file_(oat_file), image_(image), bitmap_(bitmap), heap_(heap), delta_(delta), timings_(timings) {} ~PatchOat() {} @@ -98,6 +89,8 @@ class PatchOat { mirror::Object* RelocatedCopyOf(mirror::Object*); mirror::Object* RelocatedAddressOf(mirror::Object* obj); + // Walks through the old image and patches the mmap'd copy of it to the new offset. It does not + // change the heap. class PatchVisitor { public: PatchVisitor(PatchOat* patcher, mirror::Object* copy) : patcher_(patcher), copy_(copy) {} @@ -112,6 +105,18 @@ class PatchOat { mirror::Object* copy_; }; + // The elf file we are patching. + std::unique_ptr<ElfFile> oat_file_; + // A mmap of the image we are patching. This is modified. + const MemMap* image_; + // The heap we are patching. This is not modified. + gc::accounting::ContinuousSpaceBitmap* bitmap_; + // The heap we are patching. This is not modified. + const MemMap* heap_; + // The amount we are changing the offset by. + off_t delta_; + TimingLogger* timings_; + DISALLOW_IMPLICIT_CONSTRUCTORS(PatchOat); }; |