Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/method.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 | 7384f6a12fc1 |
children | 52b4284cb496 ce8f6bb717c9 |
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. |
53 #include "runtime/sharedRuntime.hpp" | 53 #include "runtime/sharedRuntime.hpp" |
54 #include "runtime/signature.hpp" | 54 #include "runtime/signature.hpp" |
55 #include "utilities/quickSort.hpp" | 55 #include "utilities/quickSort.hpp" |
56 #include "utilities/xmlstream.hpp" | 56 #include "utilities/xmlstream.hpp" |
57 | 57 |
58 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC | |
58 | 59 |
59 // Implementation of Method | 60 // Implementation of Method |
60 | 61 |
61 Method* Method::allocate(ClassLoaderData* loader_data, | 62 Method* Method::allocate(ClassLoaderData* loader_data, |
62 int byte_code_size, | 63 int byte_code_size, |
1424 outputStream* _st; | 1425 outputStream* _st; |
1425 bool _use_separator; | 1426 bool _use_separator; |
1426 | 1427 |
1427 void type_name(const char* name) { | 1428 void type_name(const char* name) { |
1428 if (_use_separator) _st->print(", "); | 1429 if (_use_separator) _st->print(", "); |
1429 _st->print(name); | 1430 _st->print("%s", name); |
1430 _use_separator = true; | 1431 _use_separator = true; |
1431 } | 1432 } |
1432 | 1433 |
1433 public: | 1434 public: |
1434 SignatureTypePrinter(Symbol* signature, outputStream* st) : SignatureTypeNames(signature) { | 1435 SignatureTypePrinter(Symbol* signature, outputStream* st) : SignatureTypeNames(signature) { |
1905 #ifndef PRODUCT | 1906 #ifndef PRODUCT |
1906 | 1907 |
1907 void Method::print_on(outputStream* st) const { | 1908 void Method::print_on(outputStream* st) const { |
1908 ResourceMark rm; | 1909 ResourceMark rm; |
1909 assert(is_method(), "must be method"); | 1910 assert(is_method(), "must be method"); |
1910 st->print_cr(internal_name()); | 1911 st->print_cr("%s", internal_name()); |
1911 // get the effect of PrintOopAddress, always, for methods: | 1912 // get the effect of PrintOopAddress, always, for methods: |
1912 st->print_cr(" - this oop: "INTPTR_FORMAT, (intptr_t)this); | 1913 st->print_cr(" - this oop: "INTPTR_FORMAT, (intptr_t)this); |
1913 st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr(); | 1914 st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr(); |
1914 st->print (" - constants: "INTPTR_FORMAT" ", (address)constants()); | 1915 st->print (" - constants: "INTPTR_FORMAT" ", (address)constants()); |
1915 constants()->print_value_on(st); st->cr(); | 1916 constants()->print_value_on(st); st->cr(); |
1988 | 1989 |
1989 #endif //PRODUCT | 1990 #endif //PRODUCT |
1990 | 1991 |
1991 void Method::print_value_on(outputStream* st) const { | 1992 void Method::print_value_on(outputStream* st) const { |
1992 assert(is_method(), "must be method"); | 1993 assert(is_method(), "must be method"); |
1993 st->print(internal_name()); | 1994 st->print("%s", internal_name()); |
1994 print_address_on(st); | 1995 print_address_on(st); |
1995 st->print(" "); | 1996 st->print(" "); |
1996 name()->print_value_on(st); | 1997 name()->print_value_on(st); |
1997 st->print(" "); | 1998 st->print(" "); |
1998 signature()->print_value_on(st); | 1999 signature()->print_value_on(st); |