Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jit]

The JIT (just-in-time compilation) is a method to improve the run-time performance of computer programs based on byte code (virtual machine code).

0
votes
0answers
25 views

Creating an API for adding third-party JIT support to a VM

I have created my own VM/runtime environment engine and I would like to give my runtime environment an API so that a developer could interface any type of JIT compiler to my VM. So far I've created ...
2
votes
3answers
180 views

What EXACTLY can the Java JIT do?

Is there any documentation that exhaustively lists the optimizations that the Java JIT can make? I can easily find articles with examples of what the JIT can do, but I want to make sure that it's not ...
-1
votes
1answer
99 views

Do JITs typically have their own internal assembler, use a library, or use an executable assembler?

Amongst the successful and widely used JITs out there (e.g. JVM JITs, JavaScript JITs, LuaJIT), is there a strong consensus on how the JIT compiler should interface with an assembler? The plausible ...
0
votes
0answers
91 views

How to manage dynamically generated variables in Assembly

Along the lines of How v8 JIT compiler manages dynamically changing variables, wondering how you would go about creating dynamically generated variables in assembly. Not necessarily looking for ...
9
votes
3answers
5k views

Why hasn't Python been optimized like modern Javascript implementations?

Modern Javascript implementations like V8 (Chrome), SpiderMonkey (Firefox), and Chakra (IE/Edge) all have JIT compilation, and a number of other optimizations to improve performance. Why doesn't ...
0
votes
1answer
253 views

Comparison of modern browsers' javascript engine JITs

I understands that most of the recent browsers use JIT compilation to execute javascript. What I do not understand is: which part of javascript is JIT'ed - the script, or the bytecode? Let me explain....
6
votes
2answers
462 views

How do JIT interpreters handle variable names?

Let's say I am to design a JIT interpreter that translates IL or bytecode to executable instructions at runtime. Every time a variable name is encountered in the code, the JIT interpreter has to ...
2
votes
2answers
114 views

JIT based on precompiled code templates

This is a crazy idea that I just came up with, and I'm interested in knowing if it would be workable, or if someone already wrote about or implemented it. Imagine you are on a platform (a game ...
2
votes
1answer
269 views

Can JIT compilation be non-deterministic?

I have been profiling a lot of javascript today in writing a firefox js engine bug report, and started really noticing the slight differences between JIT compilations. While there are some obvious ...
18
votes
4answers
15k views

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard ...
2
votes
2answers
147 views

What should JITed bytecode do exactly?

I'm working on a VM (and a scripting language for it) that I plan to implement JITing for. I'm only working on the "plumbing" of it now, but I don't want the JIT compiler to be an afterthought. ...
4
votes
1answer
775 views

Do java .class files have a lexer/parser?

I've been learning ANTLR, by writing my own (extremely simple!) programming language It made me curious about how the lexer/parser/AST is implemented for java. Obviously there is a grammar for .java ...
2
votes
0answers
391 views

Does loop unrolling on a JIT platfrom (.NET or JVM) provide any benefit

I know in C, you can use loop unrolling (unwinding) to help reduce branching in your code but at the expense of program size. That seems to work when you compile to a target machine, however, does it ...
4
votes
1answer
638 views

How do hybrid interpreter-JIT compilers work?

Chrome's V8 compiler, the Java HotSpot compiler, and many more have multiple tiers of interpretation and compilation. A function starts off as interpreted in HotSpot and then, if it is run often ...
0
votes
0answers
583 views

Android runtime - does ART miss optimization opportunities over Dalvik?

Is ART a strict improvement over Dalvik, or there are optimizations that an ahead-of-time compiler will miss compared to JIT, but Google decide they don't matter in practice? For example, with JIT, ...
5
votes
1answer
5k views

Why is Android Runtime's AOT compilation more performant than Dalvik's JIT? [closed]

With Android 5.0, Google has introduced the Android Runtime, or ART. ART "brings improvements in performance, garbage collection, applications debugging and profiling." However, it also replaces ...
3
votes
3answers
417 views

Which components/phases of a JIT compiler are different from a traditional ahead of time compiler?

Besides a faster register allocation algorithm and some trade-off in control and data-flow analysis for optimization purposes, which components/phases of a JIT compiler are different from a ...
-1
votes
2answers
670 views

How does the Common Language Runtime improve performance? [duplicate]

I read on the wikipedia article for Common Language Runtime that one of the benefits that the runtime provides is "Performance improvements". Executing managed code (Or bytecode) must surely always ...
10
votes
1answer
243 views

Machine code JITs and the Execution Disable bit

How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit? As far as I know, many modern processors and Operating ...
122
votes
1answer
42k views

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes ...
2
votes
0answers
77 views

How can I find the start of a native method?

For a hobby project, I'm writing an x86 GC and JIT. For the GC, I need to maintain information about the stack layout (it's a precise GC), for which I need to be able to find out which method the IP ...
12
votes
1answer
481 views

What's the relationship between meta-circular interpreters, virtual machines and increased performance?

I've read about meta-circular interpreters on the web (including SICP) and I've looked into the code of some implementations (such as PyPy and Narcissus). I've read quite a bit about two languages ...
-1
votes
1answer
402 views

Does Jar file shrinker affect performance [closed]

I've heard ProGuard's Jar shrinker affects the performance of you application. Is this true? And if so just how much slower does the Jar go shrinked compared to unshrinked?
3
votes
1answer
129 views

Expensive AOT Optimizations

I've seen it stated several times that AOT can run some more expensive optimizations that take too long to be used by a JIT. But I've never seen it stated what exactly these optimizations are. So I'm ...
8
votes
2answers
2k views

Does current JIT optimize generated machine codes for branch prediction based on runtime statistics?

Some JVMs would compile Java byte code into native machine code. We know that there are lots of optimizations we could apply for that. Recently, I also learn that a branch operation may block the CPU ...
117
votes
11answers
52k views

What backs up the claim that C++ can be faster than a JVM or CLR with JIT? [closed]

A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM ...
7
votes
5answers
2k views

Why is it called Just In Time?

I know what the JIT compiler is but how about why is it called that, it obviously catches exceptions Just in Time, but how and why should it be called this? Sorry if this sounds a bit vague.
4
votes
4answers
1k views

Java/C# - When should AOT be considered if reverse engineering is a concern?

Long and short is really in the question title. For a language which compiles to an intermediate language like MSIL or Java byte-code, if there's concern about something like reverse engineering or ...
27
votes
4answers
34k views

Why after each restart, my local .NET sites take time to load for the first time? [closed]

I'm developing sites based on .NET platform. I usually deploy these sites on my local IIS, so that I can test them and see their functionality before going live. However, each time I restart windows, ...
5
votes
1answer
3k views

Pros and cons of JIT and AOT [closed]

In which respects "Just In Time" compilation is better than "Ahead Of Time" compilation? And vice versa. Is AOT same as direct native compilation?
33
votes
4answers
25k views

JIT compiler for C, C++, and the likes

Is there any just-in-time compiler out there for compiled languages, such as C and C++? (The first names that come to mind are Clang and LLVM! But I don't think they currently support it.) ...
9
votes
13answers
4k views

Would a statically typed alternative to JavaScript on webpages be practical?

Preference for dynamic and static typing is largely a matter of taste, and different people find them more or less suitable in different situations. My question is, would it be technically possible ...