mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-04-29 23:41:12 -06:00
PPU: HasBreakpoint fast path when empty
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.5, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.5, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.5, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.5, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.5, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.5, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This commit is contained in:
parent
2afd7707fe
commit
0e1cad4ca9
@ -14,6 +14,9 @@ void breakpoint_handler::SetBreakOnBPM(bool break_on_bpm)
|
||||
|
||||
bool breakpoint_handler::HasBreakpoint(u32 loc, bs_t<breakpoint_types> type)
|
||||
{
|
||||
if (m_empty.load(std::memory_order_acquire))
|
||||
return false;
|
||||
|
||||
std::lock_guard lock(mutex_breakpoints);
|
||||
|
||||
return m_breakpoints.contains(loc) && ((m_breakpoints.at(loc) & type) == type);
|
||||
@ -28,7 +31,14 @@ bool breakpoint_handler::AddBreakpoint(u32 loc, bs_t<breakpoint_types> type)
|
||||
return false;
|
||||
}
|
||||
|
||||
return m_breakpoints.insert({loc, type}).second;
|
||||
bool result = m_breakpoints.insert({loc, type}).second;
|
||||
|
||||
if (result)
|
||||
{
|
||||
m_empty.store(false, std::memory_order_release);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool breakpoint_handler::RemoveBreakpoint(u32 loc)
|
||||
@ -50,5 +60,11 @@ bool breakpoint_handler::RemoveBreakpoint(u32 loc)
|
||||
{
|
||||
ensure(ppu_breakpoint(loc, false));
|
||||
}
|
||||
|
||||
if (m_breakpoints.empty())
|
||||
{
|
||||
m_empty.store(true, std::memory_order_release);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include "Utilities/bit_set.h"
|
||||
#include <map>
|
||||
#include "Utilities/mutex.h"
|
||||
#include <atomic>
|
||||
|
||||
enum class breakpoint_types
|
||||
{
|
||||
@ -46,6 +47,7 @@ private:
|
||||
// TODO : generalize to hold multiple games and handle flags.Probably do : std::map<std::string (gameid), std::set<breakpoint>>.
|
||||
// Although, externally, they'll only be accessed by loc (I think) so a map of maps may also do?
|
||||
shared_mutex mutex_breakpoints;
|
||||
std::atomic<bool> m_empty{true};
|
||||
std::map<u32, bs_t<breakpoint_types>> m_breakpoints; //! Holds all breakpoints.
|
||||
bool m_break_on_bpm = false;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user