1879N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 48N/A// Give advice about whether the oop that contains this markOop 48N/A// should be cached or not. 48N/A // the cast is because decode_pointer() isn't marked const 48N/A // If the oop containing this markOop is being forwarded, then 48N/A // we are in the middle of GC and we do not want the containing 48N/A // oop to be added to a cache. We have no way of knowing whether 48N/A // the cache has already been visited by the current GC phase so 48N/A // we don't know whether the forwarded oop will be properly 48N/A // processed in this phase. If the forwarded oop is not properly 48N/A // processed, then we'll see strange crashes or asserts during 48N/A // the next GC run because the markOop will contain an unexpected 48N/A // This situation has been seen when we are GC'ing a methodOop 48N/A // because we use the methodOop while we're GC'ing it. Scary 48N/A // stuff. Some of the uses the methodOop cause the methodOop to 48N/A // be added to the OopMapCache in the instanceKlass as a side 48N/A // effect. This check lets the cache maintainer know when a 48N/A // cache addition would not be safe. 48N/A // caching the containing oop should be just fine