Add basic support for object pointer poisoning
ObjPtr is a pointer that checks for heap corruption and is meant
to replace mirror::Object* in places where a mirror::Object* is a
local variable. Whenever there is a possible suspend point, the
current thread's object pointers are all invalidated. This is done
by storing a cookie in the object pointer associated with what thread
created it.
Added test case in object_test.
Example failure:
object_test F 25379 25379 object_pointer.h:70] Check failed:
IsValid() Invalid cookie, expected 0 but got 2
Bug: 31113334
Test: test-art-host-gtest-object_test
Change-Id: I9fa80ccaf2f0448621942935af702a243a3e1ee6
5 files changed