diff options
| author | 2011-09-18 15:58:35 -0700 | |
|---|---|---|
| committer | 2011-09-19 09:31:34 -0700 | |
| commit | 25c3325bf95036bf325fc7cb21b4fd6d40282857 (patch) | |
| tree | 58d95f906ca62f9cf69106c459db972e32af01a0 /src/java_lang_System.cc | |
| parent | e5de95b3f9609e02fefd7cda7b21f30c9412eb4c (diff) | |
Fix compiler class initialization to properly deal with super classes
Also moving active parts of compiler_test to be oat tests including
IntMath and Invoke. Added an interface invocation test case to Invoke
test. Changed Compiler to CHECK that it is not used once the
Runtime::IsStarted, forcing some jni_compiler_test to have two phases,
one for compiling before Runtime::Start and one for JNI operations
after the Runtime::IsStarted.
Finally, fixed Class::CanPutArrayElementFromCode by removing
CanPutArrayElement and calling IsAssignableFrom directly.
Change-Id: I52ca4dbc0e02db65f274ccc3ca7468dce365a44e
Diffstat (limited to 'src/java_lang_System.cc')
| -rw-r--r-- | src/java_lang_System.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/java_lang_System.cc b/src/java_lang_System.cc index 8aeefcd0c1..42bae22c40 100644 --- a/src/java_lang_System.cc +++ b/src/java_lang_System.cc @@ -207,19 +207,19 @@ void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, jobject // and cause us to copy incompatible elements. Object* const * srcObj = reinterpret_cast<Object* const *>(srcBytes + srcPos * width); - Class* dstClass = dstArray->GetClass(); + Class* dstClass = dstArray->GetClass()->GetComponentType(); Class* initialElementClass = NULL; if (length > 0 && srcObj[0] != NULL) { initialElementClass = srcObj[0]->GetClass(); - if (!Class::CanPutArrayElement(initialElementClass, dstClass)) { + if (!dstClass->IsAssignableFrom(initialElementClass)) { initialElementClass = NULL; } } int copyCount; for (copyCount = 0; copyCount < length; copyCount++) { - if (srcObj[copyCount] != NULL && srcObj[copyCount]->GetClass() != initialElementClass && !Class::CanPutArrayElement(srcObj[copyCount]->GetClass(), dstClass)) { + if (srcObj[copyCount] != NULL && srcObj[copyCount]->GetClass() != initialElementClass && !dstClass->IsAssignableFrom(srcObj[copyCount]->GetClass())) { // Can't put this element into the array. // We'll copy up to this point, then throw. break; |