From 7af633c8213547d438aa4f6ef5f5c4327210020d Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 3 Aug 2006 21:38:14 +0000 Subject: [PATCH] checked in changes --- Robust/src/IR/Flat/BuildCode.java | 36 +++++++++++++++++++++++++++++++ Robust/src/designnotes | 15 +++++++++++++ 2 files changed, 51 insertions(+) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index c4c2ac05..2eadde12 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -9,6 +9,7 @@ public class BuildCode { Hashtable paramstable; Hashtable tempstable; Hashtable fieldorder; + Hashtable flagorder; int tag=0; String localsprefix="___locals___"; String paramsprefix="___params___"; @@ -25,6 +26,7 @@ public class BuildCode { paramstable=new Hashtable(); tempstable=new Hashtable(); fieldorder=new Hashtable(); + flagorder=new Hashtable(); this.typeutil=typeutil; virtualcalls=new Virtual(state); } @@ -141,6 +143,7 @@ public class BuildCode { } private int maxcount=0; + /** This function outputs the virtual dispatch tables for methods. */ private void buildVirtualTables(PrintWriter outvirtual) { Iterator classit=state.getClassSymbolTable().getDescriptorsIterator(); @@ -314,6 +317,39 @@ public class BuildCode { } } + + /* Map flags to integers consistently between inherited + * classes. */ + + private void mapFlags(ClassDescriptor cn) { + ClassDescriptor sp=cn.getSuperDesc(); + if (sp!=null) + mapFlags(sp); + int max=0; + if (!flagorder.containsKey(cn)) { + Hashtable flags=new Hashtable(); + flagorder.put(cn,flags); + if (sp!=null) { + Hashtable superflags=(Hashtable)flagorder.get(sp); + Iterator superflagit=superflags.keySet().iterator(); + while(superflagit.hasNext()) { + FlagDescriptor fd=(FlagDescriptor)superflagit.next(); + Integer number=(Integer)superflags.get(fd); + flags.put(fd, number); + if (number.intValue()>max) + max=number.intValue(); + } + } + + Iterator flagit=cn.getFlags(); + while(flagit.hasNext()) { + FlagDescriptor fd=(FlagDescriptor)flagit.next(); + if (sp==null||!sp.getFlagTable().contains(fd.getSymbol())) + flags.put(fd, new Integer(++max)); + } + } + } + /** This function outputs (1) structures that parameters are * passed in (when PRECISE GC is enabled) and (2) function * prototypes for the methods */ diff --git a/Robust/src/designnotes b/Robust/src/designnotes index eba714f0..f0d2b3b3 100644 --- a/Robust/src/designnotes +++ b/Robust/src/designnotes @@ -81,3 +81,18 @@ task foo(type1 o1{role1||role2}, type2 o2{role3}) { exit(o1{role1'=false},o2{role3'=false},onew{role4=true}); } +---------------------------------------------------------------- +---------------------------------------------------------------- + +Initial design: +---------------------------------------------------------------- + +Provide runtime with: +1) List of tasks + a) Task names + b) Parameter types + c) Flag settings + +2) List of flags for each type + +3) Flag transition calls -- 2.34.1