annotate src/hotspot/share/runtime/monitorChunk.hpp @ 54526:ee29b516a36a

revert changes
author jlaskey
date Wed, 23 Jan 2019 16:09:20 -0400
parents 71c04702a3d5
children 46ef4dea49e5
rev   line source
duke@1 1 /*
coleenp@54304 2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
coleenp@54304 25 #ifndef SHARE_RUNTIME_MONITORCHUNK_HPP
coleenp@54304 26 #define SHARE_RUNTIME_MONITORCHUNK_HPP
stefank@7397 27
stefank@7397 28 #include "runtime/synchronizer.hpp"
stefank@7397 29
duke@1 30 // Data structure for holding monitors for one activation during
duke@1 31 // deoptimization.
duke@1 32
zgu@13195 33 class MonitorChunk: public CHeapObj<mtInternal> {
duke@1 34 private:
duke@1 35 int _number_of_monitors;
duke@1 36 BasicObjectLock* _monitors;
duke@1 37 BasicObjectLock* monitors() const { return _monitors; }
duke@1 38 MonitorChunk* _next;
duke@1 39 public:
duke@1 40 // Constructor
duke@1 41 MonitorChunk(int number_on_monitors);
duke@1 42 ~MonitorChunk();
duke@1 43
duke@1 44 // link operations
duke@1 45 MonitorChunk* next() const { return _next; }
duke@1 46 void set_next(MonitorChunk* next) { _next = next; }
duke@1 47
duke@1 48 // Tells whether the monitor chunk is linked into the JavaThread
duke@1 49 bool is_linked() const { return next() != NULL; }
duke@1 50
duke@1 51 // Returns the number of monitors
duke@1 52 int number_of_monitors() const { return _number_of_monitors; }
duke@1 53
duke@1 54 // Returns the index'th monitor
duke@1 55 BasicObjectLock* at(int index) { assert(index >= 0 && index < number_of_monitors(), "out of bounds check"); return &monitors()[index]; }
duke@1 56
duke@1 57
duke@1 58 // Memory management
duke@1 59 void oops_do(OopClosure* f);
duke@1 60
duke@1 61 // Tells whether the addr point into the monitors.
duke@1 62 bool contains(void* addr) const { return (addr >= (void*) monitors()) && (addr < (void*) (monitors() + number_of_monitors())); }
duke@1 63 };
stefank@7397 64
coleenp@54304 65 #endif // SHARE_RUNTIME_MONITORCHUNK_HPP