JitRegister: overload Register with a [start,end) variant
This commit is contained in:
parent
a957f93532
commit
a4adfe194a
|
@ -71,18 +71,15 @@ void Shutdown()
|
||||||
s_perf_map_file.Close();
|
s_perf_map_file.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register(const void* base_address, u32 code_size,
|
void RegisterV(const void* base_address, u32 code_size,
|
||||||
const char* format, ...)
|
const char* format, va_list args)
|
||||||
{
|
{
|
||||||
#if !(defined USE_OPROFILE && USE_OPROFILE) && !defined(USE_VTUNE)
|
#if !(defined USE_OPROFILE && USE_OPROFILE) && !defined(USE_VTUNE)
|
||||||
if (!s_perf_map_file.IsOpen())
|
if (!s_perf_map_file.IsOpen())
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
std::string symbol_name = StringFromFormatV(format, args);
|
std::string symbol_name = StringFromFormatV(format, args);
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
#if defined USE_OPROFILE && USE_OPROFILE
|
#if defined USE_OPROFILE && USE_OPROFILE
|
||||||
op_write_native_code(s_agent, symbol_name.data(), (u64)base_address,
|
op_write_native_code(s_agent, symbol_name.data(), (u64)base_address,
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <stdarg.h>
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
namespace JitRegister
|
namespace JitRegister
|
||||||
|
@ -10,7 +11,26 @@ namespace JitRegister
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void Register(const void* base_address, u32 code_size,
|
void RegisterV(const void* base_address, u32 code_size,
|
||||||
const char* format, ...);
|
const char* format, va_list args);
|
||||||
|
|
||||||
|
inline void Register(const void* base_address, u32 code_size,
|
||||||
|
const char* format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
RegisterV(base_address, code_size, format, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void Register(const void* start, const void* end,
|
||||||
|
const char* format, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
u32 code_size = (u32) ((const char*) end - (const char*) start);
|
||||||
|
RegisterV(start, code_size, format, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att):
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
AppendToString(&name);
|
AppendToString(&name);
|
||||||
JitRegister::Register(region, (u32)(GetCodePtr() - region), name.c_str());
|
JitRegister::Register(region, GetCodePtr(), name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
OpArg VertexLoaderX64::GetVertexAddr(int array, u64 attribute)
|
OpArg VertexLoaderX64::GetVertexAddr(int array, u64 attribute)
|
||||||
|
|
Loading…
Reference in New Issue