changeset 9022:51039f5f10ba

8167027: Scala HelloWord crash Reviewed-by: enevill
author snazarki
date Tue, 04 Oct 2016 13:21:19 +0300
parents 80b7b526cffb
children 4d49ebf4b433
files src/cpu/aarch32/vm/macroAssembler_aarch32.cpp
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch32/vm/macroAssembler_aarch32.cpp	Sun Sep 04 20:52:43 2016 +0100
+++ b/src/cpu/aarch32/vm/macroAssembler_aarch32.cpp	Tue Oct 04 13:21:19 2016 +0300
@@ -863,11 +863,7 @@
                                            RegisterOrConstant vtable_index,
                                            Register method_result) {
   const int base = InstanceKlass::vtable_start_offset() * wordSize;
-  //assert(vtableEntry::size() * wordSize == 8,
-  //       "adjust the scaling in the code below");
-  // FIXME What scaling needs changing as indexes address by one word
   int vtable_offset_in_bytes = base + vtableEntry::method_offset_in_bytes();
-
   if (vtable_index.is_register()) {
     lea(method_result, Address(recv_klass,
                                vtable_index.as_register(),
@@ -875,7 +871,12 @@
     ldr(method_result, Address(method_result, vtable_offset_in_bytes));
   } else {
     vtable_offset_in_bytes += vtable_index.as_constant() * wordSize;
-    ldr(method_result, Address(recv_klass, vtable_offset_in_bytes));
+    if(is_valid_for_offset_imm(vtable_offset_in_bytes, 12)) {
+      ldr(method_result, Address(recv_klass, vtable_offset_in_bytes));
+    } else {
+      mov(method_result, vtable_offset_in_bytes);
+      ldr(method_result, Address(recv_klass, method_result));
+    }
   }
 }