Lines Matching refs:event
129 bool EventMasks::IsEnabledAnywhere(ArtJvmtiEvent event) { in IsEnabledAnywhere() argument
130 return global_event_mask.Test(event) || unioned_thread_event_mask.Test(event); in IsEnabledAnywhere()
169 void EventMasks::EnableEvent(ArtJvmTiEnv* env, art::Thread* thread, ArtJvmtiEvent event) { in EnableEvent() argument
172 DCHECK(EventMask::EventIsInRange(event)); in EnableEvent()
173 GetEventMask(thread).Set(event); in EnableEvent()
175 unioned_thread_event_mask.Set(event, true); in EnableEvent()
179 void EventMasks::DisableEvent(ArtJvmTiEnv* env, art::Thread* thread, ArtJvmtiEvent event) { in DisableEvent() argument
182 DCHECK(EventMask::EventIsInRange(event)); in DisableEvent()
183 GetEventMask(thread).Set(event, false); in DisableEvent()
188 union_value |= pair.second.Test(event); in DisableEvent()
193 unioned_thread_event_mask.Set(event, union_value); in DisableEvent()
246 static bool IsThreadControllable(ArtJvmtiEvent event) { in IsThreadControllable() argument
247 switch (event) { in IsThreadControllable()
572 static void SetupGcPauseTracking(JvmtiGcPauseListener* listener, ArtJvmtiEvent event, bool enable) { in SetupGcPauseTracking() argument
575 if (event == ArtJvmtiEvent::kGarbageCollectionStart) { in SetupGcPauseTracking()
1059 uint32_t EventHandler::GetInstrumentationEventsFor(ArtJvmtiEvent event) { in GetInstrumentationEventsFor() argument
1060 switch (event) { in GetInstrumentationEventsFor()
1067 DCHECK(event == ArtJvmtiEvent::kMethodExit || in GetInstrumentationEventsFor()
1068 event == ArtJvmtiEvent::kForceEarlyReturnUpdateReturnValue) in GetInstrumentationEventsFor()
1069 << "event = " << static_cast<uint32_t>(event); in GetInstrumentationEventsFor()
1070 ArtJvmtiEvent other = event == ArtJvmtiEvent::kMethodExit in GetInstrumentationEventsFor()
1091 DCHECK(event == ArtJvmtiEvent::kBreakpoint || event == ArtJvmtiEvent::kSingleStep); in GetInstrumentationEventsFor()
1092 ArtJvmtiEvent other = event == ArtJvmtiEvent::kBreakpoint ? ArtJvmtiEvent::kSingleStep in GetInstrumentationEventsFor()
1125 static DeoptRequirement GetDeoptRequirement(ArtJvmtiEvent event, jthread thread) { in GetDeoptRequirement() argument
1126 switch (event) { in GetDeoptRequirement()
1170 jvmtiError EventHandler::HandleEventDeopt(ArtJvmtiEvent event, jthread thread, bool enable) { in HandleEventDeopt() argument
1171 DeoptRequirement deopt_req = GetDeoptRequirement(event, thread); in HandleEventDeopt()
1214 ArtJvmtiEvent event, in SetupTraceListener() argument
1217 uint32_t new_events = GetInstrumentationEventsFor(event); in SetupTraceListener()
1268 bool EventHandler::OtherMonitorEventsEnabledAnywhere(ArtJvmtiEvent event) { in OtherMonitorEventsEnabledAnywhere() argument
1278 if (e != event && IsEventEnabledAnywhere(e)) { in OtherMonitorEventsEnabledAnywhere()
1307 void EventHandler::HandleEventType(ArtJvmtiEvent event, bool enable) { in HandleEventType() argument
1308 switch (event) { in HandleEventType()
1317 SetupGcPauseTracking(gc_pause_listener_.get(), event, enable); in HandleEventType()
1337 SetupTraceListener(method_trace_listener_.get(), event, enable); in HandleEventType()
1343 if (!OtherMonitorEventsEnabledAnywhere(event)) { in HandleEventType()
1355 ArtJvmtiEvent event) { in HasAssociatedCapability() argument
1357 switch (event) { in HasAssociatedCapability()
1411 static bool IsInternalEvent(ArtJvmtiEvent event) { in IsInternalEvent() argument
1412 return static_cast<uint32_t>(event) >= in IsInternalEvent()
1417 ArtJvmtiEvent event, in SetInternalEvent() argument
1419 CHECK(IsInternalEvent(event)) << static_cast<uint32_t>(event); in SetInternalEvent()
1457 DCHECK_GE(GetInternalEventRefcount(event) + (mode == JVMTI_ENABLE ? 1 : -1), 0) in SetInternalEvent()
1458 << "Refcount: " << GetInternalEventRefcount(event); in SetInternalEvent()
1459 DCHECK_GE(GetInternalEventThreadRefcount(event, target) + (mode == JVMTI_ENABLE ? 1 : -1), 0) in SetInternalEvent()
1460 << "Refcount: " << GetInternalEventThreadRefcount(event, target); in SetInternalEvent()
1461 DCHECK_GE(GetInternalEventRefcount(event), GetInternalEventThreadRefcount(event, target)); in SetInternalEvent()
1462 old_state = GetInternalEventRefcount(event) > 0; in SetInternalEvent()
1463 old_thread_state = GetInternalEventThreadRefcount(event, target) > 0; in SetInternalEvent()
1465 new_state = IncrInternalEventRefcount(event) > 0; in SetInternalEvent()
1466 new_thread_state = IncrInternalEventThreadRefcount(event, target) > 0; in SetInternalEvent()
1468 new_state = DecrInternalEventRefcount(event) > 0; in SetInternalEvent()
1469 new_thread_state = DecrInternalEventThreadRefcount(event, target) > 0; in SetInternalEvent()
1472 global_mask.Set(event, new_state); in SetInternalEvent()
1479 HandleEventType(event, mode == JVMTI_ENABLE); in SetInternalEvent()
1482 HandleEventDeopt(event, thread, new_thread_state); in SetInternalEvent()
1487 static bool IsDirectlySettableEvent(ArtJvmtiEvent event) { in IsDirectlySettableEvent() argument
1488 return !IsInternalEvent(event); in IsDirectlySettableEvent()
1491 static bool EventIsNormal(ArtJvmtiEvent event) { in EventIsNormal() argument
1492 return EventMask::EventIsInRange(event) && IsDirectlySettableEvent(event); in EventIsNormal()
1497 ArtJvmtiEvent event, in SetEvent() argument
1503 if (!EventIsNormal(event)) { in SetEvent()
1507 if (!HasAssociatedCapability(env, event)) { in SetEvent()
1511 if (thread != nullptr && !IsThreadControllable(event)) { in SetEvent()
1547 old_thread_state = GetThreadEventState(event, target); in SetEvent()
1548 old_state = global_mask.Test(event); in SetEvent()
1550 env->event_masks.EnableEvent(env, target, event); in SetEvent()
1551 global_mask.Set(event); in SetEvent()
1554 DCHECK(GetThreadEventState(event, target)); in SetEvent()
1558 env->event_masks.DisableEvent(env, target, event); in SetEvent()
1559 RecalculateGlobalEventMaskLocked(event); in SetEvent()
1560 new_state = global_mask.Test(event); in SetEvent()
1561 new_thread_state = GetThreadEventState(event, target); in SetEvent()
1568 HandleEventType(event, mode == JVMTI_ENABLE); in SetEvent()
1571 return HandleEventDeopt(event, thread, new_thread_state); in SetEvent()
1576 bool EventHandler::GetThreadEventState(ArtJvmtiEvent event, art::Thread* thread) { in GetThreadEventState() argument
1582 if (thread == nullptr && masks.global_event_mask.Test(event)) { in GetThreadEventState()
1586 if (mask != nullptr && mask->Test(event)) { in GetThreadEventState()
1608 static size_t GetInternalEventIndex(ArtJvmtiEvent event) { in GetInternalEventIndex() argument
1609 CHECK(IsInternalEvent(event)); in GetInternalEventIndex()
1610 return static_cast<size_t>(event) - static_cast<size_t>(ArtJvmtiEvent::kMinInternalEventTypeVal); in GetInternalEventIndex()
1613 int32_t EventHandler::DecrInternalEventThreadRefcount(ArtJvmtiEvent event, art::Thread* target) { in DecrInternalEventThreadRefcount() argument
1614 return --GetInternalEventThreadRefcount(event, target); in DecrInternalEventThreadRefcount()
1617 int32_t EventHandler::IncrInternalEventThreadRefcount(ArtJvmtiEvent event, art::Thread* target) { in IncrInternalEventThreadRefcount() argument
1618 return ++GetInternalEventThreadRefcount(event, target); in IncrInternalEventThreadRefcount()
1621 int32_t& EventHandler::GetInternalEventThreadRefcount(ArtJvmtiEvent event, art::Thread* target) { in GetInternalEventThreadRefcount() argument
1622 auto& refs = internal_event_thread_refcount_[GetInternalEventIndex(event)]; in GetInternalEventThreadRefcount()
1630 int32_t EventHandler::DecrInternalEventRefcount(ArtJvmtiEvent event) { in DecrInternalEventRefcount() argument
1631 return --internal_event_refcount_[GetInternalEventIndex(event)]; in DecrInternalEventRefcount()
1634 int32_t EventHandler::IncrInternalEventRefcount(ArtJvmtiEvent event) { in IncrInternalEventRefcount() argument
1635 return ++internal_event_refcount_[GetInternalEventIndex(event)]; in IncrInternalEventRefcount()
1638 int32_t EventHandler::GetInternalEventRefcount(ArtJvmtiEvent event) const { in GetInternalEventRefcount()
1639 return internal_event_refcount_[GetInternalEventIndex(event)]; in GetInternalEventRefcount()