hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp
changeset 24424 2658d7834c6e
parent 20709 034be898bf04
child 28954 7dda6c26cc98
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     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) {