Windows 10 on Mobile JIT support

Don Geronimo

New member
Aug 22, 2014
199
0
0
Visit site
For what use would you need it? JIT is a rather specific use case, after all. In theory anything is possible, but in application I don't think I've seen an app use JIT.
 

kjnoel

New member
Sep 1, 2013
95
0
0
Visit site
For what use would you need it? JIT is a rather specific use case, after all. In theory anything is possible, but in application I don't think I've seen an app use JIT.

Specifically, emulator apps can make use of it. Such is the case for PPSPP (the PSP emulator) and some other emulators not coming to Windows Phone.
 

Don Geronimo

New member
Aug 22, 2014
199
0
0
Visit site
I think it's a possibility, but I don't think it's possible to do it in C# or in JavaScript. For a project like that, the solution would have to be written in C/C++ with DirectX most probably, since that kind of work would require more intensive use of resources, and would run faster than going through C#'s CLR.
 

kjnoel

New member
Sep 1, 2013
95
0
0
Visit site
Thanks for your answer. I really hope Microsoft Considers this. A smartphone OS should explore all avenues, especially if it means more developers can port their Android or iOS apps to the platform or write new ones. We need some more advanced APIs on Windows Phone.
Here's to build 2015.
 

a5cent

New member
Nov 3, 2011
6,622
0
0
Visit site
TBH this question makes no sense. I don't think the answers do either. A JIT compiler for what language? In which runtime environment? Why is MS or the OS assumed to be at all relevant to the question?

Any program can include a JIT compiler if required. The JIT compiler for javascript in IE is an example.

There is absolutely nothing that MS needs to consider for this to work, particularly if the JIT'ed code is executed within an emulator that runs on top of the OS, i.e. no direct hardware access is required.
 

Don Geronimo

New member
Aug 22, 2014
199
0
0
Visit site
I don't think it's an issue of porting, however. If the code for the JIT is written in C/C++ and written in a portable way, it should be able to be compiled and run (caveat: make sure it works, too, and troubleshoot any issues along the way).

JIT compilers are not an OS feature per-se; they're written by people to recompile binary or an intermediary language (like .net's CLR) to the platform on which they run. To my knowledge a general purpose JIT does not exist anywhere.

EDIT: Thanks, @a5cent, for a better answer than I can formulate right now in my head so early in my morning.
 
Last edited:

a5cent

New member
Nov 3, 2011
6,622
0
0
Visit site
I don't think it's an issue of porting, however. If the code for the JIT is written in C/C++ and written in a portable way, it should be able to be compiled and run (caveat: make sure it works, too, and troubleshoot any issues along the way).

It's impossible to say without more information.

If an existing JIT compiler compiles Java bytecode to x86 binary code, there's probably little we could do with that on an ARM based WP device, no matter what language the JIT compiler is written in or how easy it is to port.
 
Last edited:

kjnoel

New member
Sep 1, 2013
95
0
0
Visit site
TBH this question makes no sense. I don't think the answers do either. A JIT compiler for what language? In which runtime environment? Why is MS or the OS assumed to be at all relevant to the question?

Any program can include a JIT compiler if required. The JIT compiler for javascript in IE is an example.

There is absolutely nothing that MS needs to consider for this to work, particularly if the JIT'ed code is executed within an emulator that runs on top of the OS, i.e. no direct hardware access is required.

The following is taken from the PPSPP Emulator FAQ page which states this as the lack of the emulator on Windows Phone:
FAQ for PPSSPP - PSP emulator for Android, Windows, and many more
What is the JIT?
To emulate advanced systems like the PSP fast, the emulator needs to translate the machine code language of the PSP to the machine code language of your PC or mobile device at runtime. This is done with a "Just-In-Time recompiler" or JIT, also known as a Dynarec. PPSSPP has JITs for x86 and ARM.

For a JIT to function, an app needs to have the ability to generate machine code at runtime. This is allowed on Windows, Mac, Linux and Android, while it is completely disallowed on non-jailbroken iOS and on App Store Mac apps, and on Windows Phone 8.

So from what they're saying, it is not allowed on Windows Phone at present, hence my article to find out if that will be an option with Windows 10 on mobiles and small tablets

This forum post has more info on the matter: http://forums.ppsspp.org/showthread.php?tid=3803

Some Iconic Quotes:

1. The problem isn't generating code at run time, we can do that, we simply are not allowed to execute it on WinPhone - and thus it becomes pretty useless.

2. Yes, it's true that we could do a port that only uses the interpreter, and simpler games could run okay on the faster phones. There's no hope to reach anywhere near the same speeds we can on Android though, and I just don't feel like doing that much work and buying extra phones for testing just for a bad play experience.

3. PSX is much much slower than PSP. If you can't even get games to run full speed with a PSX emu on Windows Phone 8, there's no point in porting PPSSPP.
Just wait until Microsoft changes their policy or we get a 'jailbreak'.

4. "Threaded" (not to be confused with multithreaded) interpreters generally get you around 2x over a regular interpreter, while JITs get you 10x+. And it's a much smaller market and the only one with this problem (well, iOS too but that doesn't even allow emulators), but it's indeed pretty likely that at least some games would be fairly playable on fast Windows Phones, maybe even with the current interpreter.
Doing the DX11 port of the GPU emulation might probably be more work than getting the basics of such a CPU core running though..
 

a5cent

New member
Nov 3, 2011
6,622
0
0
Visit site
^ Now that makes more sense. That information would have been required from the outset, because there is no rule which states that a JIT compiler must necessarily generate CPU binary code that is native to the host platform it's running on.

Since you mentioned emulators, I assumed the JIT compiler would compile a program into some non-native format, which would then run on top of the emulator, thereby allowing it to function on WP. That's normally what emulators do. Despite its name, what PPSSPP does is not technically emulation.

Your question should have been whether WP supports the execution of dynamically generated native CPU binary code. You're right. It doesn't. However, the lack thereof is typically not viewed as a missing feature, but as a very justifiable security precaution. On the other hand, (due to permissions and sandboxing) I can't immediately think of how supporting it could compromise security on WP, but I'd definitely be weary.

If you want to call for something like this on uservoice, you'd be better off completely forgetting about the technicalities of the problem and just ask MS to help the PPSSPP team provide an equivalent solution/approach for WP.
 

kjnoel

New member
Sep 1, 2013
95
0
0
Visit site
^ Now that makes more sense. That information would have been required from the outset, because there is no rule which states that a JIT compiler must necessarily generate CPU binary code that is native to the host platform it's running on.

Since you mentioned emulators, I assumed the JIT compiler would compile a program into some non-native format, which would then run on top of the emulator, thereby allowing it to function on WP. That's normally what emulators do. Despite its name, what PPSSPP does is not technically emulation.

Your question should have been whether WP supports the execution of dynamically generated native CPU binary code. You're right. It doesn't. However, the lack thereof is typically not viewed as a missing feature, but as a very justifiable security precaution. On the other hand, (due to permissions and sandboxing) I can't immediately think of how supporting it could compromise security on WP, but I'd definitely be weary.

If you want to call for something like this on uservoice, you'd be better off completely forgetting about the technicalities of the problem and just ask MS to help the PPSSPP team provide an equivalent solution/approach for WP.

Thanks for your answer.
 

Members online

Forum statistics

Threads
323,252
Messages
2,243,527
Members
428,051
Latest member
kuyhaa