hotspot/src/share/vm/ci/ciConstant.cpp
author kvn
Tue, 11 Mar 2008 11:25:13 -0700
changeset 217 c646ef2f5d58
parent 1 489c9b5090e2
child 5234 9ee176a9c29a
permissions -rw-r--r--
6667620: (Escape Analysis) fix deoptimization for scalar replaced objects Summary: Deoptimization code for reallocation and relocking scalar replaced objects has to be fixed. Reviewed-by: rasbold, never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2005 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#include "incls/_precompiled.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
#include "incls/_ciConstant.cpp.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// ciConstant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// This class represents a constant value.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// ------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// ciConstant::print
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
void ciConstant::print() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  tty->print("<ciConstant type=%s value=",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
             basictype_to_str(basic_type()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  switch (basic_type()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  case T_BOOLEAN:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
    tty->print("%s", bool_to_str(_value._int == 0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  case T_CHAR:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  case T_BYTE:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  case T_SHORT:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  case T_INT:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    tty->print("%d", _value._int);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  case T_LONG:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    tty->print(INT64_FORMAT, _value._long);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  case T_FLOAT:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    tty->print("%f", _value._float);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  case T_DOUBLE:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    tty->print("%lf", _value._double);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  case T_OBJECT:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  case T_ARRAY:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    _value._object->print();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    tty->print("ILLEGAL");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  tty->print(">");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}