--- old/src/hotspot/share/gc/shared/objectCountEventSender.hpp 2018-04-09 14:13:34.170337923 +0200 +++ new/src/hotspot/share/gc/shared/objectCountEventSender.hpp 2018-04-09 14:13:33.432291365 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, 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 @@ -27,15 +27,32 @@ #include "gc/shared/gcTrace.hpp" #include "memory/allocation.hpp" +#include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" +#include "utilities/ticks.hpp" #if INCLUDE_SERVICES class KlassInfoEntry; -class Ticks; +class Klass; class ObjectCountEventSender : public AllStatic { + static bool _should_send_requestable_event; + + template + static void send_event_if_enabled(Klass* klass, jlong count, julong size, const Ticks& timestamp); + + public: + static void enable_requestable_event(); + static void disable_requestable_event(); + public: + // The following two functions have the exact same signature as + // hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.hpp + // + // This file will replace the open file if a closed build is performed. + // These function signatures can therefore not be changed if the open + // signatures aren't changed as well. static void send(const KlassInfoEntry* entry, const Ticks& timestamp); static bool should_send_event(); };