Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

dump commit

  • Loading branch information...
commit 41267a05e29a368e63ff6323608ad9c6f4f9322f 1 parent d1817d9
@oleganza authored
View
2  analysis.io
@@ -0,0 +1,2 @@
+# For the purpose of runtime optimizer we define messages as functions mapping state(n) to state(n+1)
+
View
5 examples/constants.io
@@ -7,3 +7,8 @@ code := message(
i = i + Answer
)
)
+
+Lobby println
+Protos println
+
+getSlot("code") println
View
73 primitives.io
@@ -1,3 +1,74 @@
-# list of primitives written in a form of bytecode sequences
+# List of primitives written in a form of bytecode sequences
+#
+# Bytecodes
+#
+halt := 1 # stop VM execution
+copyCachedResultToTarget := 2 # retrieve cached result, set it to "target"
+nextMessage := 3 # retrieve next message, set it to "message"
+resetTarget := 4 # set target := chainTarget (after ";" message)
+activateBuiltin := 5 # locate builtin code within message and goto it
+
+#
+# Conditions
+#
+
+messageIsNil := message(
+ popState
+ nextMessage
+)
+messageHasCachedResult := message(
+ copyCachedResultToTarget
+ nextMessage
+)
+messageIsSemicolon := message(
+ resetTarget
+ nextMessage
+)
+messageIsRegular := message(
+ lookupSlot
+ ifMessageIsActivatable(
+ activate,
+ readSlot
+ )
+)
+
+activate := message(
+ ifMessageIsBuiltin(
+ activateBuiltin,
+ activateNonBuiltin
+ )
+)
+readSlot := message(
+ copyValueToTarget;
+ nextMessage
+)
+
+pushState := message(
+ pushMessage
+ pushChainTarget
+ pushTarget
+ pushLocals
+)
+
+popState := message(
+ popLocals
+ popTarget
+ popChainTarget
+ popMessage
+)
+
+activateNonBuiltin := message(
+ pushState
+ createLocals # to @locals
+ setLocalsSelf
+ createCall # to @call
+
+)
+
+if(isLaunchScript,
+
+ messageIsSemicolon println
+
+)
View
0  test/helloWorld.io
No changes.
View
8 vmstate.io
@@ -0,0 +1,8 @@
+# VM state is a set of registers with object pointers
+
+message ::= nil # message to be sent
+chainTarget ::= nil # target for a chain of messages (equals to target in the beginning of the chain or after ";")
+target ::= nil # current target for a message
+locals ::= nil # "call context" - object who sent a message to the "target"
+coroutine ::= nil # current coroutine (stack)
+value ::= nil # current slot value (set by lookupSlot)
Please sign in to comment.
Something went wrong with that request. Please try again.