src/share/vm/runtime/fieldDescriptor.cpp

changeset 1100
c89f86385056
parent 435
a61af66fc99e
child 1907
c18cbe5936b8
     1.1 --- a/src/share/vm/runtime/fieldDescriptor.cpp	Thu Mar 19 09:13:24 2009 -0700
     1.2 +++ b/src/share/vm/runtime/fieldDescriptor.cpp	Fri Mar 20 23:19:36 2009 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1997-2005 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -107,13 +107,14 @@
    1.11  void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
    1.12    print_on(st);
    1.13    BasicType ft = field_type();
    1.14 -  jint as_int;
    1.15 +  jint as_int = 0;
    1.16    switch (ft) {
    1.17      case T_BYTE:
    1.18        as_int = (jint)obj->byte_field(offset());
    1.19        st->print(" %d", obj->byte_field(offset()));
    1.20        break;
    1.21      case T_CHAR:
    1.22 +      as_int = (jint)obj->char_field(offset());
    1.23        {
    1.24          jchar c = obj->char_field(offset());
    1.25          as_int = c;
    1.26 @@ -128,6 +129,7 @@
    1.27        st->print(" %f", obj->float_field(offset()));
    1.28        break;
    1.29      case T_INT:
    1.30 +      as_int = obj->int_field(offset());
    1.31        st->print(" %d", obj->int_field(offset()));
    1.32        break;
    1.33      case T_LONG:
    1.34 @@ -144,12 +146,12 @@
    1.35        break;
    1.36      case T_ARRAY:
    1.37        st->print(" ");
    1.38 -      as_int = obj->int_field(offset());
    1.39 +      NOT_LP64(as_int = obj->int_field(offset()));
    1.40        obj->obj_field(offset())->print_value_on(st);
    1.41        break;
    1.42      case T_OBJECT:
    1.43        st->print(" ");
    1.44 -      as_int = obj->int_field(offset());
    1.45 +      NOT_LP64(as_int = obj->int_field(offset()));
    1.46        obj->obj_field(offset())->print_value_on(st);
    1.47        break;
    1.48      default:
    1.49 @@ -158,9 +160,9 @@
    1.50    }
    1.51    // Print a hint as to the underlying integer representation. This can be wrong for
    1.52    // pointers on an LP64 machine
    1.53 -  if (ft == T_LONG || ft == T_DOUBLE) {
    1.54 +  if (ft == T_LONG || ft == T_DOUBLE LP64_ONLY(|| !is_java_primitive(ft)) ) {
    1.55      st->print(" (%x %x)", obj->int_field(offset()), obj->int_field(offset()+sizeof(jint)));
    1.56 -  } else {
    1.57 +  } else if (as_int < 0 || as_int > 9) {
    1.58      st->print(" (%x)", as_int);
    1.59    }
    1.60  }

mercurial