author | drchase |
Fri, 09 May 2014 16:50:54 -0400 | |
changeset 24424 | 2658d7834c6e |
parent 18025 | b7bcf7497f93 |
child 24452 | 07e8e98ca6af |
permissions | -rw-r--r-- |
18025 | 1 |
/* |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
18025
diff
changeset
|
2 |
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
18025 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#ifndef SHARE_VM_TRACE_TRACESTREAM_HPP |
|
26 |
#define SHARE_VM_TRACE_TRACESTREAM_HPP |
|
27 |
||
28 |
#include "utilities/macros.hpp" |
|
29 |
||
30 |
#if INCLUDE_TRACE |
|
31 |
||
32 |
#include "oops/klass.hpp" |
|
33 |
#include "oops/method.hpp" |
|
34 |
#include "oops/symbol.hpp" |
|
35 |
#include "utilities/ostream.hpp" |
|
36 |
||
37 |
class TraceStream : public StackObj { |
|
38 |
private: |
|
39 |
outputStream& _st; |
|
40 |
||
41 |
public: |
|
42 |
TraceStream(outputStream& stream): _st(stream) {} |
|
43 |
||
44 |
void print_val(const char* label, u1 val) { |
|
45 |
_st.print("%s = "UINT32_FORMAT, label, val); |
|
46 |
} |
|
47 |
||
48 |
void print_val(const char* label, u2 val) { |
|
49 |
_st.print("%s = "UINT32_FORMAT, label, val); |
|
50 |
} |
|
51 |
||
52 |
void print_val(const char* label, s2 val) { |
|
53 |
_st.print("%s = "INT32_FORMAT, label, val); |
|
54 |
} |
|
55 |
||
56 |
void print_val(const char* label, u4 val) { |
|
57 |
_st.print("%s = "UINT32_FORMAT, label, val); |
|
58 |
} |
|
59 |
||
60 |
void print_val(const char* label, s4 val) { |
|
61 |
_st.print("%s = "INT32_FORMAT, label, val); |
|
62 |
} |
|
63 |
||
64 |
void print_val(const char* label, u8 val) { |
|
65 |
_st.print("%s = "UINT64_FORMAT, label, val); |
|
66 |
} |
|
67 |
||
68 |
void print_val(const char* label, s8 val) { |
|
69 |
_st.print("%s = "INT64_FORMAT, label, val); |
|
70 |
} |
|
71 |
||
72 |
void print_val(const char* label, bool val) { |
|
73 |
_st.print("%s = %s", label, val ? "true" : "false"); |
|
74 |
} |
|
75 |
||
76 |
void print_val(const char* label, float val) { |
|
77 |
_st.print("%s = %f", label, val); |
|
78 |
} |
|
79 |
||
80 |
void print_val(const char* label, double val) { |
|
81 |
_st.print("%s = %f", label, val); |
|
82 |
} |
|
83 |
||
84 |
// Caller is machine generated code located in traceEventClasses.hpp |
|
85 |
// Event<TraceId>::writeEvent() (pseudocode) contains the |
|
86 |
// necessary ResourceMark for the resource allocations below. |
|
87 |
// See traceEventClasses.xsl for details. |
|
88 |
void print_val(const char* label, const Klass* const val) { |
|
89 |
const char* description = "NULL"; |
|
90 |
if (val != NULL) { |
|
91 |
Symbol* name = val->name(); |
|
92 |
if (name != NULL) { |
|
93 |
description = name->as_C_string(); |
|
94 |
} |
|
95 |
} |
|
96 |
_st.print("%s = %s", label, description); |
|
97 |
} |
|
98 |
||
99 |
// Caller is machine generated code located in traceEventClasses.hpp |
|
100 |
// Event<TraceId>::writeEvent() (pseudocode) contains the |
|
101 |
// necessary ResourceMark for the resource allocations below. |
|
102 |
// See traceEventClasses.xsl for details. |
|
103 |
void print_val(const char* label, const Method* const val) { |
|
104 |
const char* description = "NULL"; |
|
105 |
if (val != NULL) { |
|
106 |
description = val->name_and_sig_as_C_string(); |
|
107 |
} |
|
108 |
_st.print("%s = %s", label, description); |
|
109 |
} |
|
110 |
||
111 |
void print_val(const char* label, const char* val) { |
|
112 |
_st.print("%s = '%s'", label, val); |
|
113 |
} |
|
114 |
||
115 |
void print(const char* val) { |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
18025
diff
changeset
|
116 |
_st.print("%s", val); |
18025 | 117 |
} |
118 |
}; |
|
119 |
||
120 |
#endif /* INCLUDE_TRACE */ |
|
121 |
#endif /* SHARE_VM_TRACE_TRACESTREAM_HPP */ |