Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-ref2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mu
mu-impl-ref2
Commits
fa61e981
Commit
fa61e981
authored
Mar 19, 2015
by
Kunshan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rebranded to "Mu".
parent
b8e74486
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
20 additions
and
19 deletions
+20
-19
LICENSE
LICENSE
+1
-1
README.md
README.md
+7
-6
build.sbt
build.sbt
+1
-1
src/main/scala/uvm/refimpl/MicroVM.scala
src/main/scala/uvm/refimpl/MicroVM.scala
+1
-1
src/main/scala/uvm/refimpl/clientInterface.scala
src/main/scala/uvm/refimpl/clientInterface.scala
+2
-2
src/main/scala/uvm/refimpl/exceptions.scala
src/main/scala/uvm/refimpl/exceptions.scala
+2
-2
src/main/scala/uvm/refimpl/itpr/FutexManager.scala
src/main/scala/uvm/refimpl/itpr/FutexManager.scala
+1
-1
src/main/scala/uvm/refimpl/itpr/InterpreterThread.scala
src/main/scala/uvm/refimpl/itpr/InterpreterThread.scala
+2
-2
src/main/scala/uvm/refimpl/itpr/ThreadStackManager.scala
src/main/scala/uvm/refimpl/itpr/ThreadStackManager.scala
+1
-1
src/main/scala/uvm/refimpl/mem/scanning/AllScanner.scala
src/main/scala/uvm/refimpl/mem/scanning/AllScanner.scala
+1
-1
src/main/scala/uvm/refimpl/mem/scanning/fieldHandling.scala
src/main/scala/uvm/refimpl/mem/scanning/fieldHandling.scala
+1
-1
No files found.
LICENSE
View file @
fa61e981
M
icroVM
by Kunshan Wang, Yi Lin, Steve Blackburn, Antony Hosking, Michael
M
u Reference Implementation
by Kunshan Wang, Yi Lin, Steve Blackburn, Antony Hosking, Michael
Norrish is licensed under a Creative Commons Attribution-ShareAlike 4.0
International License. Based on a work at http://microvm.org. Permissions beyond
the scope of this license may be available at http://microvm.org.
...
...
README.md
View file @
fa61e981
M
icroVM Reference Implementat
ion 2
==================================
M
u Reference Implementation vers
ion 2
==================================
===
This project is the current reference implementation of MicroVM. This project
implements the current MicroVM specification in
[
microvm-spec
](
https://github.com/microvm/microvm-spec/wiki
)
This project is the current reference implementation of Mu, the micro virtual
machine designed by
[
The Micro Virtual Machine Project
](
http://microvm.org
)
. It
implements the
[
Mu Specification version
2
](
https://github.com/microvm/microvm-spec/wiki
)
This project is based on the
[
simplest-microvm-project
](
https://github.com/microvm/simplest-microvm-project
)
.
...
...
@@ -49,7 +50,7 @@ yum, pacman, etc. for GNU/Linux distributions and Homebrew for Mac OS X).
To download all dependencies from the Maven central repository, invoke
`sbt
update`
.
To generate the M
icroVM
IR parser from its Antlr grammar, invoke
`sbt
To generate the M
u
IR parser from its Antlr grammar, invoke
`sbt
antlr4:antlr4Generate`
. The generated sources will be in
`target/scala-2.11/src_managed`
. Make sure your IDE can see those generated
sources.
...
...
build.sbt
View file @
fa61e981
...
...
@@ -2,7 +2,7 @@ organization := "org.microvm"
name
:=
"microvm-refimpl2"
description
:=
"The second reference implementation of M
icroVM
"
description
:=
"The second reference implementation of M
u, the micro virtual machine
"
licenses
:=
Seq
(
"CC BY-SA 4.0"
->
url
(
"https://creativecommons.org/licenses/by-sa/4.0/legalcode"
))
...
...
src/main/scala/uvm/refimpl/MicroVM.scala
View file @
fa61e981
...
...
@@ -28,7 +28,7 @@ class MicroVM(heapSize: Word = MicroVM.DEFAULT_HEAP_SIZE,
val
irReader
=
new
UIRTextReader
(
new
IDFactory
())
{
// The
µ
VM allocates stacks on the heap in the large object space. It is represented as a bug chunk of byte array.
// The
micro
VM allocates stacks on the heap in the large object space. It is represented as a bug chunk of byte array.
// So the GC must know about this type because the GC looks up the globalBundle for types.
globalBundle
.
allNs
.
add
(
InternalTypes
.
VOID
)
globalBundle
.
typeNs
.
add
(
InternalTypes
.
VOID
)
...
...
src/main/scala/uvm/refimpl/clientInterface.scala
View file @
fa61e981
...
...
@@ -308,7 +308,7 @@ class ClientAgent(microVM: MicroVM) {
private
def
getStackNotNull
(
stack
:
Handle
)
:
InterpreterStack
=
{
stack
.
vb
.
asInstanceOf
[
BoxStack
].
stack
match
{
case
None
=>
throw
new
UvmRuntimeException
(
"Stack argument cannot be a NULL
Micro
VM stack value."
)
case
None
=>
throw
new
UvmRuntimeException
(
"Stack argument cannot be a NULL
micro
VM stack value."
)
case
Some
(
v
)
=>
v
}
}
...
...
@@ -465,7 +465,7 @@ class ClientAgent(microVM: MicroVM) {
microVM
.
trapManager
.
disableWatchPoint
(
wpID
)
}
// Internal methods for
µ
VM
// Internal methods for
the micro
VM
def
putThread
(
thr
:
Option
[
InterpreterThread
])
:
Handle
=
{
val
t
=
InternalTypes
.
THREAD
...
...
src/main/scala/uvm/refimpl/exceptions.scala
View file @
fa61e981
...
...
@@ -5,7 +5,7 @@ import uvm.UvmException
/** Parent of all exceptions in the implementation part. This does not include the data structure and parser outside uvm.refimpl. */
class
UvmRefImplException
(
message
:
String
=
null
,
cause
:
Throwable
=
null
)
extends
UvmException
(
message
,
cause
)
/** Thrown when the
µ
VM cannot allocate memory. */
/** Thrown when the
micro
VM cannot allocate memory. */
class
UvmOutOfMemoryException
(
message
:
String
=
null
,
cause
:
Throwable
=
null
)
extends
UvmRefImplException
(
message
,
cause
)
/** Thrown when an action not required by the specification and not implemented by this refimpl is performed. */
...
...
@@ -13,7 +13,7 @@ class UnimplementedOprationException(message: String = null, cause: Throwable =
/**
* Thrown when a dynamic error (errors that cannot be found at compile time) happens. This refimpl may sometimes throw
* exceptions on static errors rather than checking before running because the
µ
VM has undefined behaviour on static
* exceptions on static errors rather than checking before running because the
micro
VM has undefined behaviour on static
* errors. (It has undefined behaviour on dynamic errors, too.)
*/
class
UvmRuntimeException
(
message
:
String
=
null
,
cause
:
Throwable
=
null
)
extends
UvmRefImplException
(
message
,
cause
)
...
...
src/main/scala/uvm/refimpl/itpr/FutexManager.scala
View file @
fa61e981
...
...
@@ -131,7 +131,7 @@ class FutexManager {
* Adjust waiting queues affected by garbage collection.
* <p>
* @param getMovement A function that maps an object address to its new address if it is moved. Return None otherwise.
* It assumes the new address is not previously occupied. (This shows why
the µVM
must be tightly coupled.)
* It assumes the new address is not previously occupied. (This shows why
a micro virtual machine
must be tightly coupled.)
*/
def
afterGCAdjust
(
getMovement
:
Word
=>
Option
[
Word
])
:
Unit
=
{
val
oldKeys
=
objIndex
.
keySet
.
toList
...
...
src/main/scala/uvm/refimpl/itpr/InterpreterThread.scala
View file @
fa61e981
...
...
@@ -1253,7 +1253,7 @@ class InterpreterThread(val id: Int, microVM: MicroVM, initialStack: Interpreter
/**
* Execute f, but catch the UvmOutOfMemoryException thrown by most allocation methods in the allocator. Out-of-memory
* errors in the
µ
VM usually branches to an exception destination, but has undefined behaviour when ExcClause is
* errors in the
micro
VM usually branches to an exception destination, but has undefined behaviour when ExcClause is
* absent.
* @example {{{
* handleOutOfMemory(excClause) {
...
...
@@ -1277,7 +1277,7 @@ class InterpreterThread(val id: Int, microVM: MicroVM, initialStack: Interpreter
}
/**
* Raise NULL reference error. NULL reference errors in the
µ
VM usually branches to an exception destination, but has
* Raise NULL reference error. NULL reference errors in the
micro
VM usually branches to an exception destination, but has
* undefined behaviour when ExcClause is absent.
*/
private
def
nullRefError
(
excClause
:
Option
[
ExcClause
])
:
Unit
=
{
...
...
src/main/scala/uvm/refimpl/itpr/ThreadStackManager.scala
View file @
fa61e981
...
...
@@ -40,7 +40,7 @@ class ThreadStackManager(microVM: MicroVM) {
* <p>
* About mutator: "Bring your own mutator!" A mutator object is needed to allocate the stack memory. This means all
* callers of the newStack function must have a mutator. Currently they are either ClientAgents which can create stack
* via the "new_stack" message or
µ
VM threads (the InterpreterThread class) which can execute the NEWSTACK
* via the "new_stack" message or
micro
VM threads (the InterpreterThread class) which can execute the NEWSTACK
* instruction.
*/
def
newStack
(
funcVer
:
FuncVer
,
args
:
Seq
[
ValueBox
],
mutator
:
Mutator
)
:
InterpreterStack
=
{
...
...
src/main/scala/uvm/refimpl/mem/scanning/AllScanner.scala
View file @
fa61e981
...
...
@@ -13,7 +13,7 @@ object AllScanner {
}
/**
* Traverse through all references in the
µ
VM.
* Traverse through all references in the
micro
VM.
*/
class
AllScanner
(
val
microVM
:
MicroVM
,
val
handler
:
RefFieldHandler
)
extends
RefFieldHandler
{
import
AllScanner._
...
...
src/main/scala/uvm/refimpl/mem/scanning/fieldHandling.scala
View file @
fa61e981
...
...
@@ -20,7 +20,7 @@ trait RefFieldHandler {
/** Scan a memory location. */
def
fromMem
(
objRef
:
Word
,
iRef
:
Word
,
toObj
:
Word
,
isWeak
:
Boolean
,
isTR64
:
Boolean
)
:
Option
[
Word
]
/**
* A reference from somewhere internal to the
µ
VM.
* A reference from somewhere internal to the
micro
VM.
* For example, from the StackMemory to the memory byte array;
* from a finaliser table to a finalisable object (to be added).
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment