- Hashtable<PrefetchPair, Float> child_hash = prefetch_hash.get(child_node);
- switch(curr.kind()) {
- case FKind.FlatFieldNode:
- //processFlatFieldNode(child_hash, curr);
- break;
- case FKind.FlatElementNode:
- break;
- case FKind.FlatCall:
- break;
- case FKind.FlatCondBranch:
- break;
- case FKind.FlatNew:
- break;
- case FKind.FlatOpNode:
- break;
- case FKind.FlatSetElementNode:
- break;
- case FKind.FlatSetFieldNode:
- break;
- default:
- /*If FlatNode is not concerned with the prefetch set of its Child then propagate
- * prefetches up the FlatNode*/
- if (prefetch_hash.containsKey(curr)) {
- isCurrMod = true;
- Hashtable<PrefetchPair, Float> currentcopy = prefetch_hash.get(curr);
- Hashtable<PrefetchPair, Float> tocompare = new Hashtable<PrefetchPair, Float>();
- Enumeration e = currentcopy.keys();
- while (e.hasMoreElements()) {
- PrefetchPair pp = (PrefetchPair) e.nextElement();
- if (child_hash.contains(pp)) {
- Float cprob = child_hash.get(pp);
- Float fprob = currentcopy.get(pp);
- // TODO fix this
- Float newprob = cprob.floatValue() * fprob.floatValue();
- tocompare.put(pp, newprob);
- child_hash.remove(pp);
- } else {
- tocompare.put(pp, currentcopy.get(pp));
- }
- }
- for(e = child_hash.keys(); e.hasMoreElements();) {
- PrefetchPair newpp = (PrefetchPair) e.nextElement();
- tocompare.put(newpp, child_hash.get(newpp));
+ child_hash = prefetch_hash.get(child_node);
+ }
+ switch(curr.kind()) {
+ case FKind.FlatFieldNode:
+ //processFlatFieldNode();
+ break;
+ case FKind.FlatElementNode:
+ //processFlatElementNode();
+ break;
+ case FKind.FlatCall:
+ //processFlatCallNode();
+ break;
+ case FKind.FlatCondBranch:
+ //processFlatCondBranchNode();
+ break;
+ case FKind.FlatNew:
+ //processFlatNewNode();
+ break;
+ case FKind.FlatOpNode:
+ //processFlatOpNode();
+ break;
+ case FKind.FlatSetElementNode:
+ //processFlatSetElementNode();
+ break;
+ case FKind.FlatSetFieldNode:
+ //processFlatSetFieldNode();
+ break;
+ default:
+ /*If FlatNode is not concerned with the prefetch set of its Child then propagate
+ * prefetches up the FlatNode*/
+ //TODO make this a new method
+ if(prefetch_hash.containsKey(curr)) {
+ System.out.println("Now Analyzing child node of Flatnode: "+ curr.toString() +" of type "+ curr.kind());
+ //isCurrMod = true;
+ Hashtable<PrefetchPair, Float> currcopy = prefetch_hash.get(curr);
+ Hashtable<PrefetchPair, Float> tocompare = new Hashtable<PrefetchPair, Float>();
+ Enumeration e = currcopy.keys();
+ while (e.hasMoreElements()) {
+ PrefetchPair pp = (PrefetchPair) e.nextElement();
+ System.out.println(pp.toString());
+ if (child_hash.contains(pp)) {
+ Float cprob = child_hash.get(pp);
+ Float fprob = currcopy.get(pp);
+ // TODO fix this
+ Float newprob = cprob.floatValue() * fprob.floatValue();
+ tocompare.put(pp, newprob);
+ child_hash.remove(pp);
+ } else {
+ tocompare.put(pp, currcopy.get(pp));