Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_InstructionPrinter.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 | ce0cc25bc5e2 |
children |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 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. |
132 if (type->as_ObjectConstant() != NULL) { | 132 if (type->as_ObjectConstant() != NULL) { |
133 ciObject* value = type->as_ObjectConstant()->value(); | 133 ciObject* value = type->as_ObjectConstant()->value(); |
134 if (value->is_null_object()) { | 134 if (value->is_null_object()) { |
135 output()->print("null"); | 135 output()->print("null"); |
136 } else if (!value->is_loaded()) { | 136 } else if (!value->is_loaded()) { |
137 output()->print("<unloaded object " PTR_FORMAT ">", value); | 137 output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value)); |
138 } else { | 138 } else { |
139 output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding()); | 139 output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding())); |
140 print_klass(value->klass()); | 140 print_klass(value->klass()); |
141 output()->print(">"); | 141 output()->print(">"); |
142 } | 142 } |
143 } else if (type->as_InstanceConstant() != NULL) { | 143 } else if (type->as_InstanceConstant() != NULL) { |
144 ciInstance* value = type->as_InstanceConstant()->value(); | 144 ciInstance* value = type->as_InstanceConstant()->value(); |
145 if (value->is_loaded()) { | 145 if (value->is_loaded()) { |
146 output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding()); | 146 output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding())); |
147 print_klass(value->klass()); | 147 print_klass(value->klass()); |
148 output()->print(">"); | 148 output()->print(">"); |
149 } else { | 149 } else { |
150 output()->print("<unloaded instance " PTR_FORMAT ">", value); | 150 output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value)); |
151 } | 151 } |
152 } else if (type->as_ArrayConstant() != NULL) { | 152 } else if (type->as_ArrayConstant() != NULL) { |
153 output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding()); | 153 output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding())); |
154 } else if (type->as_ClassConstant() != NULL) { | 154 } else if (type->as_ClassConstant() != NULL) { |
155 ciInstanceKlass* klass = type->as_ClassConstant()->value(); | 155 ciInstanceKlass* klass = type->as_ClassConstant()->value(); |
156 if (!klass->is_loaded()) { | 156 if (!klass->is_loaded()) { |
157 output()->print("<unloaded> "); | 157 output()->print("<unloaded> "); |
158 } | 158 } |
266 output()->print_cr("inlining depth %d", block->scope()->level()); | 266 output()->print_cr("inlining depth %d", block->scope()->level()); |
267 } | 267 } |
268 | 268 |
269 | 269 |
270 void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) { | 270 void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) { |
271 output()->print(name); | 271 output()->print("%s", name); |
272 output()->print(".("); | 272 output()->print(".("); |
273 } | 273 } |
274 | 274 |
275 void InstructionPrinter::print_unsafe_raw_op(UnsafeRawOp* op, const char* name) { | 275 void InstructionPrinter::print_unsafe_raw_op(UnsafeRawOp* op, const char* name) { |
276 print_unsafe_op(op, name); | 276 print_unsafe_op(op, name); |
477 print_value(x->obj()); | 477 print_value(x->obj()); |
478 output()->print(") "); | 478 output()->print(") "); |
479 if (x->declared_type()->is_klass()) | 479 if (x->declared_type()->is_klass()) |
480 print_klass(x->declared_type()->as_klass()); | 480 print_klass(x->declared_type()->as_klass()); |
481 else | 481 else |
482 output()->print(type2name(x->declared_type()->basic_type())); | 482 output()->print("%s", type2name(x->declared_type()->basic_type())); |
483 } | 483 } |
484 | 484 |
485 | 485 |
486 void InstructionPrinter::do_Invoke(Invoke* x) { | 486 void InstructionPrinter::do_Invoke(Invoke* x) { |
487 if (x->receiver() != NULL) { | 487 if (x->receiver() != NULL) { |