comparison src/share/vm/asm/codeBuffer.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 55fb97c4c58d
children 52b4284cb496 833b0f92429a
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.
985 void CodeSection::dump() { 985 void CodeSection::dump() {
986 address ptr = start(); 986 address ptr = start();
987 for (csize_t step; ptr < end(); ptr += step) { 987 for (csize_t step; ptr < end(); ptr += step) {
988 step = end() - ptr; 988 step = end() - ptr;
989 if (step > jintSize * 4) step = jintSize * 4; 989 if (step > jintSize * 4) step = jintSize * 4;
990 tty->print(PTR_FORMAT ": ", ptr); 990 tty->print(INTPTR_FORMAT ": ", p2i(ptr));
991 while (step > 0) { 991 while (step > 0) {
992 tty->print(" " PTR32_FORMAT, *(jint*)ptr); 992 tty->print(" " PTR32_FORMAT, *(jint*)ptr);
993 ptr += jintSize; 993 ptr += jintSize;
994 } 994 }
995 tty->cr(); 995 tty->cr();
1095 if (_strings != NULL) { 1095 if (_strings != NULL) {
1096 CodeString* c = find(offset); 1096 CodeString* c = find(offset);
1097 while (c && c->offset() == offset) { 1097 while (c && c->offset() == offset) {
1098 stream->bol(); 1098 stream->bol();
1099 stream->print(" ;; "); 1099 stream->print(" ;; ");
1100 stream->print_cr(c->string()); 1100 stream->print_cr("%s", c->string());
1101 c = c->next_comment(); 1101 c = c->next_comment();
1102 } 1102 }
1103 } 1103 }
1104 } 1104 }
1105 1105
1151 1151
1152 1152
1153 void CodeSection::print(const char* name) { 1153 void CodeSection::print(const char* name) {
1154 csize_t locs_size = locs_end() - locs_start(); 1154 csize_t locs_size = locs_end() - locs_start();
1155 tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s", 1155 tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
1156 name, start(), end(), limit(), size(), capacity(), 1156 name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
1157 is_frozen()? " [frozen]": ""); 1157 is_frozen()? " [frozen]": "");
1158 tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d", 1158 tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
1159 name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off()); 1159 name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
1160 if (PrintRelocations) { 1160 if (PrintRelocations) {
1161 RelocIterator iter(this); 1161 RelocIterator iter(this);
1162 iter.print(); 1162 iter.print();
1163 } 1163 }
1164 } 1164 }