diff src/cpu/x86/vm/interp_masm_x86_64.cpp @ 7154:5d0bb7d52783

changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
author Doug Simon <doug.simon@oracle.com>
date Wed, 12 Dec 2012 21:36:40 +0100
parents e522a00b91aa
children 291ffc492eb6
line wrap: on
line diff
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Dec 12 15:46:11 2012 +0100
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Dec 12 21:36:40 2012 +0100
@@ -1149,17 +1149,15 @@
                                         Register receiver, Register mdp,
                                         Register reg2, int start_row,
                                         Label& done, bool is_virtual_call) {
-#ifdef GRAAL
-  // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks)
-  bool use_counter_for_polymorphic_case = true;
-#else
-  bool use_counter_for_polymorphic_case = is_virtual_call;
-#endif
-
   if (TypeProfileWidth == 0) {
-    if (use_counter_for_polymorphic_case) {
+    if (is_virtual_call) {
       increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
     }
+#ifdef GRAAL
+    else {
+      increment_mdp_data_at(mdp, in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset()));
+    }
+#endif
     return;
   }
 
@@ -1194,11 +1192,17 @@
       testptr(reg2, reg2);
       if (start_row == last_row) {
         // The only thing left to do is handle the null case.
-        if (use_counter_for_polymorphic_case) {
+        if (is_virtual_call GRAAL_ONLY(|| true)) {
           jccb(Assembler::zero, found_null);
           // Receiver did not match any saved receiver and there is no empty row for it.
           // Increment total counter to indicate polymorphic case.
-          increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
+          int offset = in_bytes(CounterData::count_offset());
+#ifdef GRAAL
+          if (!is_virtual_call) {
+            offset = in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset());
+          }
+#endif
+          increment_mdp_data_at(mdp, offset);
           jmp(done);
           bind(found_null);
         } else {
@@ -1327,8 +1331,6 @@
 
 
 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) {
-// changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks)
-#ifndef GRAAL
   if (ProfileInterpreter && TypeProfileCasts) {
     Label profile_continue;
 
@@ -1344,7 +1346,6 @@
 
     bind (profile_continue);
   }
-#endif
 }