From daf10ec882bc4da7de8b3ee79cb9edde2591581e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 28 Aug 2016 13:43:46 +0200 Subject: [PATCH] Use JIT on iOS (not actually working yet, but it will start working in later commits) --- ios/ViewController.mm | 7 +------ ios/main.mm | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ios/ViewController.mm b/ios/ViewController.mm index e1a09cfe92..6f00bcdea8 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -99,7 +99,7 @@ static GraphicsContext *graphicsContext; ram_temp_file = [[NSTemporaryDirectory() stringByAppendingPathComponent:@"ram_tmp.file"] fileSystemRepresentation]; - iosCanUseJit = false; + iosCanUseJit = true; targetIsJailbroken = false; NSArray *jailPath = [NSArray arrayWithObjects: @"/Applications/Cydia.app", @@ -112,11 +112,6 @@ static GraphicsContext *graphicsContext; if ([[NSFileManager defaultManager] fileExistsAtPath:string]) { // checking device jailbreak status in order to determine which message to show in GameSettingsScreen targetIsJailbroken = true; - // if we're running on iOS arm64, only iOS <9 is supported with JIT. - // if we're running on anything that isn't arm64, then JIT is supported on all iOS versions. - if (![self isArm64] || ([self isArm64] && kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_IOS_9_0)) { - iosCanUseJit = true; - } } } diff --git a/ios/main.mm b/ios/main.mm index c3e92dabb4..0a294c20cf 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -94,6 +94,8 @@ void Vibrate(int length_ms) { int main(int argc, char *argv[]) { + // Simulates a debugger. Makes it possible to use JIT (though only W^X) + syscall(SYS_ptrace, 0 /*PTRACE_TRACEME*/, 0, 0, 0); @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); }