1. kjnoel's Avatar
    Quick question. Does anyone know whether Windows 10 for phones and small tablets will support JIT compilation?
    04-24-2015 10:31 AM
  2. Don Geronimo's Avatar
    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.
    04-24-2015 04:29 PM
  3. kjnoel's Avatar
    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.
    noersetiawan likes this.
    04-24-2015 04:53 PM
  4. Don Geronimo's Avatar
    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 likes this.
    04-24-2015 05:06 PM
  5. kjnoel's Avatar
    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.
    noersetiawan likes this.
    04-25-2015 07:45 AM
  6. a5cent's Avatar
    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 and xandros9 like this.
    04-25-2015 08:01 AM
  7. Don Geronimo's Avatar
    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 by Don Geronimo; 04-25-2015 at 08:16 AM.
    04-25-2015 08:06 AM
  8. a5cent's Avatar
    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 by a5cent; 04-25-2015 at 09:45 AM.
    xandros9 likes this.
    04-25-2015 09:34 AM
  9. kjnoel's Avatar
    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 likes this.
    04-27-2015 06:55 AM
  10. a5cent's Avatar
    ^ 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 likes this.
    04-27-2015 08:10 AM
  11. kjnoel's Avatar
    ^ 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.
    04-27-2015 08:14 PM
  12. illidanx's Avatar
    04-29-2015 08:11 PM

Similar Threads

  1. Replies: 3
    Last Post: 04-28-2015, 09:28 AM
  2. My Lumia925 running Windows 10 preview is dead, how can I revive it?
    By Windows Central Question in forum Nokia Lumia 925
    Replies: 15
    Last Post: 04-25-2015, 09:20 PM
  3. Anyone installed WP10 TP on L1320...????
    By Utkarsh Gajera in forum Windows 10 Mobile Insider Preview
    Replies: 1
    Last Post: 04-24-2015, 09:12 PM
  4. Om Nom moves into the Windows Store with Cut the Rope 2 for Windows 8.1
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 04-24-2015, 09:50 AM
  5. Windows 10 build 10061: Everything you need to know
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 04-24-2015, 09:11 AM
LINK TO POST COPIED TO CLIPBOARD