< prev index next >

src/hotspot/share/compiler/compilerEvent.cpp

Print this page


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 #include "ci/ciMethod.hpp"
  26 #include "compiler/compilerEvent.hpp"
  27 #include "jfr/jfr.hpp"

  28 #include "jfr/metadata/jfrSerializer.hpp"
  29 #include "runtime/semaphore.inline.hpp"
  30 #include "utilities/growableArray.hpp"
  31 
  32 // Synchronizes access to phases_names.
  33 class PhaseTypeGuard : public StackObj {
  34  private:
  35   static Semaphore _mutex_semaphore;
  36  public:
  37   PhaseTypeGuard() {
  38     _mutex_semaphore.wait();
  39   }
  40   ~PhaseTypeGuard() {
  41     _mutex_semaphore.signal();
  42   }
  43 };
  44 
  45 Semaphore PhaseTypeGuard::_mutex_semaphore(1);
  46 
  47 static void write_phases(JfrCheckpointWriter& writer, u4 base_idx, GrowableArray<const char*>* phases) {




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 #include "ci/ciMethod.hpp"
  26 #include "compiler/compilerEvent.hpp"
  27 #include "jfr/jfr.hpp"
  28 #include "jfr/jfrEvents.hpp"
  29 #include "jfr/metadata/jfrSerializer.hpp"
  30 #include "runtime/semaphore.inline.hpp"
  31 #include "utilities/growableArray.hpp"
  32 
  33 // Synchronizes access to phases_names.
  34 class PhaseTypeGuard : public StackObj {
  35  private:
  36   static Semaphore _mutex_semaphore;
  37  public:
  38   PhaseTypeGuard() {
  39     _mutex_semaphore.wait();
  40   }
  41   ~PhaseTypeGuard() {
  42     _mutex_semaphore.signal();
  43   }
  44 };
  45 
  46 Semaphore PhaseTypeGuard::_mutex_semaphore(1);
  47 
  48 static void write_phases(JfrCheckpointWriter& writer, u4 base_idx, GrowableArray<const char*>* phases) {


< prev index next >