Proxy implementation
This rounds out the proxy implementation by adding missing pieces to the
class linker, extending tests and fixing issues in the runtime support.
There are also some tweaks for performance and to clean up Method/Object
a little.
A unit test of the functionality is "art/test/run-test 044"
Change-Id: Id94102d10b81cd9b12b95ba8618f6187490204c4
diff --git a/src/reflection.cc b/src/reflection.cc
index 1294c08..86b4b09 100644
--- a/src/reflection.cc
+++ b/src/reflection.cc
@@ -70,6 +70,7 @@
// Find the actual implementation of the virtual method.
m = receiver->GetClass()->FindVirtualMethodForVirtualOrInterface(m);
+ mid = reinterpret_cast<jmethodID>(m);
}
// Get our arrays of arguments and their types, and check they're the same size.
@@ -310,13 +311,13 @@
Field* primitive_field = o->GetClass()->GetIFields()->Get(0);
if (src_descriptor->Equals("Ljava/lang/Boolean;")) {
src_class = class_linker->FindPrimitiveClass('Z');
- boxed_value.z = primitive_field->GetBoolean(o);
+ boxed_value.i = primitive_field->GetBoolean(o); // and extend read value to 32bits
} else if (src_descriptor->Equals("Ljava/lang/Byte;")) {
src_class = class_linker->FindPrimitiveClass('B');
- boxed_value.b = primitive_field->GetByte(o);
+ boxed_value.i = primitive_field->GetByte(o); // and extend read value to 32bits
} else if (src_descriptor->Equals("Ljava/lang/Character;")) {
src_class = class_linker->FindPrimitiveClass('C');
- boxed_value.c = primitive_field->GetChar(o);
+ boxed_value.i = primitive_field->GetChar(o); // and extend read value to 32bits
} else if (src_descriptor->Equals("Ljava/lang/Float;")) {
src_class = class_linker->FindPrimitiveClass('F');
boxed_value.f = primitive_field->GetFloat(o);
@@ -331,7 +332,7 @@
boxed_value.j = primitive_field->GetLong(o);
} else if (src_descriptor->Equals("Ljava/lang/Short;")) {
src_class = class_linker->FindPrimitiveClass('S');
- boxed_value.s = primitive_field->GetShort(o);
+ boxed_value.i = primitive_field->GetShort(o); // and extend read value to 32bits
} else {
Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
"%s is not a boxed primitive type", PrettyDescriptor(src_descriptor).c_str());