Commit 75d75c0e authored by swift_gan's avatar swift_gan

add

parent 0aab93f2
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_COMPILER_OPTIONS_H
#define SANDHOOK_ART_COMPILER_OPTIONS_H
#include "arch.h"
namespace art {
class CompilerOptions {
public:
void* compiler_filter_;
Size huge_method_threshold_;
Size large_method_threshold_;
Size small_method_threshold_;
Size tiny_method_threshold_;
Size num_dex_methods_threshold_;
Size inline_depth_limit_;
Size inline_max_code_units_;
};
}
#endif //SANDHOOK_ART_COMPILER_OPTIONS_H
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_JIT_H
#define SANDHOOK_ART_JIT_H
namespace art {
namespace jit {
class JitCompiler {
public:
virtual ~JitCompiler();
std::unique_ptr<art::CompilerOptions> compilerOptions;
};
class Jit {
public:
//void* getCompilerOptions();
};
};
}
#endif //SANDHOOK_ART_JIT_H
//
// Created by 甘尧 on 2019/2/23.
//
#ifndef SANDHOOK_ART_RUNTIME_H
#define SANDHOOK_ART_RUNTIME_H
#include "art_jit.h"
namespace art {
class Runtime {
public:
jit::Jit* getJit();
};
}
#endif //SANDHOOK_ART_RUNTIME_H
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
// //
#include "../includes/hide_api.h" #include "../includes/hide_api.h"
#include "../includes/arch.h" #include "../includes/arch.h"
#include <memory>
#include "../includes/art_compiler_options.h"
#include "../includes/art_jit.h"
extern int SDK_INT; extern int SDK_INT;
...@@ -72,6 +75,17 @@ extern "C" { ...@@ -72,6 +75,17 @@ extern "C" {
: "_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadENS_6ObjPtrINS_6mirror6ObjectEEE"; : "_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadENS_6ObjPtrINS_6mirror6ObjectEEE";
addWeakGlobalRef = (jobject (*)(JavaVM *, void *, void *)) fake_dlsym(handle, addWeakGlobalRef = (jobject (*)(JavaVM *, void *, void *)) fake_dlsym(handle,
addWeakGloablReferenceSymbol); addWeakGloablReferenceSymbol);
//try disable inline !
void* jitCompileHandlerGlobalAddr = fake_dlsym(handle, "_ZN3art3jit3Jit20jit_compiler_handle_E");
art::jit::JitCompiler* jitCompileHandlerGlobal = *reinterpret_cast<art::jit::JitCompiler**>(jitCompileHandlerGlobalAddr);
art::jit::JitCompiler* jitCompileHandlerTemp = static_cast<art::jit::JitCompiler *>(jitCompilerHandle);
if (jitCompileHandlerGlobal == nullptr) {
return;
}
art::CompilerOptions* options = jitCompileHandlerGlobal->compilerOptions.get();
Size inlineUnit = options->inline_max_code_units_;
options->inline_max_code_units_ = 0;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment