diff options
author | Jeff Hao <jeffhao@google.com> | 2015-05-19 20:30:23 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2015-05-20 18:32:14 -0700 |
commit | 15e9ad1d028d7f12cb598b075453173532a00d91 (patch) | |
tree | f31edd7f7e10d8372c452229b4f9eb749647864f /runtime/indirect_reference_table-inl.h | |
parent | 5d52f3dca52548f4a4598abd06432cad3dca6b8a (diff) | |
download | art-15e9ad1d028d7f12cb598b075453173532a00d91.tar.gz art-15e9ad1d028d7f12cb598b075453173532a00d91.tar.bz2 art-15e9ad1d028d7f12cb598b075453173532a00d91.zip |
Intercept JNI invocation of String.<init> methods.
libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and
initialize a string instead of using the recommended NewObject. This
change adds an intercept to change the String.<init> call to a
StringFactory call instead. Then, it uses the object id of the original
string object referrer and maps it to the result of the StringFactory.
Bug: 21288130
Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17
Diffstat (limited to 'runtime/indirect_reference_table-inl.h')
-rw-r--r-- | runtime/indirect_reference_table-inl.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/indirect_reference_table-inl.h b/runtime/indirect_reference_table-inl.h index 639be515f6..39d850fc4d 100644 --- a/runtime/indirect_reference_table-inl.h +++ b/runtime/indirect_reference_table-inl.h @@ -82,6 +82,15 @@ inline mirror::Object* IndirectReferenceTable::Get(IndirectRef iref) const { return obj; } +inline void IndirectReferenceTable::Update(IndirectRef iref, mirror::Object* obj) { + if (!GetChecked(iref)) { + LOG(WARNING) << "IndirectReferenceTable Update failed to find reference " << iref; + return; + } + uint32_t idx = ExtractIndex(iref); + table_[idx].SetReference(obj); +} + } // namespace art #endif // ART_RUNTIME_INDIRECT_REFERENCE_TABLE_INL_H_ |