mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 12:34:35 +03:00
Added a support for indirect jumps within a function (Compiler) (#286)
This commit is contained in:
@@ -71,7 +71,7 @@ static void dumpCpu(void) noexcept {
|
||||
// [X86]
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#if ASMJIT_ARCH_X86
|
||||
#if ASMJIT_ARCH_X86
|
||||
static const DumpCpuFeature x86FeaturesList[] = {
|
||||
{ x86::Features::kNX , "NX" },
|
||||
{ x86::Features::kMT , "MT" },
|
||||
@@ -168,13 +168,13 @@ static void dumpCpu(void) noexcept {
|
||||
INFO("X86 Features:");
|
||||
dumpFeatures(cpu, x86FeaturesList, ASMJIT_ARRAY_SIZE(x86FeaturesList));
|
||||
INFO("");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// [ARM]
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#if ASMJIT_ARCH_ARM
|
||||
#if ASMJIT_ARCH_ARM
|
||||
static const DumpCpuFeature armFeaturesList[] = {
|
||||
{ arm::Features::kARMv6 , "ARMv6" },
|
||||
{ arm::Features::kARMv7 , "ARMv7" },
|
||||
@@ -198,17 +198,17 @@ static void dumpCpu(void) noexcept {
|
||||
INFO("ARM Features:");
|
||||
dumpFeatures(cpu, armFeaturesList, ASMJIT_ARRAY_SIZE(armFeaturesList));
|
||||
INFO("");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// [DumpSizeOf]
|
||||
// ============================================================================
|
||||
|
||||
static void dumpSizeOf(void) noexcept {
|
||||
#define DUMP_TYPE(...) \
|
||||
INFO(" %-26s: %u", #__VA_ARGS__, uint32_t(sizeof(__VA_ARGS__)))
|
||||
#define DUMP_TYPE(...) \
|
||||
INFO(" %-26s: %u", #__VA_ARGS__, uint32_t(sizeof(__VA_ARGS__)))
|
||||
|
||||
static void dumpSizeOf(void) noexcept {
|
||||
INFO("Size of C++ types:");
|
||||
DUMP_TYPE(int8_t);
|
||||
DUMP_TYPE(int16_t);
|
||||
@@ -260,7 +260,7 @@ static void dumpSizeOf(void) noexcept {
|
||||
DUMP_TYPE(FuncArgsAssignment);
|
||||
INFO("");
|
||||
|
||||
#ifndef ASMJIT_NO_BUILDER
|
||||
#ifndef ASMJIT_NO_BUILDER
|
||||
INFO("Size of builder classes:");
|
||||
DUMP_TYPE(BaseBuilder);
|
||||
DUMP_TYPE(BaseNode);
|
||||
@@ -274,18 +274,18 @@ static void dumpSizeOf(void) noexcept {
|
||||
DUMP_TYPE(CommentNode);
|
||||
DUMP_TYPE(SentinelNode);
|
||||
INFO("");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ASMJIT_NO_COMPILER
|
||||
#ifndef ASMJIT_NO_COMPILER
|
||||
INFO("Size of compiler classes:");
|
||||
DUMP_TYPE(BaseCompiler);
|
||||
DUMP_TYPE(FuncNode);
|
||||
DUMP_TYPE(FuncRetNode);
|
||||
DUMP_TYPE(FuncCallNode);
|
||||
INFO("");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ASMJIT_BUILD_X86
|
||||
#ifdef ASMJIT_BUILD_X86
|
||||
INFO("Size of x86-specific classes:");
|
||||
DUMP_TYPE(x86::Assembler);
|
||||
#ifndef ASMJIT_NO_BUILDER
|
||||
@@ -299,11 +299,11 @@ static void dumpSizeOf(void) noexcept {
|
||||
DUMP_TYPE(x86::InstDB::OpSignature);
|
||||
DUMP_TYPE(x86::InstDB::InstSignature);
|
||||
INFO("");
|
||||
#endif
|
||||
|
||||
#undef DUMP_TYPE
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef DUMP_TYPE
|
||||
|
||||
// ============================================================================
|
||||
// [Main]
|
||||
// ============================================================================
|
||||
@@ -314,11 +314,11 @@ static void onBeforeRun(void) noexcept {
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
#if defined(ASMJIT_BUILD_DEBUG)
|
||||
#if defined(ASMJIT_BUILD_DEBUG)
|
||||
const char buildType[] = "Debug";
|
||||
#else
|
||||
#else
|
||||
const char buildType[] = "Release";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
INFO("AsmJit Unit-Test v%u.%u.%u [Arch=%s] [Mode=%s]\n\n",
|
||||
unsigned((ASMJIT_LIBRARY_VERSION >> 16) ),
|
||||
|
||||
Reference in New Issue
Block a user