2003/05/12 05:31:50
[org.ibex.core.git] / src / org / xwt / MessageQueue.java
index 5f8b17d..6de9185 100644 (file)
@@ -3,7 +3,6 @@ package org.xwt;
 
 import java.util.*;
 import org.xwt.util.*;
-import org.mozilla.javascript.*;
 
 /** 
  *  A singleton class (one instance per JVM) that implements a queue
@@ -41,7 +40,7 @@ public class MessageQueue extends Thread {
     private static MessageQueueWatcher watcher = new MessageQueueWatcher();
 
     // HACK for debugging purposes
-    Function lastfunc = null;
+    Object lastfunc = null;
     Message lastmessage = null;
 
     /**
@@ -116,21 +115,20 @@ public class MessageQueue extends Thread {
         public void run() {
             while(true) {
                 if ((m != null && m == MessageQueue.currentlyPerforming) || MessageQueue.working) {
-                    Context cx;
-                    String what;
-                    if (m == null) {
-                        cx = Context.getContextForThread(MessageQueue.singleton);
-                        what = "trap";
-                    } else if (m instanceof ThreadMessage) {
-                        ThreadMessage tm = (ThreadMessage)m;
-                        cx = Context.getContextForThread(tm);
+                    String what, where;
+                    if (m != null && m instanceof ThreadMessage) {
+                        where = org.xwt.js.JS.getCurrentFunctionSourceName((ThreadMessage)m);
                         what = "background thread";
+                    } else if (m != null) {
+                        where = org.xwt.js.JS.getCurrentFunctionSourceName(MessageQueue.singleton);
+                        what = "event trap";
                     } else {
-                        cx = Context.getContextForThread(MessageQueue.singleton);
+                        where = org.xwt.js.JS.getCurrentFunctionSourceName(MessageQueue.singleton);
                         what = "script";
-                    }
-                    if (Log.on) Log.log(this, "note: executing same " + what + " for " + (System.currentTimeMillis() - t) / 1000 + "s" +
-                                        " at " + cx.interpreterSourceFile + ":" + cx.interpreterLine);
+                   }
+                    if (Log.on) Log.log(this, "note: executing same " + what +
+                                       " for " + (System.currentTimeMillis() - t) / 1000 + "s" +
+                                       " at " + where);
                 } else {
                     m = MessageQueue.currentlyPerforming;
                     t = System.currentTimeMillis();