[Tinyos-commits] CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate
OPmframe.nc, NONE, 1.1 MOPcallM.nc, 1.2, 1.3 Memory.nc, 1.2,
1.3 MemoryM.nc, 1.2, 1.3 MotlleFrame.nc, 1.2,
1.3 MotlleObjectsM.nc, 1.3, 1.4 MotlleStack.nc, 1.2,
1.3 MotlleTypes.nc, 1.3, 1.4 MotlleValues.nc, 1.2,
1.3 motlle.ldf, 1.2, 1.3
David Gay
idgay at users.sourceforge.net
Sun Oct 23 14:09:26 PDT 2005
- Previous message: [Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
FNseqM.nc, NONE, 1.1 FNbasicM.nc, 1.3, 1.4 FNstringM.nc, 1.2, 1.3
- Next message: [Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
FNlist.nc, 1.2, 1.3 FNlistM.nc, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19711
Modified Files:
MOPcallM.nc Memory.nc MemoryM.nc MotlleFrame.nc
MotlleObjectsM.nc MotlleStack.nc MotlleTypes.nc
MotlleValues.nc motlle.ldf
Added Files:
OPmframe.nc
Log Message:
marks on values for detecting circular structures
valid_list test
sequence functions (incl. for-each)
frames with attached (nesC) code
consequent revamp of pc->opcode mapping
still needs: testing. revamp of opmhandler4 (to just opmhandler)
PC now indicates special instructions for pc=0 (opmhandler), pc=1 (halt),
pc=2 (execute frame code)
--- NEW FILE: OPmframe.nc ---
configuration OPmframe {
provides interface MateBytecode;
}
implementation {
components Memory;
MateBytecode = Memory;
}
Index: MOPcallM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MOPcallM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MOPcallM.nc 30 Nov 2004 18:52:42 -0000 1.2
--- MOPcallM.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 91,94 ****
--- 91,98 ----
}
+ /* not used */
+ command void InterpretFrame.execute(MateContext *context, void *vframe) {
+ }
+
command msize InterpretFrame.gc_forward(MateContext *context,
void *vframe,
***************
*** 293,297 ****
{
// Terminate handler (see MemoryM.HandlerStore.getOpcode)
- context->currentHandler = context->rootHandler;
context->pc = 1;
}
--- 297,300 ----
Index: Memory.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/Memory.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Memory.nc 30 Nov 2004 18:52:42 -0000 1.2
--- Memory.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 7,10 ****
--- 7,11 ----
interface MotlleGlobals as G;
interface MotlleStack as S;
+ interface MateBytecode as Frame;
}
uses interface MotlleFrame[uint8_t kind];
***************
*** 20,23 ****
--- 21,25 ----
S = MemoryM;
MotlleFrame = MemoryM;
+ Frame = MemoryM;
MemoryM.V -> MProxy;
Index: MemoryM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MemoryM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MemoryM.nc 30 Nov 2004 18:52:42 -0000 1.2
--- MemoryM.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 8,11 ****
--- 8,12 ----
interface MotlleStack as S;
interface MateEngineControl as EngineControl;
+ interface MateBytecode as Frame;
}
uses {
***************
*** 88,103 ****
MINLINE command MateOpcode HandlerStore.getOpcode[uint8_t id](uint16_t which) {
! /* We dispatch to handlers using a special opcode, after that we
! live in a special "handler" which corresponds to the whole "capsule"
! (and where pc addresses are just offsets from the base of our
! memory segment). When the handler terminates, we return to the
! original handler with pc != 0 */
!
! if (id < MATE_HANDLER_NUM)
! // the test on gvars confirms that code has been installed
! // (before then we have no globals, so handlers must not trigger)
! return which == 0 && gvars ? OP_MHANDLER4 + id : OP_HALT;
! return (call GC.base())[which];
}
--- 89,104 ----
MINLINE command MateOpcode HandlerStore.getOpcode[uint8_t id](uint16_t which) {
! // the test on gvars confirms that code has been installed
! if (!gvars)
! return OP_HALT;
! /* Special values of PC denote special opcodes */
! switch (pc)
! {
! case 0: return OP_MHANDLER4 + id;
! case 1: return OP_HALT;
! case 2: return OP_FRAME;
! default: return (call GC.base())[which];
! }
}
***************
*** 232,235 ****
--- 233,246 ----
}
+ command result_t Frame.execute(uint8_t instr, MateContext *context) {
+ void *vframe = call S.current_frame(context);
+ call MotlleFrame.execute[framekind(call S.fp(context))](context, vframe);
+ return SUCCESS;
+ }
+
+ command uint8_t Frame.byteLength() {
+ return 0; /* strange, but true. */
+ }
+
// Reserve stack space
command bool S.reserve(MateContext *context, msize n) {
***************
*** 271,274 ****
--- 282,293 ----
}
+ MINLINE command mvalue S.getOtherFrame(void *sp, uint8_t idx) {
+ return call V.read((svalue *)sp + idx);
+ }
+
+ MINLINE command void S.putOtherFrame(void *sp, uint8_t idx, mvalue x) {
+ return call V.write((svalue *)sp + idx, x);
+ }
+
MINLINE command mvalue S.get(MateContext *context, uint8_t idx) {
return call V.read((svalue *)sp + idx);
Index: MotlleFrame.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotlleFrame.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MotlleFrame.nc 30 Nov 2004 18:52:42 -0000 1.2
--- MotlleFrame.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 3,6 ****
--- 3,7 ----
interface MotlleFrame
{
+ command void execute(MateContext *context);
command msize gc_forward(MateContext *context, void *vframe, uint8_t *lfp, uint8_t *lsp);
}
Index: MotlleObjectsM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotlleObjectsM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MotlleObjectsM.nc 14 Oct 2005 00:21:39 -0000 1.3
--- MotlleObjectsM.nc 23 Oct 2005 21:09:24 -0000 1.4
***************
*** 297,299 ****
--- 297,326 ----
return call T.real(x);
}
+
+ command bool T.valid_list(mvalue l, msize *len) {
+ bool ok = TRUE;
+ mvalue scan;
+
+ *len = 0;
+
+ /* Check for valid, non-circular list using marks. Clear marks
+ when done. */
+ for (scan = l;; scan = (call T.pair(l))->cdr)
+ {
+ if (call T.nilp(scan))
+ break;
+ if (!call T.pairp(scan) || call V.marked(scan))
+ {
+ ok = FALSE;
+ break;
+ }
+ call V.mark(scan);
+ }
+ for (scan = l;; scan = (call T.pair(l))->cdr)
+ {
+ if (call T.nilp(scan) || !call V.marked(scan))
+ return ok;
+ call V.unmark(scan);
+ }
+ }
}
Index: MotlleStack.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotlleStack.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MotlleStack.nc 30 Nov 2004 18:52:42 -0000 1.2
--- MotlleStack.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 18,20 ****
--- 18,23 ----
command mvalue pop(MateContext *context, uint8_t n);
command mvalue get(MateContext *context, uint8_t sindex);
+
+ command mvalue getOtherFrame(void *sp, uint8_t sindex);
+ command void putOtherFrame(void *sp, uint8_t sindex, mvalue v);
}
Index: MotlleTypes.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotlleTypes.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MotlleTypes.nc 14 Oct 2005 00:21:39 -0000 1.3
--- MotlleTypes.nc 23 Oct 2005 21:09:24 -0000 1.4
***************
*** 63,65 ****
--- 63,68 ----
command vreal number(mvalue x);
/* Returns: number x (int or real) as a real */
+
+ command bool valid_list(MateContext *context, mvalue l, msize *len);
+
}
Index: MotlleValues.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/MotlleValues.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MotlleValues.nc 30 Nov 2004 18:52:42 -0000 1.2
--- MotlleValues.nc 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 49,51 ****
--- 49,56 ----
// may obviate the need for relocation...)
command void relocate(void *loaded, msize s);
+
+ // Marks. Use the forwarding bits, so don't use if GC can occur!
+ command void mark(mvalue x);
+ command void unmark(mvalue x);
+ command bool marked(mvalue x);
}
Index: motlle.ldf
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/mate/motlle.ldf,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** motlle.ldf 30 Nov 2004 18:52:43 -0000 1.2
--- motlle.ldf 23 Oct 2005 21:09:24 -0000 1.3
***************
*** 51,53 ****
--- 51,54 ----
<PRIMITIVE opcode="mwritedl">
<PRIMITIVE opcode="mwritedl3">
+ <PRIMITIVE opcode="mframe">
<PRIMITIVE opcode="mhandler4" locks=true>
- Previous message: [Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
FNseqM.nc, NONE, 1.1 FNbasicM.nc, 1.3, 1.4 FNstringM.nc, 1.2, 1.3
- Next message: [Tinyos-commits]
CVS: tinyos-1.x/tos/lib/VM/languages/motlle/mate/runtime
FNlist.nc, 1.2, 1.3 FNlistM.nc, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-commits
mailing list