hotspot/src/cpu/x86/vm/x86_32.ad
changeset 35086 bbf32241d851
parent 34162 16b54851eaf6
child 35135 dd2ce9021031
--- a/hotspot/src/cpu/x86/vm/x86_32.ad	Fri Dec 04 16:38:04 2015 +0100
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad	Fri Dec 04 23:46:19 2015 +0300
@@ -1898,17 +1898,18 @@
     // who we intended to call.
     cbuf.set_insts_mark();
     $$$emit8$primary;
+
     if (!_method) {
       emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
-                     runtime_call_Relocation::spec(), RELOC_IMM32 );
-    } else if (_optimized_virtual) {
-      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
-                     opt_virtual_call_Relocation::spec(), RELOC_IMM32 );
+                     runtime_call_Relocation::spec(),
+                     RELOC_IMM32);
     } else {
+      int method_index = resolved_method_index(cbuf);
+      RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
+                                                  : static_call_Relocation::spec(method_index);
       emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
-                     static_call_Relocation::spec(), RELOC_IMM32 );
-    }
-    if (_method) {  // Emit stub for static call.
+                     rspec, RELOC_DISP32);
+      // Emit stubs for static call.
       address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
       if (stub == NULL) {
         ciEnv::current()->record_failure("CodeCache is full");
@@ -1919,7 +1920,7 @@
 
   enc_class Java_Dynamic_Call (method meth) %{    // JAVA DYNAMIC CALL
     MacroAssembler _masm(&cbuf);
-    __ ic_call((address)$meth$$method);
+    __ ic_call((address)$meth$$method, resolved_method_index(cbuf));
   %}
 
   enc_class Java_Compiled_Call (method meth) %{    // JAVA COMPILED CALL
@@ -11504,7 +11505,7 @@
     __ arrays_equals(false, $str1$$Register, $str2$$Register,
                      $cnt$$Register, $result$$Register, $tmp3$$Register,
                      $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */);
-  %} 
+  %}
 
   ins_pipe( pipe_slow );
 %}