From 948b933142113b6e7c295b9e2a5a8c7cb5445a91 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 16 Aug 2006 07:24:43 +0000 Subject: [PATCH] changes --- Robust/src/IR/Flat/BuildCode.java | 13 ++++++++++--- Robust/src/Runtime/runtime.c | 26 +++++++++++++++++++------- Robust/src/Runtime/runtime.h | 4 ++-- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 09679d14..a86a8c39 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -86,6 +86,7 @@ public class BuildCode { outstructs.println("#define STRINGTYPE "+typeutil.getClass(TypeUtil.StringClass).getId()); outstructs.println("#define CHARARRAYTYPE "+ (state.getArrayNumber((new TypeDescriptor(TypeDescriptor.CHAR)).makeArray(state))+state.numClasses())); + outstructs.println("#define NUMCLASSES "+state.numClasses()); if (state.TASK) outstructs.println("#define STARTUPTYPE "+typeutil.getClass(TypeUtil.StartupClass).getId()); @@ -486,8 +487,10 @@ public class BuildCode { /* Output class structure */ classdefout.println("struct "+cn.getSafeSymbol()+" {"); classdefout.println(" int type;"); - if (cn.hasFlags()) + if (cn.hasFlags()) { classdefout.println(" int flag;"); + classdefout.println(" void * flagptr;"); + } printClassStruct(cn, classdefout); classdefout.println("};\n"); @@ -1087,13 +1090,17 @@ public class BuildCode { while(orit.hasNext()) { TempDescriptor temp=(TempDescriptor)orit.next(); int ormask=((Integer)flagortable.get(temp)).intValue(); - output.println("flagor("+generateTemp(fm, temp)+", 0x"+Integer.toHexString(ormask)+");"); + int andmask=0xFFFFFFF; + if (flagandtable.containsKey(temp)) + andmask=((Integer)flagandtable.get(temp)).intValue(); + output.println("flagorand("+generateTemp(fm, temp)+", 0x"+Integer.toHexString(ormask)+", 0x"+Integer.toHexString(andmask)+");"); } Iterator andit=flagandtable.keySet().iterator(); while(andit.hasNext()) { TempDescriptor temp=(TempDescriptor)andit.next(); int andmask=((Integer)flagandtable.get(temp)).intValue(); - output.println("flagand("+generateTemp(fm, temp)+", 0x"+Integer.toHexString(andmask)+");"); + if (!flagortable.containsKey(temp)) + output.println("flagorand("+generateTemp(fm, temp)+", 0, 0x"+Integer.toHexString(andmask)+");"); } } } diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index a6e2f6a9..4272a0e9 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -11,12 +11,14 @@ extern int classsize[]; #endif #ifdef TASK +#include "tasks.h" + int main(int argc, char **argv) { int i; /* Allocate startup object */ struct ___StartupObject___ *startupobject=(struct ___StartupObject___*) allocate_new(STARTUPTYPE); - /* Set flag */ - flagor(startupobject,1); + /* Set flags */ + flagorand(startupobject,1,0xFFFFFFFF); /* Build array of strings */ struct ArrayObject * stringarray=allocate_newarray(STRINGARRAYTYPE, argc); @@ -30,15 +32,25 @@ int main(int argc, char **argv) { processtasks(); } -void flagor(void * ptr, int ormask) { +void flagorand(void * ptr, int ormask, int andmask) { ((int *)ptr)[1]|=ormask; -} - -void flagand(void * ptr, int andmask) { ((int *)ptr)[1]&=andmask; } -void processtasks(); +void processtasks() { + int i; + + for(i=0;inumParameters;j++) { + struct parameterdescriptor *param=task->descriptorarray[j]; + + } + } + +} #endif int ___Object______hashcode____(struct ___Object___ * ___this___) { diff --git a/Robust/src/Runtime/runtime.h b/Robust/src/Runtime/runtime.h index f9031810..c3d19527 100644 --- a/Robust/src/Runtime/runtime.h +++ b/Robust/src/Runtime/runtime.h @@ -10,7 +10,7 @@ struct ___String___ * NewString(char *str,int length); void failedboundschk(); void failednullptr(); -void flagor(void * ptr, int ormask); -void flagand(void * ptr, int andmask); +void flagorand(void * ptr, int ormask, int andmask); + #endif -- 2.34.1