From 0bb4a5a8dd291135822cd51a218386b22cf37e3c Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 23 Jun 2009 05:41:03 +0000 Subject: [PATCH] more changes --- Robust/src/IR/Flat/BuildCode.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index ce153658..22686a7a 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -172,8 +172,10 @@ public class BuildCode { outmethodheader.println("#include \"structdefs.h\""); if (state.DSM) outmethodheader.println("#include \"dstm.h\""); - if (state.SINGLETM) + if (state.SINGLETM) { outmethodheader.println("#include \"tm.h\""); + outmethodheader.println("#include \"delaycomp.h\""); + } if (state.ABORTREADERS) { outmethodheader.println("#include \"abortreaders.h\""); outmethodheader.println("#include "); @@ -1958,9 +1960,18 @@ public class BuildCode { generateFlatNode(fm, lb, current_node, output); nextnode=fsen.getFlatExit().getNext(0); } else if (state.DELAYCOMP) { - if (genset==null||genset.contains(current_node)) + boolean specialprimitive=false; + //skip literals...no need to add extra overhead + if (storeset!=null&&storeset.contains(current_node)&¤t_node.kind()==FKind.FlatLiteralNode) { + TypeDescriptor typedesc=((FlatLiteralNode)current_node).getType(); + if (!typedesc.isClass()&&!typedesc.isArray()) { + specialprimitive=true; + } + } + + if (genset==null||genset.contains(current_node)||specialprimitive) generateFlatNode(fm, lb, current_node, output); - if (storeset!=null&&storeset.contains(current_node)) { + if (storeset!=null&&storeset.contains(current_node)&&!specialprimitive) { TempDescriptor wrtmp=current_node.writesTemps()[0]; if (firstpass) { //need to store value written by previous node -- 2.34.1