hotspot/src/share/vm/asm/codeBuffer.cpp
changeset 35086 bbf32241d851
parent 33794 41ef3dc95179
child 35495 e27da438fa13
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp	Fri Dec 04 16:38:04 2015 +0100
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp	Fri Dec 04 23:46:19 2015 +0300
@@ -305,6 +305,31 @@
   }
 }
 
+void CodeSection::relocate(address at, relocInfo::relocType rtype, int format, jint method_index) {
+  RelocationHolder rh;
+  switch (rtype) {
+    case relocInfo::none: return;
+    case relocInfo::opt_virtual_call_type: {
+      rh = opt_virtual_call_Relocation::spec(method_index);
+      break;
+    }
+    case relocInfo::static_call_type: {
+      rh = static_call_Relocation::spec(method_index);
+      break;
+    }
+    case relocInfo::virtual_call_type: {
+      assert(method_index == 0, "resolved method overriding is not supported");
+      rh = Relocation::spec_simple(rtype);
+      break;
+    }
+    default: {
+      rh = Relocation::spec_simple(rtype);
+      break;
+    }
+  }
+  relocate(at, rh, format);
+}
+
 void CodeSection::relocate(address at, RelocationHolder const& spec, int format) {
   Relocation* reloc = spec.reloc();
   relocInfo::relocType rtype = (relocInfo::relocType) reloc->type();