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