[Swift-commit] cog r3996

swift at ci.uchicago.edu swift at ci.uchicago.edu
Fri Jul 4 02:05:03 CDT 2014


------------------------------------------------------------------------
r3996 | hategan | 2014-07-04 02:04:40 -0500 (Fri, 04 Jul 2014) | 1 line

no need to keep stack frame count if starting a new thread
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/compiled/nodes/UParallel.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/compiled/nodes/UParallel.java	(revision 3995)
+++ modules/karajan/src/org/globus/cog/karajan/compiled/nodes/UParallel.java	(working copy)
@@ -57,17 +57,12 @@
 		int state = thr.checkSliceAndPopState();
 		Stack stack = thr.getStack();
 		ThreadSetFixed ts = (ThreadSetFixed) thr.popState();
-		int fc = thr.popIntState();
 		try {
 			switch (state) {
 				case 0:
-					fc = stack.frameCount();
-					state++;
-				case 1:
 				    int ec = childCount();
 					final ThreadSetFixed tsf = new ThreadSetFixed(ec);
 					ts = tsf;
-					final int fcf = fc;
 					for (int i = 0; i < ec; i++) {
 						final int fi = i;
 						LWThread ct = thr.fork(i, new KRunnable() {
@@ -78,14 +73,10 @@
 									tsf.threadDone(thr, null);
 								}
 								catch (ExecutionException e) {
-									Stack stack = thr.getStack();
-									stack.dropToFrame(fcf);
 									tsf.threadDone(thr, e);
 									tsf.abortAll();
 								}
 								catch (RuntimeException e) {
-									Stack stack = thr.getStack();
-									stack.dropToFrame(fcf);
 									tsf.threadDone(thr, new ExecutionException(UParallel.this, e));
 									tsf.abortAll();
 								}
@@ -97,12 +88,11 @@
 					}
 					ts.startAll();
 					state++;
-				case 2:
+				case 1:
 					ts.waitFor();
 			}
 		}
 		catch (Yield y) {
-			y.getState().push(fc);
 			y.getState().push(ts);
 			y.getState().push(state);
 			throw y;



More information about the Swift-commit mailing list