Revision: 4772
          http://sourceforge.net/p/vexi/code/4772
Author:   mkpg2
Date:     2015-02-26 21:59:17 +0000 (Thu, 26 Feb 2015)
Log Message:
-----------


Modified Paths:
--------------
    branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Scheduler.java

Modified: 
branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Scheduler.java
===================================================================
--- branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Scheduler.java 
2015-02-26 21:53:55 UTC (rev 4771)
+++ branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/Scheduler.java 
2015-02-26 21:59:17 UTC (rev 4772)
@@ -189,7 +189,7 @@
     
     
     /** Execute read traps */
-    public JS runInCurrent(Trap t) throws JSExn {
+    public JS runInCurrent(Trap t, JS value) throws JSExn {
         if (!(t.function() instanceof JSFunction)) {
             return t.function(); 
         }
@@ -198,10 +198,10 @@
         // REMARK - isFirst <-> old == null?
         boolean isFirst = jsthread==null; 
         if (isFirst) {
-            setJSThread(newThread(this, "current/rtrap", trapf));
+            setJSThread(newThread(this, "current/trap", trapf));
         }
         Interpreter old = jsthread.currentInterpreter;
-        jsthread.currentInterpreter = new Interpreter(jsthread, t, null, 
false, null);
+        jsthread.currentInterpreter = new Interpreter(jsthread, t, value, 
false, null);
         try {
             return (JS)jsthread.currentInterpreter.run(null);
         } finally {
@@ -213,25 +213,6 @@
         }
     }
     
-    public void runInCurrent(Trap t, JS put) throws JSExn {
-       JSFunction trapf = (JSFunction)t.function();
-        boolean isFirst = jsthread==null; 
-        if (isFirst) {
-            setJSThread(newThread(this, "current/rtrap", trapf));
-        }
-        Interpreter old = jsthread.currentInterpreter;
-        jsthread.currentInterpreter = new Interpreter(jsthread, t, put, false, 
null);
-        try {
-            jsthread.currentInterpreter.run(null);
-        } finally {
-            if (isFirst) {
-                jsthread.destroy();
-            } else {
-                jsthread.currentInterpreter = old;
-            }
-        }        
-    }
-    
     // Write traps
     // Split into two stages, 'before put' and 'after put'
     // This allows us to have trap execution that does what it wants 
@@ -385,7 +366,7 @@
         if (t == null || (t = t.findRead()) == null) {
             return (JS)obj.get(key);
         }
-        return runInCurrent(t);
+        return runInCurrent(t, null);
     }
     
     /** Gets the value for a given key, triggering any read traps for the key. 
*/

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to