summaryrefslogtreecommitdiffstats
path: root/runtime/indirect_reference_table.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-09-03 16:16:56 -0700
committerIan Rogers <irogers@google.com>2014-09-03 17:15:54 -0700
commitc0542af3e2170143ba40d89136e284997e16bf64 (patch)
treea61e3b9cd297a4c52a0c0488a502cb77c47f0690 /runtime/indirect_reference_table.h
parentd3c9358544bbab15093614c5c2b6a9de86e11f7b (diff)
downloadart-c0542af3e2170143ba40d89136e284997e16bf64.tar.gz
art-c0542af3e2170143ba40d89136e284997e16bf64.tar.bz2
art-c0542af3e2170143ba40d89136e284997e16bf64.zip
Remove abuse of mirror::Object* to reference special values.
Remove kInvalidIndirectRefObject, kClearedJniWeakGlobal and ObjectRegistry::kInvalidObject. Handle error conditions by passing in or returning an error value. GetObjectRefType is simplified to be faster and not return invalid references that are not expected according to the spec. Adjust check JNI and jni_internal_test appropriately. Fix cases in the debugger/JDWP of out arguments being passed by reference. Bug: 17376993 Change-Id: I3ce8a28c01827e163f4dc288449959464da788b1
Diffstat (limited to 'runtime/indirect_reference_table.h')
-rw-r--r--runtime/indirect_reference_table.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h
index d25bc42dfc..562ba1e8df 100644
--- a/runtime/indirect_reference_table.h
+++ b/runtime/indirect_reference_table.h
@@ -105,10 +105,6 @@ class MemMap;
*/
typedef void* IndirectRef;
-// Magic failure values; must not pass Heap::ValidateObject() or Heap::IsHeapAddress().
-static mirror::Object* const kInvalidIndirectRefObject = reinterpret_cast<mirror::Object*>(0xdead4321);
-static mirror::Object* const kClearedJniWeakGlobal = reinterpret_cast<mirror::Object*>(0xdead1234);
-
/*
* Indirect reference kind, used as the two low bits of IndirectRef.
*
@@ -229,18 +225,11 @@ class IrtIterator {
}
private:
- void SkipNullsAndTombstones() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- // We skip NULLs and tombstones. Clients don't want to see implementation details.
- while (i_ < capacity_ &&
- (table_[i_].IsNull() ||
- table_[i_].Read<kWithoutReadBarrier>() == kClearedJniWeakGlobal)) {
- ++i_;
- }
- }
+ void SkipNullsAndTombstones() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
GcRoot<mirror::Object>* const table_;
size_t i_;
- size_t capacity_;
+ const size_t capacity_;
};
bool inline operator==(const IrtIterator& lhs, const IrtIterator& rhs) {