changeset 18855:82e5b5ccdb0c

fix format string Contributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
author Doug Simon <doug.simon@oracle.com>
date Tue, 13 Jan 2015 13:04:37 +0100
parents b8d3f84740c7
children e86659e1f813
files src/gpu/hsail/vm/gpu_hsail.cpp src/gpu/hsail/vm/gpu_hsail.hpp src/gpu/hsail/vm/gpu_hsail_Tlab.hpp src/share/vm/graal/graalCodeInstaller.cpp
diffstat 4 files changed, 39 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/gpu/hsail/vm/gpu_hsail.cpp	Tue Jan 13 12:59:48 2015 +0100
+++ b/src/gpu/hsail/vm/gpu_hsail.cpp	Tue Jan 13 13:04:37 2015 +0100
@@ -147,7 +147,7 @@
   // We avoid HSAILAllocationInfo logic if kernel does not allocate
   // in which case the num_tlabs passed in will be 0
   HSAILAllocationInfo* allocInfo = (num_tlabs == 0 ?  NULL : new HSAILAllocationInfo(num_tlabs, dimX, allocBytesPerWorkitem));
-  
+
   // Reset the kernel arguments
   _okra_clear_args(kernel);
 
@@ -260,11 +260,11 @@
                 if (oopMapHelper.is_oop(pc_offset, bit)) {
                   if (bit < hsailFrame->num_d_regs()) {
                     // show $d reg oop
-                    tty->print_cr("  oop $d%d = " INTPTR_FORMAT, bit, hsailFrame->get_oop_for_bit(bit));
+                    tty->print_cr("  oop $d%d = " PTR64_FORMAT, bit, hsailFrame->get_oop_for_bit(bit));
                   } else {
                     // show stack slot oop
                     int stackOffset = (bit - hsailFrame->num_d_regs()) * 8;  // 8 bytes per stack slot
-                    tty->print_cr("  oop stk:%d = " INTPTR_FORMAT, stackOffset, hsailFrame->get_oop_for_bit(bit));
+                    tty->print_cr("  oop stk:%d = " PTR64_FORMAT, stackOffset, hsailFrame->get_oop_for_bit(bit));
                   }
                 }
               }
@@ -281,7 +281,7 @@
     }
     // when we are done with the deopts, we don't need to oops_do anything
     // in the saved state anymore
-    thread->set_gpu_hsail_deopt_info(NULL);  
+    thread->set_gpu_hsail_deopt_info(NULL);
 
     // Handle any never_ran workitems if there were any
     {
@@ -345,7 +345,7 @@
   env->GetByteArrayRegion(code_handle, 0, code_len, (jbyte*) code);
   env->GetStringUTFRegion(name_handle, 0, name_len, name);
 
-  // The kernel entrypoint is always run for the time being  
+  // The kernel entrypoint is always run for the time being
   const char* entryPointName = "&run";
   jlong okra_kernel;
   {
@@ -400,7 +400,7 @@
   // If Okra library is not already loaded, load it here
   if (okra_lib_handle == NULL) {
     okra_lib_handle = os::dll_load(okra_library_name, ebuf, O_BUFLEN);
-  }  
+  }
   if (okra_lib_handle == NULL) {
     // Unable to open Okra library
     if (TraceGPUInteraction) {
@@ -408,7 +408,7 @@
     }
     return false;
   }
-  
+
   guarantee(_okra_get_context == NULL, "cannot repeat GPU initialization");
 
   // At this point we know  okra_lib_handle is valid whether we loaded
--- a/src/gpu/hsail/vm/gpu_hsail.hpp	Tue Jan 13 12:59:48 2015 +0100
+++ b/src/gpu/hsail/vm/gpu_hsail.hpp	Tue Jan 13 13:04:37 2015 +0100
@@ -37,13 +37,13 @@
   int _deopts;
   int _overflows;
   bool _changeSeen;
-  
+
 public:
   HSAILKernelStats() {
     _dispatches = _deopts = _overflows = 0;
     _changeSeen = false;
   }
-  
+
   void incDeopts() {
     _deopts++;
     _changeSeen = true;
@@ -52,7 +52,7 @@
     _overflows++;
     _changeSeen = true;
   }
-  
+
   void finishDispatch() {
     _dispatches++;
     if (_changeSeen) {
@@ -60,7 +60,7 @@
       _changeSeen = false;
     }
   }
-  
+
   void print() {
     tty->print_cr("Disp=%d, Deopts=%d, Ovflows=%d", _dispatches, _deopts, _overflows);
   }
@@ -108,7 +108,7 @@
     char _ignore;
     jobject _oop_map_array;
     // keep a pointer last so save area following it is word aligned
-    jboolean* _never_ran_array; 
+    jboolean* _never_ran_array;
 
    public:
     // static HSAILKernelStats kernelStats;
@@ -134,7 +134,8 @@
       _oop_map_array = oop_map_array;
       _deopt_span = sizeof(HSAILKernelDeoptimization) + sizeof(HSAILFrame) + bytesPerSaveArea;
       if (TraceGPUInteraction) {
-        tty->print_cr("HSAILDeoptimizationInfo allocated, %d slots of size %d, total size = 0x%lx bytes", _num_slots, _deopt_span, (_num_slots * _deopt_span + sizeof(HSAILDeoptimizationInfo)));
+        tty->print_cr("HSAILDeoptimizationInfo allocated, %d slots of size %d total size = " SIZE_FORMAT_HEX " bytes",
+            _num_slots, _deopt_span, (_num_slots * _deopt_span + sizeof(HSAILDeoptimizationInfo)));
       }
     }
 
@@ -248,7 +249,7 @@
   static okra_clear_args_func_t                 _okra_clear_args;
   static okra_dispose_kernel_func_t             _okra_dispose_kernel;
   static okra_dispose_context_func_t            _okra_dispose_context;
-  
+
 protected:
   static void* _device_context;
 
--- a/src/gpu/hsail/vm/gpu_hsail_Tlab.hpp	Tue Jan 13 12:59:48 2015 +0100
+++ b/src/gpu/hsail/vm/gpu_hsail_Tlab.hpp	Tue Jan 13 13:04:37 2015 +0100
@@ -99,7 +99,8 @@
         max_tlab_infos = 8 * _num_tlabs;   // an arbitrary multiple
       }
       if (TraceGPUInteraction) {
-        tty->print_cr("heapFree = %ld, newTlabSize=%ld, tlabInfos allocated = %ld", heap_bytes_free, new_tlab_size, max_tlab_infos);
+        tty->print_cr("heapFree = " SIZE_FORMAT ", newTlabSize=" SIZE_FORMAT ", tlabInfos allocated = " SIZE_FORMAT,
+          heap_bytes_free, new_tlab_size, max_tlab_infos);
       }
     }
 
@@ -108,7 +109,7 @@
     _tlab_infos_pool_next = &_tlab_infos_pool_start[_num_tlabs];
     _tlab_infos_pool_end = &_tlab_infos_pool_start[max_tlab_infos];
     _tlab_align_reserve_bytes = ThreadLocalAllocBuffer::alignment_reserve_in_bytes();
-      
+
     // we will fill the first N tlabInfos from the gpu_hsail_tlabs
     for (int i = 0; i < _num_tlabs; i++) {
       ThreadLocalAllocBuffer* tlab = thread->get_gpu_hsail_tlab_at(i);
@@ -116,7 +117,7 @@
         tty->print("gpu_hsail_tlab %d at %p -> ", i, tlab);
         printTlabInfoFromThread(tlab);
       }
-      
+
       // Here we try to get a new tlab if current one is null. Note:
       // eventually we may want to test if the size is too small based
       // on some heuristic where we see how much this kernel tends to
@@ -165,7 +166,7 @@
     }
     for (HSAILTlabInfo* tlabInfo = _tlab_infos_pool_start; tlabInfo < _tlab_infos_pool_next; tlabInfo++) {
       if (TraceGPUInteraction) {
-        tty->print_cr("postprocess tlabInfo %p, start=%p, top=%p, end=%p, last_good_top=%p", tlabInfo, 
+        tty->print_cr("postprocess tlabInfo %p, start=%p, top=%p, end=%p, last_good_top=%p", tlabInfo,
                       tlabInfo->start(), tlabInfo->top(), tlabInfo->end(), tlabInfo->last_good_top());
       }
       ThreadLocalAllocBuffer* tlab = tlabInfo->tlab();
@@ -177,7 +178,7 @@
           anyOverflows = true;
           overflowed = true;
           if (TraceGPUInteraction) {
-            long overflowAmount = (long) tlabInfo->top() - (long) tlabInfo->last_good_top(); 
+            long overflowAmount = (long) tlabInfo->top() - (long) tlabInfo->last_good_top();
             tty->print_cr("tlabInfo %p (tlab = %p) overflowed by %ld bytes, setting last good top to %p", tlabInfo, tlab, overflowAmount, tlabInfo->last_good_top());
           }
           tlabInfo->_top = tlabInfo->last_good_top();
@@ -192,17 +193,17 @@
         if (overflowed) {
           tlab->make_parsable(true);
         }
-        
+
         size_t delta = (long)(tlabInfo->top()) - (long)(tlabInfo->original_top());
         if (TraceGPUInteraction) {
-          tty->print_cr("%ld bytes were allocated by tlabInfo %p (start %p, top %p, end %p", delta, tlabInfo,
-                        tlabInfo->start(), tlabInfo->top(), tlabInfo->end());
+          tty->print_cr(SIZE_FORMAT " bytes were allocated by tlabInfo %p (start %p, top %p, end %p",
+            delta, tlabInfo, tlabInfo->start(), tlabInfo->top(), tlabInfo->end());
         }
         bytesAllocated += delta;
       }
     }
     if (TraceGPUInteraction) {
-      tty->print_cr("%ld total bytes were allocated in this kernel", bytesAllocated);
+      tty->print_cr(SIZE_FORMAT" total bytes were allocated in this kernel", bytesAllocated);
     }
     if (anyOverflows) {
       // Hsail::kernelStats.incOverflows();
@@ -219,14 +220,14 @@
   bool getNewGpuHsailTlab(ThreadLocalAllocBuffer* tlab) {
 
     tlab->clear_before_allocation();    // fill and retire old tlab (will also check for null)
-    
+
     // get a size for a new tlab that is based on the desired_size
     size_t new_tlab_size = tlab->compute_size(0);
     if (new_tlab_size == 0) return false;
-    
+
     HeapWord* tlab_start = Universe::heap()->allocate_new_tlab(new_tlab_size);
     if (tlab_start == NULL) return false;
-    
+
     // ..and clear it if required
     if (ZeroTLAB) {
       Copy::zero_to_words(tlab_start, new_tlab_size);
@@ -235,7 +236,7 @@
     tlab->fill(tlab_start, tlab_start, new_tlab_size);
     return true;
   }
-  
+
   void printTlabInfoFromThread (ThreadLocalAllocBuffer* tlab) {
     HeapWord* start = tlab->start();
     HeapWord* top = tlab->top();
@@ -245,9 +246,10 @@
     size_t tlabUsed = tlab->used() * HeapWordSize;
     size_t tlabSize = tlabFree + tlabUsed;
     double freePct = 100.0 * (double) tlabFree/(double) tlabSize;
-    tty->print_cr("(%p, %p, %p), siz=%ld, free=%ld (%f%%)", start, top, end, tlabSize, tlabFree, freePct);
+    tty->print_cr("(%p, %p, %p), siz=" SIZE_FORMAT ", free=" SIZE_FORMAT " (%f%%)",
+      start, top, end, tlabSize, tlabFree, freePct);
   }
-  
+
 };
-  
+
 #endif // GPU_HSAIL_VM_GPU_HSAIL_TLAB_HPP
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Tue Jan 13 12:59:48 2015 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Tue Jan 13 13:04:37 2015 +0100
@@ -169,20 +169,20 @@
   if (obj->is_a(HotSpotResolvedObjectTypeImpl::klass())) {
     Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(obj));
     if (compressed) {
-      assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ " INTPTR_FORMAT " != " INTPTR_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
+      assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
     } else {
-      assert((Klass*) prim == klass, err_msg("%s @ " INTPTR_FORMAT " != " INTPTR_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
+      assert((Klass*) prim == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
     }
     int index = oop_recorder->find_index(klass);
     TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string());
   } else if (obj->is_a(HotSpotResolvedJavaMethodImpl::klass())) {
     Method* method = (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(obj);
-    assert(!compressed, err_msg("unexpected compressed method pointer %s @ " INTPTR_FORMAT " = " INTPTR_FORMAT, method->name()->as_C_string(), p2i(method), prim));
+    assert(!compressed, err_msg("unexpected compressed method pointer %s @ " INTPTR_FORMAT " = " PTR64_FORMAT, method->name()->as_C_string(), p2i(method), prim));
     int index = oop_recorder->find_index(method);
     TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), method->name()->as_C_string());
   } else {
     assert(java_lang_String::is_instance(obj),
-        err_msg("unexpected metadata reference (%s) for constant " JLONG_FORMAT " (" INTPTR_FORMAT ")", obj->klass()->name()->as_C_string(), prim, prim));
+        err_msg("unexpected metadata reference (%s) for constant " JLONG_FORMAT " (" PTR64_FORMAT ")", obj->klass()->name()->as_C_string(), prim, prim));
   }
 }
 
@@ -563,7 +563,7 @@
   }
   memcpy(_instructions->start(), code()->base(T_BYTE), _code_size);
   _instructions->set_end(end_pc);
-  
+
   for (int i = 0; i < data_section_patches()->length(); i++) {
     Handle patch = data_section_patches()->obj_at(i);
     Handle reference = CompilationResult_DataPatch::reference(patch);
@@ -870,7 +870,7 @@
 
   NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
   jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method);
-  
+
   if (debug_info != NULL) {
     oop frame = DebugInfo::bytecodePosition(debug_info);
     _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));