--- old/src/share/vm/runtime/synchronizer.cpp 2019-01-28 17:44:37.000000000 +0800 +++ new/src/share/vm/runtime/synchronizer.cpp 2019-01-28 17:44:37.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2019, 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 @@ -1193,6 +1193,19 @@ // Note that we could encounter some performance loss through false-sharing as // multiple locks occupy the same $ line. Padding might be appropriate. +static void post_monitor_inflate_event(EventJavaMonitorInflate& event, + const oop obj, + //const ObjectSynchronizer::InflateCause cause) { + // unsupport cause + const u1 cause) { +#if INCLUDE_TRACE + assert(event.should_commit(), "check outside"); + event.set_monitorClass(obj->klass()); + event.set_address((TYPE_ADDRESS)(uintptr_t)(void*)obj); + event.set_cause((u1)cause); + event.commit(); +#endif +} ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) { // Inflate mutates the heap ... @@ -1200,6 +1213,8 @@ assert (Universe::verify_in_progress() || !SafepointSynchronize::is_at_safepoint(), "invariant") ; + EventJavaMonitorInflate event; + for (;;) { const markOop mark = object->mark() ; assert (!mark->has_bias_pattern(), "invariant") ; @@ -1330,6 +1345,9 @@ object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(event, object, (u1)0); + } return m ; } @@ -1380,6 +1398,9 @@ object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(event, object, (u1)0); + } return m ; } }