Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 17 | #ifndef ART_COMPILER_IMAGE_WRITER_H_ |
| 18 | #define ART_COMPILER_IMAGE_WRITER_H_ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 19 | |
| 20 | #include <stdint.h> |
| 21 | |
| 22 | #include <cstddef> |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 23 | #include <memory> |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 24 | #include <set> |
| 25 | #include <string> |
| 26 | |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 27 | #include "base/macros.h" |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 28 | #include "driver/compiler_driver.h" |
| 29 | #include "mem_map.h" |
| 30 | #include "oat_file.h" |
| 31 | #include "mirror/dex_cache.h" |
| 32 | #include "os.h" |
| 33 | #include "safe_map.h" |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 34 | #include "gc/space/space.h" |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 35 | |
| 36 | namespace art { |
| 37 | |
| 38 | // Write a Space built during compilation for use during execution. |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 39 | class ImageWriter FINAL { |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 40 | public: |
| 41 | explicit ImageWriter(const CompilerDriver& compiler_driver) |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 42 | : compiler_driver_(compiler_driver), oat_file_(NULL), image_end_(0), |
| 43 | image_objects_offset_begin_(0), image_begin_(NULL), |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 44 | oat_data_begin_(NULL), interpreter_to_interpreter_bridge_offset_(0), |
Jeff Hao | 88474b4 | 2013-10-23 16:24:40 -0700 | [diff] [blame] | 45 | interpreter_to_compiled_code_bridge_offset_(0), portable_imt_conflict_trampoline_offset_(0), |
Andreas Gampe | 2da8823 | 2014-02-27 12:26:20 -0800 | [diff] [blame] | 46 | portable_resolution_trampoline_offset_(0), quick_generic_jni_trampoline_offset_(0), |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 47 | quick_imt_conflict_trampoline_offset_(0), quick_resolution_trampoline_offset_(0), |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 48 | compile_pic_(false), target_ptr_size_(0), bin_slot_sizes_(), bin_slot_count_() {} |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 49 | |
| 50 | ~ImageWriter() {} |
| 51 | |
| 52 | bool Write(const std::string& image_filename, |
| 53 | uintptr_t image_begin, |
| 54 | const std::string& oat_filename, |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 55 | const std::string& oat_location, |
| 56 | bool compile_pic) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 57 | LOCKS_EXCLUDED(Locks::mutator_lock_); |
| 58 | |
| 59 | uintptr_t GetOatDataBegin() { |
| 60 | return reinterpret_cast<uintptr_t>(oat_data_begin_); |
| 61 | } |
| 62 | |
| 63 | private: |
| 64 | bool AllocMemory(); |
| 65 | |
Mathieu Chartier | 31e8925 | 2013-08-28 11:29:12 -0700 | [diff] [blame] | 66 | // Mark the objects defined in this space in the given live bitmap. |
| 67 | void RecordImageAllocations() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 68 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 69 | // Classify different kinds of bins that objects end up getting packed into during image writing. |
| 70 | enum Bin { |
| 71 | // Likely-clean: |
| 72 | kBinString, // [String] Almost always immutable (except for obj header). |
| 73 | kBinArtMethodsManagedInitialized, // [ArtMethod] Not-native, and initialized. Unlikely to dirty |
| 74 | // Unknown mix of clean/dirty: |
| 75 | kBinRegular, |
| 76 | // Likely-dirty: |
| 77 | // All classes get their own bins since their fields often dirty |
| 78 | kBinClassInitializedFinalStatics, // Class initializers have been run, no non-final statics |
| 79 | kBinClassInitialized, // Class initializers have been run |
| 80 | kBinClassVerified, // Class verified, but initializers haven't been run |
| 81 | kBinArtMethodNative, // Art method that is actually native |
| 82 | kBinArtMethodNotInitialized, // Art method with a declaring class that wasn't initialized |
| 83 | // Don't care about other art methods since they don't dirty |
| 84 | // Add more bins here if we add more segregation code. |
| 85 | kBinSize, |
| 86 | }; |
| 87 | |
| 88 | static constexpr size_t kBinBits = MinimumBitsToStore(kBinSize - 1); |
| 89 | // uint32 = typeof(lockword_) |
| 90 | static constexpr size_t kBinShift = BitSizeOf<uint32_t>() - kBinBits; |
| 91 | // 111000.....0 |
| 92 | static constexpr size_t kBinMask = ((static_cast<size_t>(1) << kBinBits) - 1) << kBinShift; |
| 93 | |
| 94 | // We use the lock word to store the bin # and bin index of the object in the image. |
| 95 | // |
| 96 | // The struct size must be exactly sizeof(LockWord), currently 32-bits, since this will end up |
| 97 | // stored in the lock word bit-for-bit when object forwarding addresses are being calculated. |
| 98 | struct BinSlot { |
| 99 | explicit BinSlot(uint32_t lockword); |
| 100 | BinSlot(Bin bin, uint32_t index); |
| 101 | |
| 102 | // The bin an object belongs to, i.e. regular, class/verified, class/initialized, etc. |
| 103 | Bin GetBin() const; |
| 104 | // The offset in bytes from the beginning of the bin. Aligned to object size. |
| 105 | uint32_t GetIndex() const; |
| 106 | // Pack into a single uint32_t, for storing into a lock word. |
| 107 | explicit operator uint32_t() const { return lockword_; } |
| 108 | // Comparison operator for map support |
| 109 | bool operator<(const BinSlot& other) const { return lockword_ < other.lockword_; } |
| 110 | |
| 111 | private: |
| 112 | // Must be the same size as LockWord, any larger and we would truncate the data. |
| 113 | const uint32_t lockword_; |
| 114 | }; |
| 115 | |
Mathieu Chartier | 31e8925 | 2013-08-28 11:29:12 -0700 | [diff] [blame] | 116 | // We use the lock word to store the offset of the object in the image. |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 117 | void AssignImageOffset(mirror::Object* object, BinSlot bin_slot) |
| 118 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 119 | void SetImageOffset(mirror::Object* object, BinSlot bin_slot, size_t offset) |
Mathieu Chartier | 590fee9 | 2013-09-13 13:46:47 -0700 | [diff] [blame] | 120 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | b0fa5dc | 2014-04-28 16:47:08 -0700 | [diff] [blame] | 121 | bool IsImageOffsetAssigned(mirror::Object* object) const |
| 122 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 123 | size_t GetImageOffset(mirror::Object* object) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 124 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 125 | void AssignImageBinSlot(mirror::Object* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 126 | void SetImageBinSlot(mirror::Object* object, BinSlot bin_slot) |
| 127 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 128 | bool IsImageBinSlotAssigned(mirror::Object* object) const |
| 129 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 130 | BinSlot GetImageBinSlot(mirror::Object* object) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 131 | |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 132 | static void* GetImageAddressCallback(void* writer, mirror::Object* obj) |
| 133 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 134 | return reinterpret_cast<ImageWriter*>(writer)->GetImageAddress(obj); |
| 135 | } |
| 136 | |
Ian Rogers | b0fa5dc | 2014-04-28 16:47:08 -0700 | [diff] [blame] | 137 | mirror::Object* GetImageAddress(mirror::Object* object) const |
| 138 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 139 | if (object == NULL) { |
| 140 | return NULL; |
| 141 | } |
| 142 | return reinterpret_cast<mirror::Object*>(image_begin_ + GetImageOffset(object)); |
| 143 | } |
| 144 | |
Ian Rogers | b0fa5dc | 2014-04-28 16:47:08 -0700 | [diff] [blame] | 145 | mirror::Object* GetLocalAddress(mirror::Object* object) const |
| 146 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 147 | size_t offset = GetImageOffset(object); |
| 148 | byte* dst = image_->Begin() + offset; |
| 149 | return reinterpret_cast<mirror::Object*>(dst); |
| 150 | } |
| 151 | |
| 152 | const byte* GetOatAddress(uint32_t offset) const { |
| 153 | #if !defined(ART_USE_PORTABLE_COMPILER) |
| 154 | // With Quick, code is within the OatFile, as there are all in one |
| 155 | // .o ELF object. However with Portable, the code is always in |
| 156 | // different .o ELF objects. |
| 157 | DCHECK_LT(offset, oat_file_->Size()); |
| 158 | #endif |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 159 | if (offset == 0u) { |
| 160 | return nullptr; |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 161 | } |
| 162 | return oat_data_begin_ + offset; |
| 163 | } |
| 164 | |
| 165 | // Returns true if the class was in the original requested image classes list. |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 166 | bool IsImageClass(mirror::Class* klass) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 167 | |
| 168 | // Debug aid that list of requested image classes. |
| 169 | void DumpImageClasses(); |
| 170 | |
| 171 | // Preinitializes some otherwise lazy fields (such as Class name) to avoid runtime image dirtying. |
| 172 | void ComputeLazyFieldsForImageClasses() |
| 173 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 174 | static bool ComputeLazyFieldsForClassesVisitor(mirror::Class* klass, void* arg) |
| 175 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 176 | |
| 177 | // Wire dex cache resolved strings to strings in the image to avoid runtime resolution. |
Ian Rogers | b0fa5dc | 2014-04-28 16:47:08 -0700 | [diff] [blame] | 178 | void ComputeEagerResolvedStrings() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 179 | static void ComputeEagerResolvedStringsCallback(mirror::Object* obj, void* arg) |
| 180 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 181 | |
| 182 | // Remove unwanted classes from various roots. |
| 183 | void PruneNonImageClasses() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 184 | static bool NonImageClassesVisitor(mirror::Class* c, void* arg) |
| 185 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 186 | |
| 187 | // Verify unwanted classes removed. |
Piotr Jastrzebski | 3a7cf8e | 2015-05-07 09:44:22 +0100 | [diff] [blame] | 188 | void CheckNonImageClassesRemoved(); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 189 | static void CheckNonImageClassesRemovedCallback(mirror::Object* obj, void* arg) |
| 190 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 191 | |
| 192 | // Lays out where the image objects will be at runtime. |
| 193 | void CalculateNewObjectOffsets(size_t oat_loaded_size, size_t oat_data_offset) |
| 194 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 195 | mirror::ObjectArray<mirror::Object>* CreateImageRoots() const |
| 196 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 197 | void CalculateObjectBinSlots(mirror::Object* obj) |
| 198 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 199 | void UnbinObjectsIntoOffset(mirror::Object* obj) |
Mathieu Chartier | 590fee9 | 2013-09-13 13:46:47 -0700 | [diff] [blame] | 200 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 201 | |
| 202 | void WalkInstanceFields(mirror::Object* obj, mirror::Class* klass) |
| 203 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 204 | void WalkFieldsInOrder(mirror::Object* obj) |
| 205 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 206 | static void WalkFieldsCallback(mirror::Object* obj, void* arg) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 207 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 208 | static void UnbinObjectsIntoOffsetCallback(mirror::Object* obj, void* arg) |
| 209 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 210 | |
| 211 | // Creates the contiguous image in memory and adjusts pointers. |
Piotr Jastrzebski | 3a7cf8e | 2015-05-07 09:44:22 +0100 | [diff] [blame] | 212 | void CopyAndFixupObjects(); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 213 | static void CopyAndFixupObjectsCallback(mirror::Object* obj, void* arg) |
| 214 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 215 | void FixupMethod(mirror::ArtMethod* orig, mirror::ArtMethod* copy) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 216 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Ian Rogers | ef7d42f | 2014-01-06 12:55:46 -0800 | [diff] [blame] | 217 | void FixupObject(mirror::Object* orig, mirror::Object* copy) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 218 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 219 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 220 | // Get quick code for non-resolution/imt_conflict/abstract method. |
| 221 | const byte* GetQuickCode(mirror::ArtMethod* method, bool* quick_is_interpreted) |
| 222 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 223 | |
| 224 | const byte* GetQuickEntryPoint(mirror::ArtMethod* method) |
| 225 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
| 226 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 227 | // Patches references in OatFile to expect runtime addresses. |
Alex Light | 53cb16b | 2014-06-12 11:26:29 -0700 | [diff] [blame] | 228 | void PatchOatCodeAndMethods(File* elf_file) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 229 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 230 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 231 | // Calculate the sum total of the bin slot sizes in [0, up_to). Defaults to all bins. |
| 232 | size_t GetBinSizeSum(Bin up_to = kBinSize) const; |
| 233 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 234 | const CompilerDriver& compiler_driver_; |
| 235 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 236 | // oat file with code for this image |
| 237 | OatFile* oat_file_; |
| 238 | |
| 239 | // Memory mapped for generating the image. |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 240 | std::unique_ptr<MemMap> image_; |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 241 | |
| 242 | // Offset to the free space in image_. |
| 243 | size_t image_end_; |
| 244 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 245 | // Offset from image_begin_ to where the first object is in image_. |
| 246 | size_t image_objects_offset_begin_; |
| 247 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 248 | // Beginning target image address for the output image. |
| 249 | byte* image_begin_; |
| 250 | |
Mathieu Chartier | 590fee9 | 2013-09-13 13:46:47 -0700 | [diff] [blame] | 251 | // Saved hashes (objects are inside of the image so that they don't move). |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 252 | std::vector<std::pair<mirror::Object*, uint32_t>> saved_hashes_; |
Mathieu Chartier | 590fee9 | 2013-09-13 13:46:47 -0700 | [diff] [blame] | 253 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 254 | // Saved hashes (objects are bin slots to inside of the image, not yet allocated an address). |
| 255 | std::map<BinSlot, uint32_t> saved_hashes_map_; |
| 256 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 257 | // Beginning target oat address for the pointers from the output image to its oat file. |
| 258 | const byte* oat_data_begin_; |
| 259 | |
Mathieu Chartier | 31e8925 | 2013-08-28 11:29:12 -0700 | [diff] [blame] | 260 | // Image bitmap which lets us know where the objects inside of the image reside. |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 261 | std::unique_ptr<gc::accounting::ContinuousSpaceBitmap> image_bitmap_; |
Mathieu Chartier | 31e8925 | 2013-08-28 11:29:12 -0700 | [diff] [blame] | 262 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 263 | // Offset from oat_data_begin_ to the stubs. |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 264 | uint32_t interpreter_to_interpreter_bridge_offset_; |
| 265 | uint32_t interpreter_to_compiled_code_bridge_offset_; |
| 266 | uint32_t jni_dlsym_lookup_offset_; |
Jeff Hao | 88474b4 | 2013-10-23 16:24:40 -0700 | [diff] [blame] | 267 | uint32_t portable_imt_conflict_trampoline_offset_; |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 268 | uint32_t portable_resolution_trampoline_offset_; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 269 | uint32_t portable_to_interpreter_bridge_offset_; |
Andreas Gampe | 2da8823 | 2014-02-27 12:26:20 -0800 | [diff] [blame] | 270 | uint32_t quick_generic_jni_trampoline_offset_; |
Jeff Hao | 88474b4 | 2013-10-23 16:24:40 -0700 | [diff] [blame] | 271 | uint32_t quick_imt_conflict_trampoline_offset_; |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 272 | uint32_t quick_resolution_trampoline_offset_; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 273 | uint32_t quick_to_interpreter_bridge_offset_; |
Igor Murashkin | 90ca5c0 | 2014-10-22 11:37:02 -0700 | [diff] [blame] | 274 | bool compile_pic_; |
Mathieu Chartier | b7ea3ac | 2014-03-24 16:54:46 -0700 | [diff] [blame] | 275 | |
Mathieu Chartier | e832e64 | 2014-11-10 11:08:06 -0800 | [diff] [blame] | 276 | // Size of pointers on the target architecture. |
| 277 | size_t target_ptr_size_; |
| 278 | |
Igor Murashkin | 3f735bd | 2014-11-14 15:01:59 -0800 | [diff] [blame] | 279 | // Bin slot tracking for dirty object packing |
| 280 | size_t bin_slot_sizes_[kBinSize]; // Number of bytes in a bin |
| 281 | size_t bin_slot_count_[kBinSize]; // Number of objects in a bin |
| 282 | |
Mathieu Chartier | b7ea3ac | 2014-03-24 16:54:46 -0700 | [diff] [blame] | 283 | friend class FixupVisitor; |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 284 | friend class FixupClassVisitor; |
Mathieu Chartier | b7ea3ac | 2014-03-24 16:54:46 -0700 | [diff] [blame] | 285 | DISALLOW_COPY_AND_ASSIGN(ImageWriter); |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 286 | }; |
| 287 | |
| 288 | } // namespace art |
| 289 | |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 290 | #endif // ART_COMPILER_IMAGE_WRITER_H_ |