Sun, 02 Mar 2008 16:10:12 -0800
6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
Summary: Default values set by cms ergonomics are set with FLAG_SET_DEFAULT so down stream the values look like the default values and affect how later parameters are set. Set these values with FLAG_SET_ERGO instead and adjust how later parameters are interpreted.
Reviewed-by: iveresov, apetrusenko, pbk, ysr
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | #include "incls/_precompiled.incl" |
duke@435 | 26 | #include "incls/_reflectionUtils.cpp.incl" |
duke@435 | 27 | |
duke@435 | 28 | KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) { |
duke@435 | 29 | _klass = klass; |
duke@435 | 30 | if (classes_only) { |
duke@435 | 31 | _interfaces = Universe::the_empty_system_obj_array(); |
duke@435 | 32 | } else { |
duke@435 | 33 | _interfaces = klass->transitive_interfaces(); |
duke@435 | 34 | } |
duke@435 | 35 | _interface_index = _interfaces->length(); |
duke@435 | 36 | _local_only = local_only; |
duke@435 | 37 | _classes_only = classes_only; |
duke@435 | 38 | } |
duke@435 | 39 | |
duke@435 | 40 | bool KlassStream::eos() { |
duke@435 | 41 | if (index() >= 0) return false; |
duke@435 | 42 | if (_local_only) return true; |
duke@435 | 43 | if (!_klass->is_interface() && _klass->super() != NULL) { |
duke@435 | 44 | // go up superclass chain (not for interfaces) |
duke@435 | 45 | _klass = _klass->super(); |
duke@435 | 46 | } else { |
duke@435 | 47 | if (_interface_index > 0) { |
duke@435 | 48 | _klass = klassOop(_interfaces->obj_at(--_interface_index)); |
duke@435 | 49 | } else { |
duke@435 | 50 | return true; |
duke@435 | 51 | } |
duke@435 | 52 | } |
duke@435 | 53 | _index = length(); |
duke@435 | 54 | next(); |
duke@435 | 55 | return eos(); |
duke@435 | 56 | } |
duke@435 | 57 | |
duke@435 | 58 | |
duke@435 | 59 | GrowableArray<FilteredField*> *FilteredFieldsMap::_filtered_fields = |
duke@435 | 60 | new (ResourceObj::C_HEAP) GrowableArray<FilteredField*>(3,true); |
duke@435 | 61 | |
duke@435 | 62 | |
duke@435 | 63 | void FilteredFieldsMap::initialize() { |
duke@435 | 64 | int offset; |
duke@435 | 65 | offset = java_lang_Throwable::get_backtrace_offset(); |
duke@435 | 66 | _filtered_fields->append(new FilteredField(SystemDictionary::throwable_klass(), offset)); |
duke@435 | 67 | // The latest version of vm may be used with old jdk. |
duke@435 | 68 | if (JDK_Version::is_gte_jdk16x_version()) { |
duke@435 | 69 | // The following class fields do not exist in |
duke@435 | 70 | // previous version of jdk. |
duke@435 | 71 | offset = sun_reflect_ConstantPool::cp_oop_offset(); |
duke@435 | 72 | _filtered_fields->append(new FilteredField(SystemDictionary::reflect_constant_pool_klass(), offset)); |
duke@435 | 73 | offset = sun_reflect_UnsafeStaticFieldAccessorImpl::base_offset(); |
duke@435 | 74 | _filtered_fields->append(new FilteredField(SystemDictionary::reflect_unsafe_static_field_accessor_impl_klass(), offset)); |
duke@435 | 75 | } |
duke@435 | 76 | } |
duke@435 | 77 | |
duke@435 | 78 | int FilteredFieldStream::field_count() { |
duke@435 | 79 | int numflds = 0; |
duke@435 | 80 | for (;!eos(); next()) { |
duke@435 | 81 | numflds++; |
duke@435 | 82 | } |
duke@435 | 83 | return numflds; |
duke@435 | 84 | } |