diff src/cpu/x86/vm/interp_masm_x86_64.cpp @ 4526:0e1f15ec0e94

fixed profiling of typechecks
author Christian Haeubl <christian.haeubl@oracle.com>
date Tue, 07 Feb 2012 11:43:05 -0800
parents f08d439fab8c
children 723df37192d6
line wrap: on
line diff
--- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Feb 06 19:04:18 2012 -0800
+++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Tue Feb 07 11:43:05 2012 -0800
@@ -1126,8 +1126,11 @@
                                         Register receiver, Register mdp,
                                         Register reg2, int start_row,
                                         Label& done, bool is_virtual_call) {
+  // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks)
+  bool use_counter_for_polymorphic_case = is_virtual_call || UseGraal;
+
   if (TypeProfileWidth == 0) {
-    if (is_virtual_call) {
+    if (use_counter_for_polymorphic_case) {
       increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
     }
     return;
@@ -1164,7 +1167,7 @@
       testptr(reg2, reg2);
       if (start_row == last_row) {
         // The only thing left to do is handle the null case.
-        if (is_virtual_call) {
+        if (use_counter_for_polymorphic_case) {
           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.
@@ -1297,7 +1300,8 @@
 
 
 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) {
-  if (ProfileInterpreter && TypeProfileCasts) {
+  // changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks)
+  if (ProfileInterpreter && TypeProfileCasts && !UseGraal) {
     Label profile_continue;
 
     // If no method data exists, go to profile_continue.