Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | |
Mathieu Chartier | c56057e | 2014-05-04 13:18:58 -0700 | [diff] [blame] | 17 | #include "indirect_reference_table-inl.h" |
| 18 | |
Elliott Hughes | a250199 | 2011-08-26 19:39:54 -0700 | [diff] [blame] | 19 | #include "jni_internal.h" |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 20 | #include "reference_table.h" |
Elliott Hughes | a250199 | 2011-08-26 19:39:54 -0700 | [diff] [blame] | 21 | #include "runtime.h" |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 22 | #include "scoped_thread_state_change.h" |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 23 | #include "thread.h" |
Ian Rogers | cdd1d2d | 2011-08-18 09:58:17 -0700 | [diff] [blame] | 24 | #include "utils.h" |
Mathieu Chartier | 6dda898 | 2014-03-06 11:11:48 -0800 | [diff] [blame] | 25 | #include "verify_object-inl.h" |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 26 | |
| 27 | #include <cstdlib> |
| 28 | |
| 29 | namespace art { |
| 30 | |
Ian Rogers | 719d1a3 | 2014-03-06 12:13:39 -0800 | [diff] [blame] | 31 | template<typename T> |
| 32 | class MutatorLockedDumpable { |
| 33 | public: |
| 34 | explicit MutatorLockedDumpable(T& value) |
| 35 | SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) : value_(value) { |
| 36 | } |
| 37 | |
| 38 | void Dump(std::ostream& os) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 39 | value_.Dump(os); |
| 40 | } |
| 41 | |
| 42 | private: |
| 43 | T& value_; |
| 44 | |
| 45 | DISALLOW_COPY_AND_ASSIGN(MutatorLockedDumpable); |
| 46 | }; |
| 47 | |
| 48 | template<typename T> |
| 49 | std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs) |
| 50 | // TODO: should be SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) however annotalysis |
| 51 | // currently fails for this. |
| 52 | NO_THREAD_SAFETY_ANALYSIS { |
| 53 | rhs.Dump(os); |
| 54 | return os; |
| 55 | } |
| 56 | |
Mathieu Chartier | c56057e | 2014-05-04 13:18:58 -0700 | [diff] [blame] | 57 | void IndirectReferenceTable::AbortIfNoCheckJNI() { |
Elliott Hughes | a250199 | 2011-08-26 19:39:54 -0700 | [diff] [blame] | 58 | // If -Xcheck:jni is on, it'll give a more detailed error before aborting. |
| 59 | if (!Runtime::Current()->GetJavaVM()->check_jni) { |
| 60 | // Otherwise, we want to abort rather than hand back a bad reference. |
| 61 | LOG(FATAL) << "JNI ERROR (app bug): see above."; |
| 62 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | IndirectReferenceTable::IndirectReferenceTable(size_t initialCount, |
Elliott Hughes | ba8eee1 | 2012-01-24 20:25:24 -0800 | [diff] [blame] | 66 | size_t maxCount, IndirectRefKind desiredKind) { |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 67 | CHECK_GT(initialCount, 0U); |
| 68 | CHECK_LE(initialCount, maxCount); |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 69 | CHECK_NE(desiredKind, kHandleScopeOrInvalid); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 70 | |
Mathieu Chartier | c56057e | 2014-05-04 13:18:58 -0700 | [diff] [blame] | 71 | std::string error_str; |
| 72 | const size_t initial_bytes = initialCount * sizeof(const mirror::Object*); |
| 73 | const size_t table_bytes = maxCount * sizeof(const mirror::Object*); |
| 74 | table_mem_map_.reset(MemMap::MapAnonymous("indirect ref table", nullptr, table_bytes, |
| 75 | PROT_READ | PROT_WRITE, false, &error_str)); |
| 76 | CHECK(table_mem_map_.get() != nullptr) << error_str; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 77 | |
Mathieu Chartier | c56057e | 2014-05-04 13:18:58 -0700 | [diff] [blame] | 78 | table_ = reinterpret_cast<mirror::Object**>(table_mem_map_->Begin()); |
| 79 | CHECK(table_ != nullptr); |
| 80 | memset(table_, 0xd1, initial_bytes); |
| 81 | |
| 82 | const size_t slot_bytes = maxCount * sizeof(IndirectRefSlot); |
| 83 | slot_mem_map_.reset(MemMap::MapAnonymous("indirect ref table slots", nullptr, slot_bytes, |
| 84 | PROT_READ | PROT_WRITE, false, &error_str)); |
| 85 | CHECK(slot_mem_map_.get() != nullptr) << error_str; |
| 86 | slot_data_ = reinterpret_cast<IndirectRefSlot*>(slot_mem_map_->Begin()); |
| 87 | CHECK(slot_data_ != nullptr); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 88 | |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 89 | segment_state_.all = IRT_FIRST_SEGMENT; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 90 | alloc_entries_ = initialCount; |
| 91 | max_entries_ = maxCount; |
| 92 | kind_ = desiredKind; |
| 93 | } |
| 94 | |
| 95 | IndirectReferenceTable::~IndirectReferenceTable() { |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Mathieu Chartier | 423d2a3 | 2013-09-12 17:33:56 -0700 | [diff] [blame] | 98 | IndirectRef IndirectReferenceTable::Add(uint32_t cookie, mirror::Object* obj) { |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 99 | IRTSegmentState prevState; |
| 100 | prevState.all = cookie; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 101 | size_t topIndex = segment_state_.parts.topIndex; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 102 | |
Mathieu Chartier | cd2cfff | 2013-12-19 15:46:55 -0800 | [diff] [blame] | 103 | CHECK(obj != NULL); |
Mathieu Chartier | 6dda898 | 2014-03-06 11:11:48 -0800 | [diff] [blame] | 104 | VerifyObject(obj); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 105 | DCHECK(table_ != NULL); |
| 106 | DCHECK_LE(alloc_entries_, max_entries_); |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 107 | DCHECK_GE(segment_state_.parts.numHoles, prevState.parts.numHoles); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 108 | |
| 109 | if (topIndex == alloc_entries_) { |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 110 | // reached end of allocated space; did we hit buffer max? |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 111 | if (topIndex == max_entries_) { |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 112 | LOG(FATAL) << "JNI ERROR (app bug): " << kind_ << " table overflow " |
| 113 | << "(max=" << max_entries_ << ")\n" |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 114 | << MutatorLockedDumpable<IndirectReferenceTable>(*this); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | size_t newSize = alloc_entries_ * 2; |
| 118 | if (newSize > max_entries_) { |
| 119 | newSize = max_entries_; |
| 120 | } |
| 121 | DCHECK_GT(newSize, alloc_entries_); |
| 122 | |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 123 | alloc_entries_ = newSize; |
| 124 | } |
| 125 | |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 126 | // We know there's enough room in the table. Now we just need to find |
| 127 | // the right spot. If there's a hole, find it and fill it; otherwise, |
| 128 | // add to the end of the list. |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 129 | IndirectRef result; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 130 | int numHoles = segment_state_.parts.numHoles - prevState.parts.numHoles; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 131 | if (numHoles > 0) { |
| 132 | DCHECK_GT(topIndex, 1U); |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 133 | // Find the first hole; likely to be near the end of the list. |
Mathieu Chartier | 423d2a3 | 2013-09-12 17:33:56 -0700 | [diff] [blame] | 134 | mirror::Object** pScan = &table_[topIndex - 1]; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 135 | DCHECK(*pScan != NULL); |
| 136 | while (*--pScan != NULL) { |
| 137 | DCHECK_GE(pScan, table_ + prevState.parts.topIndex); |
| 138 | } |
| 139 | UpdateSlotAdd(obj, pScan - table_); |
| 140 | result = ToIndirectRef(obj, pScan - table_); |
| 141 | *pScan = obj; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 142 | segment_state_.parts.numHoles--; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 143 | } else { |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 144 | // Add to the end. |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 145 | UpdateSlotAdd(obj, topIndex); |
| 146 | result = ToIndirectRef(obj, topIndex); |
| 147 | table_[topIndex++] = obj; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 148 | segment_state_.parts.topIndex = topIndex; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 149 | } |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 150 | if (false) { |
| 151 | LOG(INFO) << "+++ added at " << ExtractIndex(result) << " top=" << segment_state_.parts.topIndex |
| 152 | << " holes=" << segment_state_.parts.numHoles; |
| 153 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 154 | |
| 155 | DCHECK(result != NULL); |
| 156 | return result; |
| 157 | } |
| 158 | |
Elliott Hughes | 726079d | 2011-10-07 18:43:44 -0700 | [diff] [blame] | 159 | void IndirectReferenceTable::AssertEmpty() { |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 160 | if (UNLIKELY(begin() != end())) { |
| 161 | ScopedObjectAccess soa(Thread::Current()); |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 162 | LOG(FATAL) << "Internal Error: non-empty local reference table\n" |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 163 | << MutatorLockedDumpable<IndirectReferenceTable>(*this); |
Elliott Hughes | 726079d | 2011-10-07 18:43:44 -0700 | [diff] [blame] | 164 | } |
| 165 | } |
| 166 | |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 167 | // Removes an object. We extract the table offset bits from "iref" |
| 168 | // and zap the corresponding entry, leaving a hole if it's not at the top. |
| 169 | // If the entry is not between the current top index and the bottom index |
| 170 | // specified by the cookie, we don't remove anything. This is the behavior |
| 171 | // required by JNI's DeleteLocalRef function. |
| 172 | // This method is not called when a local frame is popped; this is only used |
| 173 | // for explicit single removals. |
| 174 | // Returns "false" if nothing was removed. |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 175 | bool IndirectReferenceTable::Remove(uint32_t cookie, IndirectRef iref) { |
| 176 | IRTSegmentState prevState; |
| 177 | prevState.all = cookie; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 178 | int topIndex = segment_state_.parts.topIndex; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 179 | int bottomIndex = prevState.parts.topIndex; |
| 180 | |
| 181 | DCHECK(table_ != NULL); |
| 182 | DCHECK_LE(alloc_entries_, max_entries_); |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 183 | DCHECK_GE(segment_state_.parts.numHoles, prevState.parts.numHoles); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 184 | |
| 185 | int idx = ExtractIndex(iref); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 186 | |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 187 | if (GetIndirectRefKind(iref) == kHandleScopeOrInvalid && |
| 188 | Thread::Current()->HandleScopeContains(reinterpret_cast<jobject>(iref))) { |
| 189 | LOG(WARNING) << "Attempt to remove local handle scope entry from IRT, ignoring"; |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 190 | return true; |
| 191 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 192 | |
| 193 | if (idx < bottomIndex) { |
Elliott Hughes | 726079d | 2011-10-07 18:43:44 -0700 | [diff] [blame] | 194 | // Wrong segment. |
| 195 | LOG(WARNING) << "Attempt to remove index outside index area (" << idx |
| 196 | << " vs " << bottomIndex << "-" << topIndex << ")"; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 197 | return false; |
| 198 | } |
| 199 | if (idx >= topIndex) { |
Elliott Hughes | 726079d | 2011-10-07 18:43:44 -0700 | [diff] [blame] | 200 | // Bad --- stale reference? |
| 201 | LOG(WARNING) << "Attempt to remove invalid index " << idx |
| 202 | << " (bottom=" << bottomIndex << " top=" << topIndex << ")"; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 203 | return false; |
| 204 | } |
| 205 | |
| 206 | if (idx == topIndex-1) { |
| 207 | // Top-most entry. Scan up and consume holes. |
| 208 | |
Ian Rogers | 987560f | 2014-04-22 11:42:59 -0700 | [diff] [blame] | 209 | if (!CheckEntry("remove", iref, idx)) { |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 210 | return false; |
| 211 | } |
| 212 | |
| 213 | table_[idx] = NULL; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 214 | int numHoles = segment_state_.parts.numHoles - prevState.parts.numHoles; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 215 | if (numHoles != 0) { |
| 216 | while (--topIndex > bottomIndex && numHoles != 0) { |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 217 | if (false) { |
| 218 | LOG(INFO) << "+++ checking for hole at " << topIndex-1 |
| 219 | << " (cookie=" << cookie << ") val=" << table_[topIndex - 1]; |
| 220 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 221 | if (table_[topIndex-1] != NULL) { |
| 222 | break; |
| 223 | } |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 224 | if (false) { |
| 225 | LOG(INFO) << "+++ ate hole at " << (topIndex - 1); |
| 226 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 227 | numHoles--; |
| 228 | } |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 229 | segment_state_.parts.numHoles = numHoles + prevState.parts.numHoles; |
| 230 | segment_state_.parts.topIndex = topIndex; |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 231 | } else { |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 232 | segment_state_.parts.topIndex = topIndex-1; |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 233 | if (false) { |
| 234 | LOG(INFO) << "+++ ate last entry " << topIndex - 1; |
| 235 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 236 | } |
| 237 | } else { |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 238 | // Not the top-most entry. This creates a hole. We NULL out the |
| 239 | // entry to prevent somebody from deleting it twice and screwing up |
| 240 | // the hole count. |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 241 | if (table_[idx] == NULL) { |
| 242 | LOG(INFO) << "--- WEIRD: removing null entry " << idx; |
| 243 | return false; |
| 244 | } |
Ian Rogers | 987560f | 2014-04-22 11:42:59 -0700 | [diff] [blame] | 245 | if (!CheckEntry("remove", iref, idx)) { |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 246 | return false; |
| 247 | } |
| 248 | |
| 249 | table_[idx] = NULL; |
Ian Rogers | dc51b79 | 2011-09-22 20:41:37 -0700 | [diff] [blame] | 250 | segment_state_.parts.numHoles++; |
Ian Rogers | 5a7a74a | 2011-09-26 16:32:29 -0700 | [diff] [blame] | 251 | if (false) { |
| 252 | LOG(INFO) << "+++ left hole at " << idx << ", holes=" << segment_state_.parts.numHoles; |
| 253 | } |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | return true; |
| 257 | } |
| 258 | |
Mathieu Chartier | 83c8ee0 | 2014-01-28 14:50:23 -0800 | [diff] [blame] | 259 | void IndirectReferenceTable::VisitRoots(RootCallback* callback, void* arg, uint32_t tid, |
| 260 | RootType root_type) { |
Mathieu Chartier | 02e2511 | 2013-08-14 16:14:24 -0700 | [diff] [blame] | 261 | for (auto ref : *this) { |
Mathieu Chartier | 815873e | 2014-02-13 18:02:13 -0800 | [diff] [blame] | 262 | callback(ref, arg, tid, root_type); |
Mathieu Chartier | 423d2a3 | 2013-09-12 17:33:56 -0700 | [diff] [blame] | 263 | DCHECK(*ref != nullptr); |
Elliott Hughes | 410c0c8 | 2011-09-01 17:58:25 -0700 | [diff] [blame] | 264 | } |
| 265 | } |
| 266 | |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 267 | void IndirectReferenceTable::Dump(std::ostream& os) const { |
| 268 | os << kind_ << " table dump:\n"; |
Hiroshi Yamauchi | 196851b | 2014-05-29 12:16:04 -0700 | [diff] [blame] | 269 | ReferenceTable::Table entries; |
| 270 | for (size_t i = 0; i < Capacity(); ++i) { |
| 271 | mirror::Object** root = &table_[i]; |
| 272 | mirror::Object* obj = *root; |
| 273 | if (UNLIKELY(obj == nullptr)) { |
| 274 | // Remove NULLs. |
| 275 | } else if (UNLIKELY(obj == kClearedJniWeakGlobal)) { |
| 276 | // ReferenceTable::Dump() will handle kClearedJniWeakGlobal |
| 277 | // while the read barrier won't. |
| 278 | entries.push_back(obj); |
| 279 | } else { |
| 280 | // We need a read barrier if weak globals. Since this is for |
| 281 | // debugging where performance isn't top priority, we |
| 282 | // unconditionally enable the read barrier, which is conservative. |
| 283 | obj = ReadBarrier::BarrierForWeakRoot<mirror::Object, kWithReadBarrier>(root); |
| 284 | entries.push_back(obj); |
Ian Rogers | 63818dc | 2012-09-26 12:23:04 -0700 | [diff] [blame] | 285 | } |
| 286 | } |
Elliott Hughes | 73e66f7 | 2012-05-09 09:34:45 -0700 | [diff] [blame] | 287 | ReferenceTable::Dump(os, entries); |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 288 | } |
| 289 | |
Elliott Hughes | 6c1a394 | 2011-08-17 15:00:06 -0700 | [diff] [blame] | 290 | } // namespace art |