Test conversion of floats and doubles to strings.
There was some confusion about what Method::HasCode meant, and we weren't
quite ready to compile all methods _and_ be able to invoke them. We were
also missing a couple of native methods in Throwable that we need if we've
compiled all Throwable's code (because the next time we ask ClassLinker to
do anything, it'll try to throw NoClassDefFoundException from one of the
ClassLoaders, and that will try to run a Throwable constructor, which will
end up trying to call these native methods).
Change-Id: If4783f3c866aaa72413d7b7810ef2541d418ae33
diff --git a/src/object.cc b/src/object.cc
index 6cb6d98..2c66690 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -464,7 +464,7 @@
void Method::SetCode(ByteArray* code_array, InstructionSet instruction_set,
ByteArray* mapping_table) {
- CHECK(!HasCode() || IsNative());
+ CHECK(GetCode() == NULL || IsNative());
SetFieldPtr<ByteArray*>(OFFSET_OF_OBJECT_MEMBER(Method, code_array_), code_array, false);
SetFieldPtr<ByteArray*>(OFFSET_OF_OBJECT_MEMBER(Method, mapping_table_),
mapping_table, false);
@@ -494,7 +494,16 @@
// Call the invoke stub associated with the method.
// Pass everything as arguments.
const Method::InvokeStub* stub = GetInvokeStub();
- if (HasCode() && stub != NULL) {
+
+ bool have_executable_code = (GetCode() != NULL);
+#if !defined(__arm__)
+ // Currently we can only compile for ARM, so we can't execute
+ // code on other architectures even if we do have it.
+ have_executable_code = false;
+#endif
+
+ if (have_executable_code && stub != NULL) {
+ LOG(INFO) << "invoking " << PrettyMethod(this) << " code=" << (void*) GetCode() << " stub=" << (void*) stub;
(*stub)(this, receiver, self, args, result);
} else {
LOG(WARNING) << "Not invoking method with no associated code: " << PrettyMethod(this);