1 /* |
1 /* |
2 * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2019, 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. |
849 } |
849 } |
850 |
850 |
851 // Printing |
851 // Printing |
852 |
852 |
853 void ConstantPoolCache::print_on(outputStream* st) const { |
853 void ConstantPoolCache::print_on(outputStream* st) const { |
854 assert(is_constantPoolCache(), "obj must be constant pool cache"); |
|
855 st->print_cr("%s", internal_name()); |
854 st->print_cr("%s", internal_name()); |
856 // print constant pool cache entries |
855 // print constant pool cache entries |
857 for (int i = 0; i < length(); i++) entry_at(i)->print(st, i); |
856 for (int i = 0; i < length(); i++) entry_at(i)->print(st, i); |
858 } |
857 } |
859 |
858 |
860 void ConstantPoolCache::print_value_on(outputStream* st) const { |
859 void ConstantPoolCache::print_value_on(outputStream* st) const { |
861 assert(is_constantPoolCache(), "obj must be constant pool cache"); |
|
862 st->print("cache [%d]", length()); |
860 st->print("cache [%d]", length()); |
863 print_address_on(st); |
861 print_address_on(st); |
864 st->print(" for "); |
862 st->print(" for "); |
865 constant_pool()->print_value_on(st); |
863 constant_pool()->print_value_on(st); |
866 } |
864 } |
867 |
865 |
868 |
866 |
869 // Verification |
867 // Verification |
870 |
868 |
871 void ConstantPoolCache::verify_on(outputStream* st) { |
869 void ConstantPoolCache::verify_on(outputStream* st) { |
872 guarantee(is_constantPoolCache(), "obj must be constant pool cache"); |
|
873 // print constant pool cache entries |
870 // print constant pool cache entries |
874 for (int i = 0; i < length(); i++) entry_at(i)->verify(st); |
871 for (int i = 0; i < length(); i++) entry_at(i)->verify(st); |
875 } |
872 } |