OSDN Git Service

Intercept JNI invocation of String.<init> methods.
authorJeff Hao <jeffhao@google.com>
Wed, 20 May 2015 03:30:23 +0000 (20:30 -0700)
committerJeff Hao <jeffhao@google.com>
Thu, 21 May 2015 01:32:14 +0000 (18:32 -0700)
commit15e9ad1d028d7f12cb598b075453173532a00d91
treef31edd7f7e10d8372c452229b4f9eb749647864f
parent5d52f3dca52548f4a4598abd06432cad3dca6b8a
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
runtime/debugger.cc
runtime/indirect_reference_table-inl.h
runtime/indirect_reference_table.h
runtime/jni_internal.cc
runtime/jni_internal_test.cc
runtime/reflection.cc
runtime/reflection.h
runtime/reflection_test.cc
runtime/thread.cc
test/004-JniTest/jni_test.cc
test/020-string/src/Main.java