Design and implementation of virtual machines, interpreters, automata, Turing machines. **DO NOT** use this tag for virtualized computers (VirtualBox, VMWare, ...), unless the question address the implementation of such tools.
Questions tagged [vm-implementation]
294 questions
0
votes
2 answers
What application virtual machines are written in high level languages?
What application virtual machines are out there that are written in higher level languages? C/C++ looks like the languages of choice (for obvious reasons).
What I have found on google is at least two written in Java (both meta-circular) :
JikesRVM…
user95947
0
votes
0 answers
page size, malloc allocation, and language runtimes
Is there any relationship between malloc and the page size (Linux, Windows, Mac)? Can this relationship be exploited for run-time systems that provide memory management themselves (e.g. GC, object allocation, ...)? My guess is that an allocation…

box
- 3,156
- 3
- 26
- 36
0
votes
2 answers
How does this virtual machine convert instructions to hexadecimal values?
I'm learning about virtual machines and I came across this Wikipedia book thing, and it's really good. However, I'm at the section where the writer is explaining how he converts instructions such as:
loadi r0 #100
to
0x1064
And I have no idea how…

metro-man
- 1,763
- 2
- 15
- 28
0
votes
1 answer
How Does Java Interpret Bytecode Constants Larger Than One Byte, Unaligned Efficiently?
While all java byte codes are 1 byte wide, at points there are variable sized constants which could range from 1 byte to 8 bytes. How does java fetch these instructions with operands larger than one byte efficiently since this data access would be…

n00ax
- 307
- 3
- 7
0
votes
3 answers
Virtual Machine Language Development
This is my first post and I am posting from a phone so please excuse the formatting issues I am sure I will have.
As the title suggests, I am wanting to create a language for a small virtual machine that I have written. Currently my virtual machine…

NotAPro
- 11
- 1
0
votes
1 answer
Is it correct to perform a function call like this?
I have an array with 32bit values (nativeParameters with length nativeParameterCount) and a pointer to the function (void* to a cdecl function, here method->nativeFunction) thats supposed to be called. Now I'm trying to do this:
// Push parameters…

maxdev
- 2,491
- 1
- 25
- 50
0
votes
1 answer
Stack Machine with Strings
I'm making a stack based virtual machine in RPython using the PyPy toolchain to convert the RPython to C. So far I have 4 instructions.
EOP - End of Program
EOI - End of Instruction
PUSH - Push item onto the stack
PRINT - Print the top of the…

user3452305
- 27
- 1
- 4
0
votes
1 answer
How is encoding faster than not encoding?
I'm making a virtual machine in C and I was told that by converting the "assembly" code into hexadecimal or binary, I could speed up the execution. My question is, if I have a string and I encode it to numbers, how can it be faster than not encoding…

user3318845
- 301
- 4
- 15
0
votes
1 answer
Virtual Machine Instruction Length
I'm creating a virtual machine and I'm encoding the instructions into byte code. The instructions are hexadecimal numbers like this: 0x1064, this instruction means load the value of 100 (hexadecimal 64) into register 0 and the number of the load…

user3318845
- 301
- 4
- 15
0
votes
0 answers
How to interpret custom instruction set?
I'm writing a virtual machine that directly executes my own assembly code. Here's an example below:
add r1, r2, r3 ; Add the values of reg2 and reg3 and store the result in reg1
As you can see the instructions are laid out as like…

user3318845
- 301
- 4
- 15
0
votes
1 answer
How can byte code be faster?
I'm planning on creating a virtual machine for a language I'm creating and I can't understand how converting my assembly into my own instruction set can make execution faster. If I make the VM understand my assembly, is that not exactly the same as…

user3318845
- 301
- 4
- 15
0
votes
2 answers
Virtual machine design with separate stack and heap
I'm trying to learn a bit more about virtual machines and programming languages in general by implementing some of the stuff that is found in books. The book I'm currently going through keeps the stack and the heap in one memory area. The stack…

David K.
- 6,153
- 10
- 47
- 78
0
votes
1 answer
static variable load process
Recently, I research how virtual machine load static variable, but I encounter a problem as follows:
public class Example{
static{
num = 3;
System.out.print(num);
}
public static int num;
}
The compiler reports an…

KrystalJake
- 103
- 6
0
votes
1 answer
Translating Python for a Virtual Machine
I am currently working on a project involving a new faster execution environment/VM for Python on Linux. The python source is parsed into an intermediate AST, analyzed and the code for the target VM is generated JIT and cached. Due to the JIT nature…

Rahul De
- 393
- 3
- 14
0
votes
3 answers
Why there is no virtual machine for other languages unlike Java?
Why there is a need for Java virtual machine? One is able to run codes written in other languages without using their virtual machine, while java requires JVM to run the code. Why is it that we have a virtual machine for Java, while for other…

Mohit Agarwal
- 147
- 1
- 6