Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/codeCache.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 | 510fbd28919c |
children | 52b4284cb496 882004b9e7e1 |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
79 | 79 |
80 int total() { return total_size; } | 80 int total() { return total_size; } |
81 bool is_empty() { return count == 0; } | 81 bool is_empty() { return count == 0; } |
82 | 82 |
83 void print(const char* title) { | 83 void print(const char* title) { |
84 tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])", | 84 tty->print_cr(" #%d %s = %dK (hdr %d%%, loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])", |
85 count, | 85 count, |
86 title, | 86 title, |
87 total() / K, | 87 (int)(total() / K), |
88 header_size * 100 / total_size, | 88 header_size * 100 / total_size, |
89 relocation_size * 100 / total_size, | 89 relocation_size * 100 / total_size, |
90 code_size * 100 / total_size, | 90 code_size * 100 / total_size, |
91 stub_size * 100 / total_size, | 91 stub_size * 100 / total_size, |
92 scopes_oop_size * 100 / total_size, | 92 scopes_oop_size * 100 / total_size, |
189 // Expansion failed | 189 // Expansion failed |
190 return NULL; | 190 return NULL; |
191 } | 191 } |
192 if (PrintCodeCacheExtension) { | 192 if (PrintCodeCacheExtension) { |
193 ResourceMark rm; | 193 ResourceMark rm; |
194 tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)", | 194 tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)", |
195 (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(), | 195 (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(), |
196 (address)_heap->high() - (address)_heap->low_boundary()); | 196 (address)_heap->high() - (address)_heap->low_boundary()); |
197 } | 197 } |
198 } | 198 } |
199 maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() - | 199 maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() - |
494 while(iter.next()) { | 494 while(iter.next()) { |
495 if (iter.type() == relocInfo::virtual_call_type) { | 495 if (iter.type() == relocInfo::virtual_call_type) { |
496 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) { | 496 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) { |
497 CompiledIC *ic = CompiledIC_at(iter.reloc()); | 497 CompiledIC *ic = CompiledIC_at(iter.reloc()); |
498 if (TraceCompiledIC) { | 498 if (TraceCompiledIC) { |
499 tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder()); | 499 tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder())); |
500 ic->print(); | 500 ic->print(); |
501 } | 501 } |
502 assert(ic->cached_icholder() != NULL, "must be non-NULL"); | 502 assert(ic->cached_icholder() != NULL, "must be non-NULL"); |
503 count++; | 503 count++; |
504 } | 504 } |
773 | 773 |
774 void CodeCache::print_trace(const char* event, CodeBlob* cb, int size) { | 774 void CodeCache::print_trace(const char* event, CodeBlob* cb, int size) { |
775 if (PrintCodeCache2) { // Need to add a new flag | 775 if (PrintCodeCache2) { // Need to add a new flag |
776 ResourceMark rm; | 776 ResourceMark rm; |
777 if (size == 0) size = cb->size(); | 777 if (size == 0) size = cb->size(); |
778 tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size); | 778 tty->print_cr("CodeCache %s: addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size); |
779 } | 779 } |
780 } | 780 } |
781 | 781 |
782 void CodeCache::print_internals() { | 782 void CodeCache::print_internals() { |
783 int nmethodCount = 0; | 783 int nmethodCount = 0; |
898 } | 898 } |
899 } | 899 } |
900 | 900 |
901 tty->print_cr("CodeCache:"); | 901 tty->print_cr("CodeCache:"); |
902 | 902 |
903 tty->print_cr("nmethod dependency checking time %f", dependentCheckTime.seconds(), | 903 tty->print_cr("nmethod dependency checking time %f, per dependent %f", dependentCheckTime.seconds(), |
904 dependentCheckTime.seconds() / dependentCheckCount); | 904 dependentCheckTime.seconds() / dependentCheckCount); |
905 | 905 |
906 if (!live.is_empty()) { | 906 if (!live.is_empty()) { |
907 live.print("live"); | 907 live.print("live"); |
908 } | 908 } |
945 total/K, (total - unallocated_capacity())/K, | 945 total/K, (total - unallocated_capacity())/K, |
946 maxCodeCacheUsed/K, unallocated_capacity()/K); | 946 maxCodeCacheUsed/K, unallocated_capacity()/K); |
947 | 947 |
948 if (detailed) { | 948 if (detailed) { |
949 st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]", | 949 st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]", |
950 _heap->low_boundary(), | 950 p2i(_heap->low_boundary()), |
951 _heap->high(), | 951 p2i(_heap->high()), |
952 _heap->high_boundary()); | 952 p2i(_heap->high_boundary())); |
953 st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT | 953 st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT |
954 " adapters=" UINT32_FORMAT, | 954 " adapters=" UINT32_FORMAT, |
955 nof_blobs(), nof_nmethods(), nof_adapters()); | 955 nof_blobs(), nof_nmethods(), nof_adapters()); |
956 st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ? | 956 st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ? |
957 "enabled" : Arguments::mode() == Arguments::_int ? | 957 "enabled" : Arguments::mode() == Arguments::_int ? |