diff src/share/vm/runtime/compilationPolicy.cpp @ 17937:78bbf4d43a14

8037816: Fix for 8036122 breaks build with Xcode5/clang 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas 8043164: Format warning in traceStream.hpp Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings Reviewed-by: kvn, coleenp, iveresov, twisti
author drchase
date Thu, 22 May 2014 15:52:41 -0400
parents 7150b16fda52
children 52b4284cb496
line wrap: on
line diff
--- a/src/share/vm/runtime/compilationPolicy.cpp	Thu May 15 18:23:26 2014 -0400
+++ b/src/share/vm/runtime/compilationPolicy.cpp	Thu May 22 15:52:41 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -170,7 +170,7 @@
 void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {
   if (TraceOnStackReplacement) {
     if (osr_nm == NULL) tty->print_cr("compilation failed");
-    else tty->print_cr("nmethod " INTPTR_FORMAT, osr_nm);
+    else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));
   }
 }
 #endif // !PRODUCT
@@ -417,6 +417,7 @@
 }
 
 #ifndef PRODUCT
+PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL
 void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) {
   if (TraceInvocationCounterOverflow) {
     MethodCounters* mcs = m->method_counters();
@@ -428,7 +429,10 @@
       bci == InvocationEntryBci
       ? "comp-policy cntr ovfl @ %d in entry of "
       : "comp-policy cntr ovfl @ %d in loop of ";
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL
     tty->print(msg, bci);
+PRAGMA_DIAG_POP
     m->print_value();
     tty->cr();
     ic->print();
@@ -503,7 +507,7 @@
     if (TraceCompilationPolicy) {
       tty->print("method invocation trigger: ");
       m->print_short_name(tty);
-      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)m(), m->code_size());
+      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size());
     }
     RegisterMap reg_map(thread, false);
     javaVFrame* triggerVF = thread->last_java_vframe(&reg_map);
@@ -512,7 +516,7 @@
 
     if (first->top_method()->code() != NULL) {
       // called obsolete method/nmethod -- no need to recompile
-      if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, first->top_method()->code());
+      if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code()));
     } else {
       if (TimeCompilationPolicy) accumulated_time()->start();
       GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50);
@@ -640,7 +644,7 @@
     if (TraceCompilationPolicy && Verbose) {
       tty->print("\n\t     check caller: ");
       next_m->print_short_name(tty);
-      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", (address)next_m(), next_m->code_size());
+      tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size());
     }
 
     current = next;