diff src/share/vm/graal/graalCompiler.cpp @ 5000:b5dc2403c1e7

add option to inline VTable stubs
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 01 Mar 2012 12:11:19 +0100
parents 8aa283b5e173
children 5e6f1026a63e
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompiler.cpp	Thu Mar 01 12:10:41 2012 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp	Thu Mar 01 12:11:19 2012 +0100
@@ -274,6 +274,17 @@
   HotSpotMethodResolved::set_maxLocals(obj, method->max_locals());
   HotSpotMethodResolved::set_maxStackSize(obj, method->max_stack());
   HotSpotMethodResolved::set_canBeInlined(obj, !CompilerOracle::should_not_inline(method));
+
+  int vtable_entry_offset;
+  if (instanceKlass::cast(method->method_holder())->is_interface()) {
+    vtable_entry_offset = -1;
+  } else {
+    // get entry offset in words
+    vtable_entry_offset = instanceKlass::vtable_start_offset() + method->vtable_index() * vtableEntry::size();
+    // convert to bytes
+    vtable_entry_offset = vtable_entry_offset * wordSize + vtableEntry::method_offset_in_bytes();
+  }
+  HotSpotMethodResolved::set_vtableEntryOffset(obj, vtable_entry_offset);
   
   method->set_graal_mirror(obj());
   return obj;