diff -r 693c6b883b54 -r 8c1e3dd5fe1b hotspot/src/share/vm/oops/oop.inline.hpp --- a/hotspot/src/share/vm/oops/oop.inline.hpp Fri Mar 18 15:52:42 2011 -0700 +++ b/hotspot/src/share/vm/oops/oop.inline.hpp Fri Mar 18 16:00:34 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -141,6 +141,7 @@ inline bool oopDesc::is_a(klassOop k) const { return blueprint()->is_subtype_of(k); } inline bool oopDesc::is_instance() const { return blueprint()->oop_is_instance(); } +inline bool oopDesc::is_instanceMirror() const { return blueprint()->oop_is_instanceMirror(); } inline bool oopDesc::is_instanceRef() const { return blueprint()->oop_is_instanceRef(); } inline bool oopDesc::is_array() const { return blueprint()->oop_is_array(); } inline bool oopDesc::is_objArray() const { return blueprint()->oop_is_objArray(); } @@ -399,7 +400,7 @@ inline int oopDesc::size_given_klass(Klass* klass) { int lh = klass->layout_helper(); - int s = lh >> LogHeapWordSize; // deliver size scaled by wordSize + int s; // lh is now a value computed at class initialization that may hint // at the size. For instances, this is positive and equal to the @@ -412,7 +413,13 @@ // alive or dead. So the speed here is equal in importance to the // speed of allocation. - if (lh <= Klass::_lh_neutral_value) { + if (lh > Klass::_lh_neutral_value) { + if (!Klass::layout_helper_needs_slow_path(lh)) { + s = lh >> LogHeapWordSize; // deliver size scaled by wordSize + } else { + s = klass->oop_size(this); + } + } else if (lh <= Klass::_lh_neutral_value) { // The most common case is instances; fall through if so. if (lh < Klass::_lh_neutral_value) { // Second most common case is arrays. We have to fetch the