stack vs register based VM flamewars when I convert both to a single-static-assignment-based intermediate representation
Follow

@hayley eh I were into one of these flames.

If you have a low resource CPU, like mobile CPU of few years ago, or desktop CPU in the 1995-2010 era (when the JVM was taking over the world) then a register based VM seems a better decision, as reported by [1] and [2].

Nowdays, with faster CPU and plenty of RAM, I don't know.

In [1] they added to the JVM Jikes VM a support for a register based byte code. The register based VM spend less time converting the code to CPU code. In one extreme case it was 0.3s vs 9.0s. Then, it seems that the stack VM produced faster code, but 9s of "startup" time are a lot.

In [2] they show that an interpreter of a register based VM is 33% faster respect an interpreter of a stack VM.

So in a typical low resource scenario of the past (when the wars between the two VM approach started), the register based VM seem more hardware-friendly.

[1] SSA-Based Mobile Code: Implementation and Empirical Evaluation - Wolfram Amme, Jeffery Von Ronne , Michael Franz dl.acm.org/doi/pdf/10.1145/125

[2] Virtual machine showdown: stack versus registers - Yunhe Shi, David. Gregg, M. Ertl - usenix.org/legacy/events/vee05

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.