Questions tagged [vm-implementation]

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.

294 questions
1
vote
3 answers

Open source Virtual Machine writen in .net?

I am wondering if anyone knows of any open source virtual machine projects? The language it is in does not matter, I would just really love to see how they work. I have done alot of searching and could't find much. I am guessing due to the…
user1632018
  • 2,485
  • 10
  • 52
  • 87
1
vote
2 answers

Ceylon compiler and VM

Are there any Ceylon specific VMs? Or do all available ceylon compilers produce JVM bytecode?
travega
  • 8,284
  • 16
  • 63
  • 91
1
vote
3 answers

Order of frames being pushed on the stack

Suppose you have the following code. def square(x): print ("Just before square returns") for k in dir(): print ("{0} -------> {1}".format(k, eval(k))) return x*x def cube(x): print ("Just before cube returns") for k in…
ncmathsadist
  • 4,684
  • 3
  • 29
  • 45
1
vote
1 answer

How to devise instruction set of a stack based machine?

Stack based virtual machines like CLR and JVM has different set of instructions. Is there any theory behind devising the instruction set while creating a virtual machine? e.g. there are JVM instruction sets to load constants from 0-5 onto the…
Anindya Chatterjee
  • 5,824
  • 13
  • 58
  • 82
0
votes
2 answers

create c# parser, AST tree, CIL and run it in virtual machine

description of my problem is to create: C# parser compose AST tree from parsed input .cs file create CIL/bytecode representation of program create VM execute code stored as "bytecode" - make the parsed program work So basically I need to write my…
luccio
  • 485
  • 1
  • 6
  • 24
0
votes
1 answer

How does the putspecialobject opcode in the RubyVM work?

I'm working on an implementation of the RubyVM and I've searched all over for some documentation on the opcodes, but to no avail. If anyone knows specifically how the putspecialobject opcode works, or even just a link to some fullish documentation…
Daniel X Moore
  • 14,637
  • 17
  • 80
  • 92
0
votes
1 answer

expected dimension but got

this message appeared. as resolver: AAPT: error: expected dimension but got (raw string) match_parent. here is my build: dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation…
0
votes
3 answers

What's the best way to learn about compilers?

I'm trying to learn about how compilers, operating systems, and computer systems work internally. Here's my current plan: Write a simple virtual machine in C, that can accept input written in its machine language ( a custom language of my…
ouiliame
  • 199
  • 1
  • 4
0
votes
1 answer

Does Dalvik create stacks to manage threads

Unlike JVMs, which are simple stack-based machines, the Dalvik VM uses a register-based — which requires fewer instructions, avoids unnecessary memory access — resulting in better performance code. But how does Dalvik manage thread stacks? Does it…
0
votes
0 answers

How would I be able to make a register-based virtual machine code off of a Binary Tree for math interpretation

My code is represented in Dart, but this is more general to the Binary Tree data structure and Register-based VM implementation. I have commented the code for you to understand if you do not know Dart as well. So, here are my nodes: enum NodeType { …
0
votes
1 answer

How do virtual machines like Lua or JVM represent (and work on) larger data types?

Currently working on a toy virtual machine with its own assembly language modelled after ARM, so I'm working towards getting something like this working: // adds the r1 and r2 registers, result goes in r0 add r0, r1, r2 Here's my idea of a 64-bit…
user41997
  • 2,751
  • 2
  • 12
  • 12
0
votes
2 answers

In C ensure that the number of assembly instructions is fixed for multiple sections of code

In a virtual machine I'm writing, I want to be able to dispatch commands in a manner similar to the following pseudo code. add: reg[memory[pc+1]] = reg[memory[pc+1]] + reg[memory[pc+2]]; pc += 2; goto done; sub: reg[memory[pc+1]] = …
Matthew
  • 92
  • 7
0
votes
0 answers

Why does LuaJIT bytecode put the opcode at the end instead of the front?

I've been reading up on virtual machines for interpreted languages. Usually the bytecode format is something like Opcode : Operand/s but with LuaJIT it's the reverse: http://wiki.luajit.org/Bytecode-2.0 A single bytecode instruction is 32 bit wide…
hopibel
  • 1
  • 1
0
votes
1 answer

Load anticipation of Application serve instances in a VM

We currently have multiple Websphere instances deployed in our production environment. They are all on a 64GB VM and each has their own slices of that memory. Currently one of the applications deployed in one of the instances will have an…
0
votes
1 answer

How to simulate a call stack in JavaScript using only a single array

I am looking at the Wikipedia page on Call Stack, and trying to grok this image: This is as far as I get lol: const memory = [] memory[0] = 3 // top of stack pointer memory[1] = 4 // stackframe pointer memory[2] = 1000 // max call stack…
Lance
  • 75,200
  • 93
  • 289
  • 503