7148126: ConstantPoolCacheEntry::print prints to wrong stream

Sat, 25 Feb 2012 01:49:34 -0500

author
dholmes
date
Sat, 25 Feb 2012 01:49:34 -0500
changeset 3601
f096e1b74d85
parent 3600
7292cff45988
child 3602
205573af962c

7148126: ConstantPoolCacheEntry::print prints to wrong stream
Summary: Should print to passed in stream not tty
Reviewed-by: dholmes, never
Contributed-by: Krystal Mok <sajia@taobao.com>

src/share/vm/oops/cpCacheOop.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/oops/cpCacheOop.cpp	Wed Feb 22 09:24:35 2012 +0100
     1.2 +++ b/src/share/vm/oops/cpCacheOop.cpp	Sat Feb 25 01:49:34 2012 -0500
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. 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 @@ -504,17 +504,17 @@
    1.11  
    1.12  void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
    1.13    // print separator
    1.14 -  if (index == 0) tty->print_cr("                 -------------");
    1.15 +  if (index == 0) st->print_cr("                 -------------");
    1.16    // print entry
    1.17 -  tty->print("%3d  ("PTR_FORMAT")  ", index, (intptr_t)this);
    1.18 +  st->print("%3d  ("PTR_FORMAT")  ", index, (intptr_t)this);
    1.19    if (is_secondary_entry())
    1.20 -    tty->print_cr("[%5d|secondary]", main_entry_index());
    1.21 +    st->print_cr("[%5d|secondary]", main_entry_index());
    1.22    else
    1.23 -    tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
    1.24 -  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)(oop)_f1);
    1.25 -  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_f2);
    1.26 -  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_flags);
    1.27 -  tty->print_cr("                 -------------");
    1.28 +    st->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
    1.29 +  st->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)(oop)_f1);
    1.30 +  st->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_f2);
    1.31 +  st->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_flags);
    1.32 +  st->print_cr("                 -------------");
    1.33  }
    1.34  
    1.35  void ConstantPoolCacheEntry::verify(outputStream* st) const {

mercurial